From 20ca00113b884feda4a34147ed4ad03f2c15f150 Mon Sep 17 00:00:00 2001 From: Patrik Stridvall Date: Tue, 19 Jun 2001 03:34:52 +0000 Subject: [PATCH] - Slightly better handling of external/internal names. - Minor bug fixes. - Minor API files update. --- tools/winapi_check/modules.dat | 2 - tools/winapi_check/nativeapi.dat | 3 + tools/winapi_check/preprocessor.pm | 2 +- tools/winapi_check/win32/avifil32.api | 5 + tools/winapi_check/win32/crtdll.api | 1 - tools/winapi_check/win32/msvcrt.api | 14 +- tools/winapi_check/win32/ole32.api | 3 - tools/winapi_check/win32/shell32.api | 1 - tools/winapi_check/win32/w32skrnl.api | 4 - tools/winapi_check/win32/wow32.api | 14 -- tools/winapi_check/win32/wsock32.api | 22 --- tools/winapi_check/winapi.pm | 149 ++++++++++++++------- tools/winapi_check/winapi_check | 38 +++--- tools/winapi_check/winapi_documentation.pm | 16 +-- tools/winapi_check/winapi_global.pm | 10 +- tools/winapi_check/winapi_local.pm | 12 +- tools/winapi_check/winapi_options.pm | 5 + tools/winapi_check/winapi_parser.pm | 2 +- 18 files changed, 160 insertions(+), 143 deletions(-) diff --git a/tools/winapi_check/modules.dat b/tools/winapi_check/modules.dat index 36a776f8e31..f2391aa3d17 100644 --- a/tools/winapi_check/modules.dat +++ b/tools/winapi_check/modules.dat @@ -344,7 +344,6 @@ controls dlls/kernel dlls/user memory -misc windows % dlls/user/user32.spec @@ -352,7 +351,6 @@ windows controls dlls/user loader -misc windows % dlls/version/ver.spec diff --git a/tools/winapi_check/nativeapi.dat b/tools/winapi_check/nativeapi.dat index 07a840ec3bc..bc25152b9d1 100644 --- a/tools/winapi_check/nativeapi.dat +++ b/tools/winapi_check/nativeapi.dat @@ -13,6 +13,8 @@ _lwp_exit _lwp_makecontext _lxstat _sysconf +_tolower +_toupper _xmknod _xstat abs @@ -242,6 +244,7 @@ tolower toupper towlower towupper +tzset unlink usleep utime diff --git a/tools/winapi_check/preprocessor.pm b/tools/winapi_check/preprocessor.pm index dd9fbd43b7b..771c26cba2a 100644 --- a/tools/winapi_check/preprocessor.pm +++ b/tools/winapi_check/preprocessor.pm @@ -78,7 +78,7 @@ sub begin_if { } } elsif(/^(\w+)\s*(<|<=|==|!=|>=|>)\s*(\w+)\s*((\&\&|\|\|)\s*)?/) { $_ = $'; - } elsif(/^(\w+)\s*$/) { + } elsif(/^(!)?(\w+)\s*$/) { $_ = $'; } elsif(/^\(|\)/) { $_ = $'; diff --git a/tools/winapi_check/win32/avifil32.api b/tools/winapi_check/win32/avifil32.api index cb42e6ccabd..31fb7294901 100644 --- a/tools/winapi_check/win32/avifil32.api +++ b/tools/winapi_check/win32/avifil32.api @@ -17,6 +17,7 @@ CLSID * LONG * LPBITMAPINFOHEADER LPCLSID +LPLONG LPVOID PAVIFILE PAVIFILE * @@ -31,3 +32,7 @@ LPCSTR %void void + +%wstr + +LPCWSTR \ No newline at end of file diff --git a/tools/winapi_check/win32/crtdll.api b/tools/winapi_check/win32/crtdll.api index 0ad646f05dd..d53e20eaaef 100644 --- a/tools/winapi_check/win32/crtdll.api +++ b/tools/winapi_check/win32/crtdll.api @@ -1,7 +1,6 @@ %long int -size_t %ptr diff --git a/tools/winapi_check/win32/msvcrt.api b/tools/winapi_check/win32/msvcrt.api index 5ee9bfa1015..173aba2587a 100644 --- a/tools/winapi_check/win32/msvcrt.api +++ b/tools/winapi_check/win32/msvcrt.api @@ -5,17 +5,16 @@ double %long DWORD -HANDLE INT LONG MSVCRT_clock_t MSVCRT_complex MSVCRT_size_t MSVCRT_time_t -ULONG WCHAR int long +size_t unsigned int unsigned long @@ -73,10 +72,10 @@ unsigned int * va_list void * -%str +%ptr --extension -LPSTR -LPCSTR +_beginthread_start_routine_t +_beginthreadex_start_routine_t %unknown @@ -87,8 +86,3 @@ MSVCRT_ldiv_t void VOID - -%wstr - -LPCWSTR -LPWSTR diff --git a/tools/winapi_check/win32/ole32.api b/tools/winapi_check/win32/ole32.api index 27bb743e772..cae3612523b 100644 --- a/tools/winapi_check/win32/ole32.api +++ b/tools/winapi_check/win32/ole32.api @@ -14,7 +14,6 @@ HWND INT UINT ULONG -WORD %long # --forbidden @@ -52,7 +51,6 @@ LPDROPTARGET LPDWORD LPENUMFORMATETC * LPENUMOLEVERB * -LPFILETIME LPFORMATETC LPGUID LPLOCKBYTES * @@ -77,7 +75,6 @@ LPUNKNOWN LPUNKNOWN * LPVOID LPVOID * -LPWORD LPSTORAGE LPSTREAM * MULTI_QI * diff --git a/tools/winapi_check/win32/shell32.api b/tools/winapi_check/win32/shell32.api index a04a93fdd60..483c0e507b2 100644 --- a/tools/winapi_check/win32/shell32.api +++ b/tools/winapi_check/win32/shell32.api @@ -19,7 +19,6 @@ LONG LRESULT UINT ULONG -WCHAR WORD WPARAM diff --git a/tools/winapi_check/win32/w32skrnl.api b/tools/winapi_check/win32/w32skrnl.api index 2c65edda2d0..67696a25c03 100644 --- a/tools/winapi_check/win32/w32skrnl.api +++ b/tools/winapi_check/win32/w32skrnl.api @@ -1,7 +1,3 @@ -%long - -DWORD - %long # --forbidden HTASK16 diff --git a/tools/winapi_check/win32/wow32.api b/tools/winapi_check/win32/wow32.api index f0f9bbe69c3..e69de29bb2d 100644 --- a/tools/winapi_check/win32/wow32.api +++ b/tools/winapi_check/win32/wow32.api @@ -1,14 +0,0 @@ -%long - -BOOL -DWORD -HANDLE -WORD -WOW_HANDLE_TYPE - -%ptr - -LPDWORD -LPVOID -PDWORD -WORD * diff --git a/tools/winapi_check/win32/wsock32.api b/tools/winapi_check/win32/wsock32.api index d5b9abc9c7d..bb43794c559 100644 --- a/tools/winapi_check/win32/wsock32.api +++ b/tools/winapi_check/win32/wsock32.api @@ -1,48 +1,26 @@ %long -BOOL DWORD -HANDLE -HWND INT -LONG -UINT SOCKET -u_long -u_short %long # --forbidden -SOCKET16 long %ptr -FARPROC INT * LPDWORD LPINT LPVOID -LPWSADATA -ULONG * -WIN_hostent * -WIN_protoent * -WIN_servent * char * struct netent * -struct sockaddr * -struct timeval * -ws_fd_set32 * %str LPCSTR -LPSTR %void void - -%unknown - -struct in_addr \ No newline at end of file diff --git a/tools/winapi_check/winapi.pm b/tools/winapi_check/winapi.pm index 7dd7cfca676..c7302e920ed 100644 --- a/tools/winapi_check/winapi.pm +++ b/tools/winapi_check/winapi.pm @@ -228,14 +228,18 @@ sub parse_spec_file { my $options = \${$self->{OPTIONS}}; my $output = \${$self->{OUTPUT}}; - my $function_arguments = \%{$self->{FUNCTION_ARGUMENTS}}; - my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}}; - my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}}; + my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}}; + my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}}; + my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}}; + my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}}; + my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}}; + my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}}; my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}}; my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}}; my $function_stub = \%{$self->{FUNCTION_STUB}}; my $function_forward = \%{$self->{FUNCTION_FORWARD}}; - my $function_module = \%{$self->{FUNCTION_MODULE}}; + my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}}; + my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}}; my $modules = \%{$self->{MODULES}}; my $module_files = \%{$self->{MODULE_FILES}}; @@ -283,18 +287,29 @@ sub parse_spec_file { # FIXME: Internal name existing more than once not handled properly $$function_internal_name{$external_name} = $internal_name; $$function_external_name{$internal_name} = $external_name; - $$function_arguments{$internal_name} = $arguments; - $$function_ordinal{$internal_name} = $ordinal; - $$function_calling_convention{$internal_name} = $calling_convention; - if(!$$function_module{$internal_name}) { - $$function_module{$internal_name} = "$module"; - } elsif($$function_module{$internal_name} !~ /$module/) { + $$function_internal_arguments{$internal_name} = $arguments; + $$function_external_arguments{$external_name} = $arguments; + $$function_internal_ordinal{$internal_name} = $ordinal; + $$function_external_ordinal{$external_name} = $ordinal; + $$function_internal_calling_convention{$internal_name} = $calling_convention; + $$function_external_calling_convention{$external_name} = $calling_convention; + if(!$$function_internal_module{$internal_name}) { + $$function_internal_module{$internal_name} = "$module"; + } elsif($$function_internal_module{$internal_name} !~ /$module/) { if(0) { $$output->write("$file: $external_name: the internal function ($internal_name) " . - "already belongs to a module ($$function_module{$internal_name})\n"); + "already belongs to a module ($$function_internal_module{$internal_name})\n"); } - $$function_module{$internal_name} .= " & $module"; - + $$function_internal_module{$internal_name} .= " & $module"; + } + if(!$$function_external_module{$external_name}) { + $$function_external_module{$external_name} = "$module"; + } elsif($$function_external_module{$external_name} !~ /$module/) { + if(0) { + $$output->write("$file: $internal_name: the external function ($external_name) " . + "already belongs to a module ($$function_external_module{$external_name})\n"); + } + $$function_external_module{$external_name} .= " & $module"; } if(0 && $$options->spec_mismatch) { @@ -346,10 +361,17 @@ sub parse_spec_file { # FIXME: Internal name existing more than once not handled properly $$function_stub{$internal_name} = 1; - if(!$$function_module{$internal_name}) { - $$function_module{$internal_name} = "$module"; - } elsif($$function_module{$internal_name} !~ /$module/) { - $$function_module{$internal_name} .= " & $module"; + $$function_internal_ordinal{$internal_name} = $ordinal; + $$function_external_ordinal{$external_name} = $ordinal; + if(!$$function_internal_module{$internal_name}) { + $$function_internal_module{$internal_name} = "$module"; + } elsif($$function_internal_module{$internal_name} !~ /$module/) { + $$function_internal_module{$internal_name} .= " & $module"; + } + if(!$$function_external_module{$external_name}) { + $$function_external_module{$external_name} = "$module"; + } elsif($$function_external_module{$external_name} !~ /$module/) { + $$function_external_module{$external_name} .= " & $module"; } } elsif(/^(\d+|@)\s+forward(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)\s+(\S+)\.(\S+)$/) { $ordinal = $1; @@ -381,11 +403,8 @@ sub parse_spec_file { close(IN); $$modules{$module}++; - if(defined($module_file)) { - $$module_files{$module} = $module_file; - } else { - $$module_files{$module} = "$module.drv"; - } + + $$module_files{$module} = $file; } sub name { @@ -584,23 +603,23 @@ sub module_file { return $$module_files{$module}; } -sub all_functions { +sub all_internal_functions { my $self = shift; - my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}}; + my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}}; - return sort(keys(%$function_calling_convention)); + return sort(keys(%$function_internal_calling_convention)); } -sub all_functions_in_module { +sub all_internal_functions_in_module { my $self = shift; - my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}}; - my $function_module = \%{$self->{FUNCTION_MODULE}}; + my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}}; + my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}}; my $module = shift; my @names; - foreach my $name (keys(%$function_calling_convention)) { - if($$function_module{$name} eq $module) { + foreach my $name (keys(%$function_internal_calling_convention)) { + if($$function_internal_module{$name} eq $module) { push @names, $name; } } @@ -615,29 +634,47 @@ sub all_functions_stub { return sort(keys(%$function_stub)); } -sub all_functions_found { +sub all_internal_functions_found { my $self = shift; my $function_found = \%{$self->{FUNCTION_FOUND}}; return sort(keys(%$function_found)); } -sub function_ordinal { +sub function_internal_ordinal { my $self = shift; - my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}}; + my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}}; my $name = shift; - return $$function_ordinal{$name}; + return $$function_internal_ordinal{$name}; } -sub function_calling_convention { +sub function_external_ordinal { my $self = shift; - my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}}; + my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}}; my $name = shift; - return $$function_calling_convention{$name}; + return $$function_external_ordinal{$name}; +} + +sub function_internal_calling_convention { + my $self = shift; + my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}}; + + my $name = shift; + + return $$function_internal_calling_convention{$name}; +} + +sub function_external_calling_convention { + my $self = shift; + my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}}; + + my $name = shift; + + return $$function_external_calling_convention{$name}; } sub function_external_name { @@ -651,11 +688,11 @@ sub function_external_name { sub is_function { my $self = shift; - my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}}; + my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}}; my $name = shift; - return $$function_calling_convention{$name}; + return $$function_internal_calling_convention{$name}; } sub is_shared_function { @@ -676,22 +713,40 @@ sub found_shared_function { $$function_shared{$name} = 1; } -sub function_arguments { +sub function_internal_arguments { my $self = shift; - my $function_arguments = \%{$self->{FUNCTION_ARGUMENTS}}; + my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}}; my $name = shift; - return $$function_arguments{$name}; + return $$function_internal_arguments{$name}; } -sub function_module { +sub function_external_arguments { my $self = shift; - my $function_module = \%{$self->{FUNCTION_MODULE}}; + my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}}; my $name = shift; - return $$function_module{$name}; + return $$function_external_arguments{$name}; +} + +sub function_internal_module { + my $self = shift; + my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}}; + + my $name = shift; + + return $$function_internal_module{$name}; +} + +sub function_external_module { + my $self = shift; + my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}}; + + my $name = shift; + + return $$function_external_module{$name}; } sub function_stub { @@ -703,7 +758,7 @@ sub function_stub { return $$function_stub{$name}; } -sub found_function { +sub found_internal_function { my $self = shift; my $function_found = \%{$self->{FUNCTION_FOUND}}; @@ -712,7 +767,7 @@ sub found_function { $$function_found{$name}++; } -sub function_found { +sub internal_function_found { my $self = shift; my $function_found = \%{$self->{FUNCTION_FOUND}}; diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check index f0ba1891085..e7bebc4c8fb 100755 --- a/tools/winapi_check/winapi_check +++ b/tools/winapi_check/winapi_check @@ -154,16 +154,16 @@ if($options->global) { my $nativeapi = 'nativeapi'->new($options, $output, "$winapi_check_dir/nativeapi.dat", "$wine_dir/configure.in", "$wine_dir/include/config.h.in"); -for my $name ($win32api->all_functions) { - my $module16 = $win16api->function_module($name); - my $module32 = $win32api->function_module($name); +for my $internal_name ($win32api->all_internal_functions) { + my $module16 = $win16api->function_internal_module($internal_name); + my $module32 = $win32api->function_internal_module($internal_name); if(defined($module16)) { - $win16api->found_shared_function($name); - $win32api->found_shared_function($name); - + $win16api->found_shared_function($internal_name); + $win32api->found_shared_function($internal_name); + if($options->shared) { - $output->write("*.spec: $name: is shared between $module16 (Win16) and $module32 (Win32)\n"); + $output->write("*.spec: $internal_name: is shared between $module16 (Win16) and $module32 (Win32)\n"); } } } @@ -246,7 +246,7 @@ if($options->headers) { my $statements = shift; foreach my $winapi (@winapis) { - my $module = $winapi->function_module($internal_name); + my $module = $winapi->function_internal_module($internal_name); if(!defined($module)) { next } my $external_name = $winapi->function_external_name($internal_name); @@ -340,14 +340,14 @@ foreach my $file (@c_files) { $win16api->found_type($argument) if $options->win16; $win32api->found_type($argument) if $options->win32; } - - $win16api->found_function($internal_name) if $options->win16; - $win32api->found_function($internal_name) if $options->win32; + + $win16api->found_internal_function($internal_name) if $options->win16; + $win32api->found_internal_function($internal_name) if $options->win32; } if($file_type ne "application") { - my $module16 = $win16api->function_module($internal_name); - my $module32 = $win32api->function_module($internal_name); + my $module16 = $win16api->function_internal_module($internal_name); + my $module32 = $win32api->function_internal_module($internal_name); if(defined($module16)) { $modules->found_module_in_dir($module16, $file_dir); @@ -636,9 +636,9 @@ if($options->global) { my %module_stub_count16; my %module_total_count16; - foreach my $name ($win16api->all_functions,$win16api->all_functions_stub) { - foreach my $module (split(/ \& /, $win16api->function_module($name))) { - if($win16api->function_stub($name)) { + foreach my $internal_name ($win16api->all_internal_functions,$win16api->all_functions_stub) { + foreach my $module (split(/ \& /, $win16api->function_internal_module($internal_name))) { + if($win16api->function_stub($internal_name)) { $module_stub_count16{$module}++; } $module_total_count16{$module}++; @@ -668,9 +668,9 @@ if($options->global) { my %module_stub_count32; my %module_total_count32; - foreach my $name ($win32api->all_functions,$win32api->all_functions_stub) { - foreach my $module (split(/ \& /, $win32api->function_module($name))) { - if($win32api->function_stub($name)) { + foreach my $internal_name ($win32api->all_internal_functions,$win32api->all_functions_stub) { + foreach my $module (split(/ \& /, $win32api->function_internal_module($internal_name))) { + if($win32api->function_stub($internal_name)) { $module_stub_count32{$module}++; } $module_total_count32{$module}++; diff --git a/tools/winapi_check/winapi_documentation.pm b/tools/winapi_check/winapi_documentation.pm index f162d070f8c..26f7222076a 100644 --- a/tools/winapi_check/winapi_documentation.pm +++ b/tools/winapi_check/winapi_documentation.pm @@ -75,7 +75,7 @@ sub check_documentation { $external_name = $internal_name; } - if($options->documentation_pedantic) { + if($options->documentation_name) { my $n = 0; if((++$n && defined($module16) && defined($external_name16) && $external_name16 ne "@" && $documentation !~ /\b\Q$external_name16\E\b/) || @@ -87,17 +87,15 @@ sub check_documentation { $external_name32 eq "@" && $documentation !~ /\@/)) { my $external_name = ($external_name16, $external_name32)[($n-1)/2]; - $output->write("documentation: wrong or missing name ($external_name) \\\n$documentation\n"); - } - } else { - if($documentation !~ /\b(?:\Q$external_name\E|$internal_name|$name1|$name2)\b/) { - $output->write("documentation: wrong or missing name \\\n$documentation\n"); + if($options->documentation_pedantic || $documentation !~ /\b(?:$internal_name|$name1|$name2)\b/) { + $output->write("documentation: wrong or missing name ($external_name) \\\n$documentation\n"); + } } } if($options->documentation_ordinal) { if(defined($module16)) { - my $ordinal16 = $win16api->function_ordinal($internal_name); + my $ordinal16 = $win16api->function_internal_ordinal($internal_name); if(!defined($ordinal16)) { $output->write("function have no ordinal\n"); @@ -112,7 +110,7 @@ sub check_documentation { } } if(defined($module32)) { - my $ordinal32 = $win32api->function_ordinal($internal_name); + my $ordinal32 = $win32api->function_internal_ordinal($internal_name); if(!defined($ordinal32)) { $output->write("function have no ordinal\n"); @@ -129,7 +127,7 @@ sub check_documentation { } if($options->documentation_pedantic) { - my $ordinal = $win16api->function_ordinal($internal_name); + my $ordinal = $win16api->function_internal_ordinal($internal_name); if(defined($ordinal) && $documentation !~ /^ \*\s+(?:\@|\w+)(?:\s+[\(\[]\w+\.(?:\@|\d+)[\)\]])+/m) { $output->write("documentation: pedantic check failed \\\n$documentation\n"); } diff --git a/tools/winapi_check/winapi_global.pm b/tools/winapi_check/winapi_global.pm index 80d15bf2e29..99621b71679 100644 --- a/tools/winapi_check/winapi_global.pm +++ b/tools/winapi_check/winapi_global.pm @@ -20,11 +20,11 @@ sub check { } if($options->declared) { - foreach my $name ($winapi->all_functions) { - if(!$winapi->function_found($name) && !$nativeapi->is_function($name)) { - my $module = $winapi->function_module($name); - $output->write("*.c: $module: $name: "); - $output->write("function declared but not implemented: " . $winapi->function_arguments($name) . "\n"); + foreach my $internal_name ($winapi->all_internal_functions) { + if(!$winapi->internal_function_found($internal_name) && !$nativeapi->is_function($internal_name)) { + my $module = $winapi->function_internal_module($internal_name); + $output->write("*.c: $module: $internal_name: "); + $output->write("function declared but not implemented: " . $winapi->function_internal_arguments($internal_name) . "\n"); } } } diff --git a/tools/winapi_check/winapi_local.pm b/tools/winapi_check/winapi_local.pm index 6404a6c205c..86f704263ce 100644 --- a/tools/winapi_check/winapi_local.pm +++ b/tools/winapi_check/winapi_local.pm @@ -14,7 +14,7 @@ sub check_function { my $nativeapi = shift; my $winapi = shift; - my $module = $winapi->function_module($internal_name); + my $module = $winapi->function_internal_module($internal_name); if($winapi->name eq "win16") { if($winapi->function_stub($internal_name)) { @@ -89,8 +89,8 @@ sub check_function { } } - my $declared_calling_convention = $winapi->function_calling_convention($internal_name); - my @declared_argument_kinds = split(/\s+/, $winapi->function_arguments($internal_name)); + my $declared_calling_convention = $winapi->function_internal_calling_convention($internal_name); + my @declared_argument_kinds = split(/\s+/, $winapi->function_internal_arguments($internal_name)); if($declared_calling_convention =~ /^register|interrupt$/) { push @declared_argument_kinds, "ptr"; @@ -122,7 +122,11 @@ sub check_function { $output->write("function not implemented as vararg\n"); } } elsif($#argument_types != -1 && $argument_types[$#argument_types] eq "...") { - $output->write("function not declared as vararg\n"); + if($#argument_types == 0) { + pop @argument_types; + } else { + $output->write("function not declared as vararg\n"); + } } if($#argument_types != -1 && $argument_types[$#argument_types] eq "CONTEXT *" && diff --git a/tools/winapi_check/winapi_options.pm b/tools/winapi_check/winapi_options.pm index c0fb0cd074d..25030f26811 100644 --- a/tools/winapi_check/winapi_options.pm +++ b/tools/winapi_check/winapi_options.pm @@ -96,6 +96,11 @@ my %options = ( default => 0, parent => "documentation", description => "check for documentation comment width inconsistances" }, + "documentation-name" => { + default => 1, + parent => "documentation", + description => "check for documentation name inconsistances\n" + }, "documentation-ordinal" => { default => 0, parent => "documentation", diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm index 7166d9febe7..e848ad35f3c 100644 --- a/tools/winapi_check/winapi_parser.pm +++ b/tools/winapi_check/winapi_parser.pm @@ -257,7 +257,7 @@ sub parse_c_file { $arguments =~ y/\t\n/ /; $arguments =~ s/^\s*(.*?)\s*$/$1/; - if($arguments eq "") { $arguments = "void" } + if($arguments eq "") { $arguments = "..." } my @argument_types; my @argument_names;