Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Fix for examples/CodeMetric
Fix for examples/CodeMetric [message #30444] |
Fri, 31 December 2010 23:11 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
Hi,
I have fixed the compile errors in examples/CodeMetric project. The errors appeared because of changes in the underlying library code. See attached new version for examples/CodeMetric/Analyise.cpp
I have found two other library issues in the process:
Issue 1: The constructor for CppItem in CppBase.h initializes some of the fields, but many fields are left uninitialized. Additionally some byte fields are initialized with boolean literals. This can not be intentional, right? If nothing else, code readability would improve with all fields initialized with a constant of the proper type.
Issue 2: The CppBase parser fails to parse source code in which a statement line in a function body starts with non-whitespace character. Example code:
int main()
{
return 0; // Error: Name expected. Indenting to this line fixes the error.
}
Such parse errors are very easy to check with CodeMetric, once the attached fix is applied to it. Just paste the source code into the CodeMetric window, and the lower panel will show any parser errors.
(Edit: updated attachment)
Cheers,
hojtsy
-
Attachment: Analyse.cpp
(Size: 3.53KB, Downloaded 407 times)
[Updated on: Fri, 31 December 2010 23:37] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat Nov 09 04:09:04 CET 2024
Total time taken to generate the page: 0.01162 seconds
|