Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
hojtsy is currently offline  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 396 times)

[Updated on: Fri, 31 December 2010 23:37]

Report message to a moderator

icon14.gif  Re: Fix for examples/CodeMetric [message #30449 is a reply to message #30444] Sat, 01 January 2011 20:48 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Great! Smile I really like this tool. Plus it is a nice example of how to use the parser.

Honza
Re: Fix for examples/CodeMetric [message #30964 is a reply to message #30449] Sun, 30 January 2011 12:51 Go to previous message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Applied.
Previous Topic: array vs. array's items.id sorting/searching
Next Topic: Simple IPC using Sockets
Goto Forum:
  


Current Time: Sun Jun 23 17:36:40 CEST 2024

Total time taken to generate the page: 0.01768 seconds