[Tinyos8051wg-commit] SF.net SVN: tinyos8051wg:[1086] trunk/diku/mcs51/support/make/mcs51/ mangleAp
Status: Alpha
Brought to you by:
mleopold
From: <qz...@us...> - 2009-09-23 15:41:27
|
Revision: 1086 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1086&view=rev Author: qzban Date: 2009-09-23 15:40:52 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Mangle script update. Even more reentrant issues... Modified Paths: -------------- trunk/diku/mcs51/support/make/mcs51/mangleAppC.pl Modified: trunk/diku/mcs51/support/make/mcs51/mangleAppC.pl =================================================================== --- trunk/diku/mcs51/support/make/mcs51/mangleAppC.pl 2009-09-08 09:22:59 UTC (rev 1085) +++ trunk/diku/mcs51/support/make/mcs51/mangleAppC.pl 2009-09-23 15:40:52 UTC (rev 1086) @@ -71,6 +71,7 @@ my %typedef_struct_empty_ident = (); my $line_no = 0; my $schedulerBasicReentrant = 0; +my $reentrantWait = 0; # Parenthesis levels. my $bracketLevel = 0; @@ -319,12 +320,22 @@ foreach my $reentrantFunc (@reentrantFunctions) { my $funcName = quotemeta($reentrantFunc); if (m{\s+$funcName\s*\(}g) { - s{([^\;]*)}{$1 reentrant}; - printf STDERR "Fixed reentrant function prototype: '%s'\n",$funcName; + if (m{\(} != m{\)}) { + # Paranthesis levels do not match. Wait for ")". + $reentrantWait = 1; + } else { + s{([^\;]*)}{$1 reentrant}; + printf STDERR "Fixed reentrant function prototype: '%s'\n",$funcName; + } } # $i++; } } + + if ($reentrantWait && m{\);}) { + s{\)}{) reentrant}; + $reentrantWait = 0; + } # Make the TinyOS task poster function reentrant as well. # NOTE: This will not work if the BasicScheduler is replaced. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |