|
From: <got...@us...> - 2009-11-16 21:28:57
|
Revision: 463
http://scstudio.svn.sourceforge.net/scstudio/?rev=463&view=rev
Author: gotthardp
Date: 2009-11-16 21:28:32 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
Fix the last GCC warnings.
Modified Paths:
--------------
trunk/src/data/beautify/instance_sequencer.cpp
trunk/tests/checker_test.cpp
Modified: trunk/src/data/beautify/instance_sequencer.cpp
===================================================================
--- trunk/src/data/beautify/instance_sequencer.cpp 2009-11-16 17:25:30 UTC (rev 462)
+++ trunk/src/data/beautify/instance_sequencer.cpp 2009-11-16 21:28:32 UTC (rev 463)
@@ -46,8 +46,6 @@
id++;
}
- int id_max = 0;
-
traverser.add_white_event_found_listener(&inst_listener);
for(it = instances.begin(); it != instances.end();it++)
{
Modified: trunk/tests/checker_test.cpp
===================================================================
--- trunk/tests/checker_test.cpp 2009-11-16 17:25:30 UTC (rev 462)
+++ trunk/tests/checker_test.cpp 2009-11-16 21:28:32 UTC (rev 463)
@@ -95,9 +95,17 @@
return 1;
}
- FInitCheckers init_checkers = (FInitCheckers)LIBRARY_SYMBOL(module, "init_checkers");
- if(init_checkers == NULL)
+ // note: this is a nasty hack to avoid the gcc warning:
+ // ISO C++ forbids casting between pointer-to-function and pointer-to-object
+ union
{
+ void *pointer;
+ FInitCheckers function;
+ } init_checkers;
+
+ init_checkers.pointer = LIBRARY_SYMBOL(module, "init_checkers");
+ if(init_checkers.pointer == NULL)
+ {
std::cerr << "ERROR: Initializer not found in " << argv[1] << std::endl;
LIBRARY_CLOSE(module);
return 1;
@@ -138,7 +146,7 @@
try
{
- MscPtr result = run_check(init_checkers, argv[2], msc[0]);
+ MscPtr result = run_check(init_checkers.function, argv[2], msc[0]);
if(result == NULL)
{
if(satisfied)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|