winapi_check: Fix 'long int' parsing

Francois Gouget fgouget at free.fr
Wed May 10 11:53:41 CDT 2006


Changelog:

  * tools/winapi/winapi_parser.pm

    Francois Gouget <fgouget at free.fr>
    Fix parsing of 'long int'.
    Simplify handling of spaces in a couple of regular expressions.

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
       Broadcast message : fin du monde dans cinq minutes, repentez vous !
-------------- next part --------------
Index: tools/winapi/winapi_parser.pm
===================================================================
RCS file: /home/wine/wine/tools/winapi/winapi_parser.pm,v
retrieving revision 1.10
diff -u -p -r1.10 winapi_parser.pm
--- tools/winapi/winapi_parser.pm	2 Dec 2005 13:15:21 -0000	1.10
+++ tools/winapi/winapi_parser.pm	10 May 2006 04:45:38 -0000
@@ -426,13 +426,13 @@ sub parse_c_file($$) {
 
 		$argument =~ s/^\s*(.*?)\s*$/$1/;
 		# print "  " . ($n + 1) . ": '$argument'\n";
-		$argument =~ s/^(IN OUT(?=\s)|IN(?=\s)|OUT(?=\s)|\s*)\s*//;
-		$argument =~ s/^(const(?=\s)|CONST(?=\s)|volatile(?=\s)|\s*)\s*//;
+		$argument =~ s/^(?:IN OUT|IN|OUT)?\s+//;
+		$argument =~ s/^(?:const|CONST|volatile)?\s+//;
 		if($argument =~ /^\.\.\.$/) {
 		    $argument_type = "...";
 		    $argument_name = "...";
 		} elsif($argument =~ /^
-			((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
+			((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)?
 			  (?:short\s+(?=int)|long\s+(?=int))?)?(?:\w+|ElfW\(\w+\)|WS\(\w+\)))\s*
 			((?:__RPC_FAR|const|CONST|volatile)?\s*(?:\*\s*(?:__RPC_FAR|const|CONST|volatile)?\s*?)*)\s*
 			(\w*)\s*(\[\])?(?:\s+OPTIONAL)?$/x)
@@ -446,7 +446,7 @@ sub parse_c_file($$) {
 		    }
 		    $argument_name = $3;
 		} elsif ($argument =~ /^
-			((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
+			((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)?
 			  (?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s*
 			((?:const|volatile)?\s*(?:\*\s*(?:const|volatile)?\s*?)*)\s*
 			(?:__cdecl\s+|__stdcall\s+|__RPC_STUB\s+|__RPC_USER\s+|CALLBACK\s+|CDECL\s+|NET_API_FUNCTION\s+|RPC_ENTRY\s+|STDMETHODCALLTYPE\s+|VFWAPIV\s+|VFWAPI\s+|WINAPIV\s+|WINAPI\s+)?


More information about the wine-patches mailing list