I had to change a project from folder and when opening the project, it obviously couldn't find those files.
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\C2dShock.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\C2dShock.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CAddTransparencyCB.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CBlurShader.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CBlurShader.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CDepthMapCallback.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CDepthMapCallback.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CFXAA.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CMotionBlur.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CMotionBlur.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CNightVision.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CPostProcessingHandler.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuad.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuadCB.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuadCB.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuadSceneNode.cpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuadSceneNode.hpp" />
<Unit filename="..\..\..\..\projets\bc0.2\libs\mirrpp\CScreenQuadShader.hpp" />
but I couldn't remove them from the interface, I've been compelled to edit manually the project file.
When using the "Insert -> All method without implementation" to insert the implementation of TestFunction() for this header file:
TestClass.h
#ifndef TESTCLASS_H
#define TESTCLASS_H
class TestClass
{
public:
TestClass();
virtual ~TestClass();
int* TestFunction();
};
#endif // TESTCLASS_H
I got following code:
TestClass.cpp
#include "TestClass.h"
TestClass::TestClass(){}
TestClass::~TestClass(){}
int TestClass::TestFunction()
{
}
The return type of TestFunction missed the "*".
I have tried reparsing the project, but the problem is still there.
I can confirm the error submitted by zetab, I can also say that it happens for C functions and not only for C++ classes (C functions that return char* are shown as returning char), and I have found another serious flaw with return types:
As one types a simple C program like this:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf(
}
Upon typing the opening bracket of the standard function 'printf', which fires the printf declaration hint, the hint will show the function as "__MINGW_NOTHROW printf(const char*, ...)" thus omitting the return type (int) and the other declarations (_CRTIMP, __cdecl). Tested with the latest nightly (from this thread) and MinGW GCC 4.6.1.
Upon typing the opening bracket of the standard function 'printf', which fires the printf declaration hint, the hint will show the function as "__MINGW_NOTHROW printf(const char*, ...)" thus omitting the return type (int) and the other declarations (_CRTIMP, __cdecl). Tested with the latest nightly (from this thread) and MinGW GCC 4.6.1.
This is known but not an easy thing to do. I've done some work on it which improves this, but not fully completed yet.
Also, I'm not sure if it's supposed to work (I think it used to work a couple builds ago, but my memory is a bit blurry), but the declaration hint is not shown for function-like macros, e.g. in this stupid little test macro:
#define TEST_MACRO(x) ((x) * (x))
int main()
{
TEST_MACRO(
}
jens, I have forgot to mention that it's under Debian wheezy. I have created a script and it runs like this:
make clean && \
make distclean && \
./bootstrap && \
./configure --with-contrib-plugins=all && \
make && sudo make install
Up to now it was working just fine, cleaning literally everything that I could see. This issue appeared in svn-7789 and afterwards. Shall I try to uninstall it and run a clean install?
Hi,
I compiled Code::Blocks (trunk, rev 7916, minGW32) with -Wextra and saw some warnings what is similar to a bug:
D:\WORK\cb\trunk\src\plugins\codecompletion\parser/tokenizer.h:348:36: warning: comparison of unsigned expression < 0 is always false
D:\WORK\cb\trunk\src\plugins\codecompletion\parser/tokenizer.h:381:54: warning: comparison of unsigned expression >= 0 is always true
D:\WORK\cb\trunk\src\plugins\codecompletion\parser\tokenizer.cpp:273:53: warning: comparison of unsigned expression >= 0 is always true
D:\WORK\cb\trunk\src\plugins\scriptedwizard\wizpage.cpp:482:54: warning: comparison of unsigned expression < 0 is always false
D:\WORK\cb\trunk\src\plugins\codecompletion\parser\tokenstree.cpp:222:41: warning: comparison is always false due to limited range of data type
Regards,
VinniPuh.
Hi,
I compiled Code::Blocks (trunk, rev 7916, minGW32) with -Wextra and saw some warnings what is similar to a bug:
D:\WORK\cb\trunk\src\plugins\codecompletion\parser/tokenizer.h:348:36: warning: comparison of unsigned expression < 0 is always false
D:\WORK\cb\trunk\src\plugins\codecompletion\parser/tokenizer.h:381:54: warning: comparison of unsigned expression >= 0 is always true
D:\WORK\cb\trunk\src\plugins\codecompletion\parser\tokenizer.cpp:273:53: warning: comparison of unsigned expression >= 0 is always true
D:\WORK\cb\trunk\src\plugins\scriptedwizard\wizpage.cpp:482:54: warning: comparison of unsigned expression < 0 is always false
D:\WORK\cb\trunk\src\plugins\codecompletion\parser\tokenstree.cpp:222:41: warning: comparison is always false due to limited range of data type
Regards,
VinniPuh.
Hi, many thanks.
I will fix them.
EDIT: Here is the candidate change.
/** Return (peek) the previous character */
wxChar PreviousChar() const
{
if ( ((m_TokenIndex - 1) < 0) || (m_BufferLen==0) ) // (m_TokenIndex - 1) >= m_BufferLen can never be true
return 0;
return m_Buffer.GetChar(m_TokenIndex - 1);
};
Here:
The left is unsigned int, so its result is always >=0.
The only right case is (m_TokenIndex==0), right?
The next issue:
So, it need to change to
Then
((m_TokenIndex - numBackslash) >= 0)
should be change to
m_TokenIndex >= numBackslash
Forth issue:
id = (cmb->GetCount() - 1) < 0 ? 0 : (cmb->GetCount() - 1);
should change to:
The last issue:
size_t TokensTree::FindMatches(const wxString& s, TokenIdxSet& result, bool caseSensitive, bool is_prefix, short int kindMask)
{
result.clear();
std::set<size_t> lists;
int numitems = m_Tree.FindMatches(s, lists, caseSensitive, is_prefix);
if (!numitems)
return 0;
// now the lists contains indexes to all the matching keywords
// first loop will find all the keywords
for (std::set<size_t>::iterator it = lists.begin(); it != lists.end(); ++it)
{
TokenIdxSet* curset = &(m_Tree.GetItemAtPos(*it));
// second loop will get all the items mapped by the same keyword,
// for example, we have ClassA::foo, ClassB::foo ...
if (curset)
{
for (TokenIdxSet::iterator it2 = curset->begin(); it2 != curset->end(); ++it2)
{
Token* token = at(*it2);
if ( token
&& ( (kindMask == tkUndefined)
|| (token->m_TokenKind & kindMask) ) )
result.insert(*it2);
}
}
}
return result.size();
}
If I remember correct, the function parameter "short int" should be changed to Enum TokenKind type.
Here:
The left is unsigned int, so its result is always >=0.
The only right case is (m_TokenIndex==0), right?
I would do this differently (to improve readability) and change if clause to check for the opposite:
/** Return (peek) the previous character */
wxChar PreviousChar() const
{
if ( (m_TokenIndex > 0) && (m_BufferLen > 0) ) // m_TokenIndex > m_BufferLen can never be true
return m_Buffer.GetChar(m_TokenIndex - 1);
return 0;
};
The rest seems OK.