Commit 493d60fe authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Add function prototypes.

Modify function calls so the prototypes are checked.
parent f9d6fa9e
...@@ -30,18 +30,18 @@ require Exporter; ...@@ -30,18 +30,18 @@ require Exporter;
use vars qw($modules); use vars qw($modules);
use config qw( use config qw(
&file_type &files_skip file_type files_skip
&file_directory file_directory
&get_c_files &get_spec_files get_c_files get_spec_files
$current_dir $wine_dir $current_dir $wine_dir
$winapi_check_dir $winapi_check_dir
); );
use options qw($options); use options qw($options);
use output qw($output); use output qw($output);
sub import { sub import(@) {
$Exporter::ExportLevel++; $Exporter::ExportLevel++;
&Exporter::import(@_); Exporter::import(@_);
$Exporter::ExportLevel--; $Exporter::ExportLevel--;
if (defined($modules)) { if (defined($modules)) {
...@@ -51,7 +51,7 @@ sub import { ...@@ -51,7 +51,7 @@ sub import {
$modules = 'modules'->new; $modules = 'modules'->new;
} }
sub get_spec_file_type { sub get_spec_file_type($) {
my $file = shift; my $file = shift;
my $module; my $module;
...@@ -89,19 +89,7 @@ sub get_spec_file_type { ...@@ -89,19 +89,7 @@ sub get_spec_file_type {
return ($type, $module); return ($type, $module);
} }
sub new { sub find_spec_files($) {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
bless ($self, $class);
my $spec_file_found = $self->find_spec_files();
$self->read_spec_files($spec_file_found);
return $self;
}
sub find_spec_files {
my $self = shift; my $self = shift;
my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}}; my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}};
...@@ -128,7 +116,7 @@ sub find_spec_files { ...@@ -128,7 +116,7 @@ sub find_spec_files {
return $spec_file_found; return $spec_file_found;
} }
sub read_spec_files { sub read_spec_files($$) {
my $self = shift; my $self = shift;
my $spec_file_found = shift; my $spec_file_found = shift;
...@@ -178,7 +166,19 @@ sub read_spec_files { ...@@ -178,7 +166,19 @@ sub read_spec_files {
} }
} }
sub all_modules { sub new($) {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
bless ($self, $class);
my $spec_file_found = $self->find_spec_files();
$self->read_spec_files($spec_file_found);
return $self;
}
sub all_modules($) {
my $self = shift; my $self = shift;
my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}}; my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}};
...@@ -186,7 +186,7 @@ sub all_modules { ...@@ -186,7 +186,7 @@ sub all_modules {
return sort(keys(%$module2spec_file)); return sort(keys(%$module2spec_file));
} }
sub complete_modules { sub complete_modules($$) {
my $self = shift; my $self = shift;
my $c_files = shift; my $c_files = shift;
...@@ -224,7 +224,7 @@ sub complete_modules { ...@@ -224,7 +224,7 @@ sub complete_modules {
return @complete_modules; return @complete_modules;
} }
sub is_allowed_module { sub is_allowed_module($$) {
my $self = shift; my $self = shift;
my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}}; my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}};
...@@ -234,7 +234,7 @@ sub is_allowed_module { ...@@ -234,7 +234,7 @@ sub is_allowed_module {
return defined($$module2spec_file{$module}); return defined($$module2spec_file{$module});
} }
sub is_allowed_module_in_file { sub is_allowed_module_in_file($$$) {
my $self = shift; my $self = shift;
my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}}; my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}};
...@@ -260,7 +260,7 @@ sub is_allowed_module_in_file { ...@@ -260,7 +260,7 @@ sub is_allowed_module_in_file {
return 0; return 0;
} }
sub allowed_modules_in_file { sub allowed_modules_in_file($$) {
my $self = shift; my $self = shift;
my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}}; my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}};
...@@ -283,7 +283,7 @@ sub allowed_modules_in_file { ...@@ -283,7 +283,7 @@ sub allowed_modules_in_file {
return $module; return $module;
} }
sub allowed_dirs_for_module { sub allowed_dirs_for_module($$) {
my $self = shift; my $self = shift;
my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}}; my $module2spec_file = \%{$self->{MODULE2SPEC_FILE}};
...@@ -296,7 +296,7 @@ sub allowed_dirs_for_module { ...@@ -296,7 +296,7 @@ sub allowed_dirs_for_module {
return sort(keys(%{$$spec_file2dir{$spec_file}})); return sort(keys(%{$$spec_file2dir{$spec_file}}));
} }
sub allowed_spec_files16 { sub allowed_spec_files16($) {
my $self = shift; my $self = shift;
my $spec_files16 = \@{$self->{SPEC_FILES16}}; my $spec_files16 = \@{$self->{SPEC_FILES16}};
...@@ -304,7 +304,7 @@ sub allowed_spec_files16 { ...@@ -304,7 +304,7 @@ sub allowed_spec_files16 {
return @$spec_files16; return @$spec_files16;
} }
sub allowed_spec_files32 { sub allowed_spec_files32($) {
my $self = shift; my $self = shift;
my $spec_files32 = \@{$self->{SPEC_FILES32}}; my $spec_files32 = \@{$self->{SPEC_FILES32}};
...@@ -312,7 +312,7 @@ sub allowed_spec_files32 { ...@@ -312,7 +312,7 @@ sub allowed_spec_files32 {
return @$spec_files32; return @$spec_files32;
} }
sub found_module_in_dir { sub found_module_in_dir($$$) {
my $self = shift; my $self = shift;
my $module = shift; my $module = shift;
...@@ -326,7 +326,7 @@ sub found_module_in_dir { ...@@ -326,7 +326,7 @@ sub found_module_in_dir {
$$used_module_dirs{$module}{$dir}++; $$used_module_dirs{$module}{$dir}++;
} }
sub global_report { sub global_report($) {
my $self = shift; my $self = shift;
my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}}; my $dir2spec_file = \%{$self->{DIR2SPEC_FILE}};
......
...@@ -29,13 +29,13 @@ require Exporter; ...@@ -29,13 +29,13 @@ require Exporter;
use vars qw($nativeapi); use vars qw($nativeapi);
use config qw(&file_type $current_dir $wine_dir $winapi_check_dir); use config qw(file_type $current_dir $wine_dir $winapi_check_dir);
use options qw($options); use options qw($options);
use output qw($output); use output qw($output);
$nativeapi = 'nativeapi'->new; $nativeapi = 'nativeapi'->new;
sub new { sub new($) {
my $proto = shift; my $proto = shift;
my $class = ref($proto) || $proto; my $class = ref($proto) || $proto;
my $self = {}; my $self = {};
...@@ -153,7 +153,7 @@ sub new { ...@@ -153,7 +153,7 @@ sub new {
return $self; return $self;
} }
sub is_function { sub is_function($$) {
my $self = shift; my $self = shift;
my $functions = \%{$self->{FUNCTIONS}}; my $functions = \%{$self->{FUNCTIONS}};
...@@ -162,7 +162,7 @@ sub is_function { ...@@ -162,7 +162,7 @@ sub is_function {
return ($$functions{$name} || 0); return ($$functions{$name} || 0);
} }
sub is_conditional { sub is_conditional($$) {
my $self = shift; my $self = shift;
my $conditionals = \%{$self->{CONDITIONALS}}; my $conditionals = \%{$self->{CONDITIONALS}};
...@@ -171,7 +171,7 @@ sub is_conditional { ...@@ -171,7 +171,7 @@ sub is_conditional {
return ($$conditionals{$name} || 0); return ($$conditionals{$name} || 0);
} }
sub found_conditional { sub found_conditional($$) {
my $self = shift; my $self = shift;
my $conditional_found = \%{$self->{CONDITIONAL_FOUND}}; my $conditional_found = \%{$self->{CONDITIONAL_FOUND}};
...@@ -180,7 +180,7 @@ sub found_conditional { ...@@ -180,7 +180,7 @@ sub found_conditional {
$$conditional_found{$name}++; $$conditional_found{$name}++;
} }
sub is_conditional_header { sub is_conditional_header($$) {
my $self = shift; my $self = shift;
my $conditional_headers = \%{$self->{CONDITIONAL_HEADERS}}; my $conditional_headers = \%{$self->{CONDITIONAL_HEADERS}};
...@@ -189,7 +189,7 @@ sub is_conditional_header { ...@@ -189,7 +189,7 @@ sub is_conditional_header {
return ($$conditional_headers{$name} || 0); return ($$conditional_headers{$name} || 0);
} }
sub is_conditional_function { sub is_conditional_function($$) {
my $self = shift; my $self = shift;
my $conditional_functions = \%{$self->{CONDITIONAL_FUNCTIONS}}; my $conditional_functions = \%{$self->{CONDITIONAL_FUNCTIONS}};
...@@ -198,7 +198,7 @@ sub is_conditional_function { ...@@ -198,7 +198,7 @@ sub is_conditional_function {
return ($$conditional_functions{$name} || 0); return ($$conditional_functions{$name} || 0);
} }
sub global_report { sub global_report($) {
my $self = shift; my $self = shift;
my $output = \${$self->{OUTPUT}}; my $output = \${$self->{OUTPUT}};
......
...@@ -20,7 +20,7 @@ package preprocessor; ...@@ -20,7 +20,7 @@ package preprocessor;
use strict; use strict;
sub new { sub new($) {
my $proto = shift; my $proto = shift;
my $class = ref($proto) || $proto; my $class = ref($proto) || $proto;
my $self = {}; my $self = {};
...@@ -37,7 +37,7 @@ sub new { ...@@ -37,7 +37,7 @@ sub new {
return $self; return $self;
} }
sub include { sub include($$) {
my $self = shift; my $self = shift;
my $include_found = \${$self->{INCLUDE_FOUND}}; my $include_found = \${$self->{INCLUDE_FOUND}};
...@@ -46,7 +46,7 @@ sub include { ...@@ -46,7 +46,7 @@ sub include {
&$$include_found($argument); &$$include_found($argument);
} }
sub define { sub define($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $conditional_found = \${$self->{CONDITIONAL_FOUND}}; my $conditional_found = \${$self->{CONDITIONAL_FOUND}};
...@@ -58,7 +58,7 @@ sub define { ...@@ -58,7 +58,7 @@ sub define {
&$$conditional_found($name); &$$conditional_found($name);
} }
sub undefine { sub undefine($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $conditional_found = \${$self->{CONDITIONAL_FOUND}}; my $conditional_found = \${$self->{CONDITIONAL_FOUND}};
...@@ -70,7 +70,7 @@ sub undefine { ...@@ -70,7 +70,7 @@ sub undefine {
&$$conditional_found($name); &$$conditional_found($name);
} }
sub begin_if { sub begin_if($$$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $stack = \@{$self->{STACK}}; my $stack = \@{$self->{STACK}};
...@@ -122,7 +122,7 @@ sub begin_if { ...@@ -122,7 +122,7 @@ sub begin_if {
} }
} }
sub else_if { sub else_if($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $stack = \@{$self->{STACK}}; my $stack = \@{$self->{STACK}};
...@@ -136,7 +136,7 @@ sub else_if { ...@@ -136,7 +136,7 @@ sub else_if {
} }
} }
sub end_if { sub end_if($) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $stack = \@{$self->{STACK}}; my $stack = \@{$self->{STACK}};
...@@ -145,7 +145,7 @@ sub end_if { ...@@ -145,7 +145,7 @@ sub end_if {
delete $$state{$macro} if defined($macro); delete $$state{$macro} if defined($macro);
} }
sub directive { sub directive($$$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
my $stack = \@{$self->{STACK}}; my $stack = \@{$self->{STACK}};
...@@ -172,7 +172,7 @@ sub directive { ...@@ -172,7 +172,7 @@ sub directive {
} }
} }
sub is_def { sub is_def($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
...@@ -183,7 +183,7 @@ sub is_def { ...@@ -183,7 +183,7 @@ sub is_def {
return defined($status) && $status eq "def"; return defined($status) && $status eq "def";
} }
sub is_undef { sub is_undef($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
...@@ -194,7 +194,7 @@ sub is_undef { ...@@ -194,7 +194,7 @@ sub is_undef {
return defined($status) && $status eq "undef"; return defined($status) && $status eq "undef";
} }
sub is_unknown { sub is_unknown($$) {
my $self = shift; my $self = shift;
my $state = \%{$self->{STATE}}; my $state = \%{$self->{STATE}};
......
...@@ -39,7 +39,7 @@ use winapi_parser; ...@@ -39,7 +39,7 @@ use winapi_parser;
######################################################################## ########################################################################
# new # new
# #
sub new { sub new($$) {
my $proto = shift; my $proto = shift;
my $class = ref($proto) || $proto; my $class = ref($proto) || $proto;
my $self = {}; my $self = {};
...@@ -78,7 +78,7 @@ sub new { ...@@ -78,7 +78,7 @@ sub new {
######################################################################## ########################################################################
# set_found_comment_callback # set_found_comment_callback
# #
sub set_found_comment_callback { sub set_found_comment_callback($$) {
my $self = shift; my $self = shift;
my $found_comment = \${$self->{FOUND_COMMENT}}; my $found_comment = \${$self->{FOUND_COMMENT}};
...@@ -89,7 +89,7 @@ sub set_found_comment_callback { ...@@ -89,7 +89,7 @@ sub set_found_comment_callback {
######################################################################## ########################################################################
# set_found_declaration_callback # set_found_declaration_callback
# #
sub set_found_declaration_callback { sub set_found_declaration_callback($$) {
my $self = shift; my $self = shift;
my $found_declaration = \${$self->{FOUND_DECLARATION}}; my $found_declaration = \${$self->{FOUND_DECLARATION}};
...@@ -100,7 +100,7 @@ sub set_found_declaration_callback { ...@@ -100,7 +100,7 @@ sub set_found_declaration_callback {
######################################################################## ########################################################################
# set_found_function_callback # set_found_function_callback
# #
sub set_found_function_callback { sub set_found_function_callback($$) {
my $self = shift; my $self = shift;
my $found_function = \${$self->{FOUND_FUNCTION}}; my $found_function = \${$self->{FOUND_FUNCTION}};
...@@ -111,7 +111,7 @@ sub set_found_function_callback { ...@@ -111,7 +111,7 @@ sub set_found_function_callback {
######################################################################## ########################################################################
# set_found_function_call_callback # set_found_function_call_callback
# #
sub set_found_function_call_callback { sub set_found_function_call_callback($$) {
my $self = shift; my $self = shift;
my $found_function_call = \${$self->{FOUND_FUNCTION_CALL}}; my $found_function_call = \${$self->{FOUND_FUNCTION_CALL}};
...@@ -122,7 +122,7 @@ sub set_found_function_call_callback { ...@@ -122,7 +122,7 @@ sub set_found_function_call_callback {
######################################################################## ########################################################################
# set_found_line_callback # set_found_line_callback
# #
sub set_found_line_callback { sub set_found_line_callback($$) {
my $self = shift; my $self = shift;
my $found_line = \${$self->{FOUND_LINE}}; my $found_line = \${$self->{FOUND_LINE}};
...@@ -133,7 +133,7 @@ sub set_found_line_callback { ...@@ -133,7 +133,7 @@ sub set_found_line_callback {
######################################################################## ########################################################################
# set_found_preprocessor_callback # set_found_preprocessor_callback
# #
sub set_found_preprocessor_callback { sub set_found_preprocessor_callback($$) {
my $self = shift; my $self = shift;
my $found_preprocessor = \${$self->{FOUND_PREPROCESSOR}}; my $found_preprocessor = \${$self->{FOUND_PREPROCESSOR}};
...@@ -144,7 +144,7 @@ sub set_found_preprocessor_callback { ...@@ -144,7 +144,7 @@ sub set_found_preprocessor_callback {
######################################################################## ########################################################################
# set_found_statement_callback # set_found_statement_callback
# #
sub set_found_statement_callback { sub set_found_statement_callback($$) {
my $self = shift; my $self = shift;
my $found_statement = \${$self->{FOUND_STATEMENT}}; my $found_statement = \${$self->{FOUND_STATEMENT}};
...@@ -155,7 +155,7 @@ sub set_found_statement_callback { ...@@ -155,7 +155,7 @@ sub set_found_statement_callback {
######################################################################## ########################################################################
# set_found_type_callback # set_found_type_callback
# #
sub set_found_type_callback { sub set_found_type_callback($$) {
my $self = shift; my $self = shift;
my $found_type = \${$self->{FOUND_TYPE}}; my $found_type = \${$self->{FOUND_TYPE}};
...@@ -166,7 +166,7 @@ sub set_found_type_callback { ...@@ -166,7 +166,7 @@ sub set_found_type_callback {
######################################################################## ########################################################################
# set_found_variable_callback # set_found_variable_callback
# #
sub set_found_variable_callback { sub set_found_variable_callback($$) {
my $self = shift; my $self = shift;
my $found_variable = \${$self->{FOUND_VARIABLE}}; my $found_variable = \${$self->{FOUND_VARIABLE}};
...@@ -177,7 +177,7 @@ sub set_found_variable_callback { ...@@ -177,7 +177,7 @@ sub set_found_variable_callback {
######################################################################## ########################################################################
# parse_c_file # parse_c_file
sub parse_c_file { sub parse_c_file($$$$) {
my $self = shift; my $self = shift;
my $file = \${$self->{FILE}}; my $file = \${$self->{FILE}};
...@@ -250,7 +250,7 @@ sub parse_c_file { ...@@ -250,7 +250,7 @@ sub parse_c_file {
my $type = shift; my $type = shift;
}; };
&winapi_parser::parse_c_file($$file, { winapi_parser::parse_c_file($$file, {
# c_comment_found => $found_c_comment, # c_comment_found => $found_c_comment,
# cplusplus_comment_found => $found_cplusplus_comment, # cplusplus_comment_found => $found_cplusplus_comment,
function_create => $_create_function, function_create => $_create_function,
......
...@@ -35,8 +35,8 @@ BEGIN { ...@@ -35,8 +35,8 @@ BEGIN {
} }
use config qw( use config qw(
&files_filter &files_skip files_filter files_skip
&get_h_files get_h_files
$current_dir $wine_dir $current_dir $wine_dir
); );
use output qw($output); use output qw($output);
...@@ -56,7 +56,7 @@ use winapi qw($win16api $win32api @winapis); ...@@ -56,7 +56,7 @@ use winapi qw($win16api $win32api @winapis);
use preprocessor; use preprocessor;
use type; use type;
use util qw(&is_subset); use util qw(is_subset);
use winapi_documentation; use winapi_documentation;
use winapi_function; use winapi_function;
use winapi_local; use winapi_local;
...@@ -242,7 +242,7 @@ if($options->headers) { ...@@ -242,7 +242,7 @@ if($options->headers) {
my $argument = shift; my $argument = shift;
}; };
&winapi_parser::parse_c_file($file, { winapi_parser::parse_c_file($file, {
c_comment_found => $found_c_comment, c_comment_found => $found_c_comment,
cplusplus_comment_found => $found_cplusplus_comment, cplusplus_comment_found => $found_cplusplus_comment,
function_create => $create_function, function_create => $create_function,
...@@ -377,18 +377,18 @@ foreach my $file (@c_files) { ...@@ -377,18 +377,18 @@ foreach my $file (@c_files) {
} }
if($options->local && $options->argument && defined($statements)) { if($options->local && $options->argument && defined($statements)) {
&winapi_local::check_function($function); winapi_local::check_function($function);
} }
if($options->local && $options->statements && defined($statements)) { if($options->local && $options->statements && defined($statements)) {
&winapi_local::check_statements(\%functions, $function); winapi_local::check_statements(\%functions, $function);
} }
if($options->local && $options->documentation && if($options->local && $options->documentation &&
(defined($module16) || defined($module32)) && (defined($module16) || defined($module32)) &&
$linkage eq "" && defined($statements)) $linkage eq "" && defined($statements))
{ {
&winapi_documentation::check_documentation($function); winapi_documentation::check_documentation($function);
} }
if(1) { if(1) {
...@@ -657,7 +657,7 @@ foreach my $file (@c_files) { ...@@ -657,7 +657,7 @@ foreach my $file (@c_files) {
} }
}; };
&winapi_parser::parse_c_file($file, { winapi_parser::parse_c_file($file, {
c_comment_found => $found_c_comment, c_comment_found => $found_c_comment,
cplusplus_comment_found => $found_cplusplus_comment, cplusplus_comment_found => $found_cplusplus_comment,
function_create => $create_function, function_create => $create_function,
...@@ -673,13 +673,13 @@ foreach my $file (@c_files) { ...@@ -673,13 +673,13 @@ foreach my $file (@c_files) {
} }
} }
&winapi_local::check_file($file, \%functions); winapi_local::check_file($file, \%functions);
} }
if($options->global) { if($options->global) {
&winapi_global::check_modules(\%complete_module, \%module2functions); winapi_global::check_modules(\%complete_module, \%module2functions);
if($all_modules) { if($all_modules) {
&winapi_global::check_all_modules(\%include2info); winapi_global::check_all_modules(\%include2info);
} }
} }
...@@ -31,7 +31,7 @@ my %comment_width; ...@@ -31,7 +31,7 @@ my %comment_width;
my %comment_indent; my %comment_indent;
my %comment_spacing; my %comment_spacing;
sub check_documentation { sub check_documentation($) {
local $_; local $_;
my $function = shift; my $function = shift;
...@@ -137,7 +137,7 @@ sub check_documentation { ...@@ -137,7 +137,7 @@ sub check_documentation {
} elsif ($ordinal eq "init") { } elsif ($ordinal eq "init") {
$ordinal = 0; $ordinal = 0;
} else { } else {
$output->write("documentation: $external_name (\U$module\E.$ordinal) wrong\n"); $output->write("documentation: $external_name (\U$module\E.$ordinal) wrong1\n");
next; next;
} }
...@@ -165,7 +165,7 @@ sub check_documentation { ...@@ -165,7 +165,7 @@ sub check_documentation {
} }
if (!$found && $external_name ne "DllMain" && $ordinal !~ /^0$/) { if (!$found && $external_name ne "DllMain" && $ordinal !~ /^0$/) {
$output->write("documentation: $external_name (\U$module\E.$ordinal) wrong\n"); $output->write("documentation: $external_name (\U$module\E.$ordinal) wrong2\n");
} }
} }
} }
...@@ -220,7 +220,7 @@ sub check_documentation { ...@@ -220,7 +220,7 @@ sub check_documentation {
} }
} }
sub report_documentation { sub report_documentation() {
if($options->documentation_comment_indent) { if($options->documentation_comment_indent) {
foreach my $indent (sort(keys(%comment_indent))) { foreach my $indent (sort(keys(%comment_indent))) {
my $count = $comment_indent{$indent}; my $count = $comment_indent{$indent};
......
...@@ -22,7 +22,7 @@ use base qw(function); ...@@ -22,7 +22,7 @@ use base qw(function);
use strict; use strict;
use config qw($current_dir $wine_dir); use config qw($current_dir $wine_dir);
use util qw(&normalize_set); use util qw(normalize_set);
my $import = 0; my $import = 0;
use vars qw($modules $win16api $win32api @winapis); use vars qw($modules $win16api $win32api @winapis);
...@@ -31,7 +31,7 @@ use vars qw($modules $win16api $win32api @winapis); ...@@ -31,7 +31,7 @@ use vars qw($modules $win16api $win32api @winapis);
# constructor # constructor
# #
sub new { sub new($) {
my $proto = shift; my $proto = shift;
my $class = ref($proto) || $proto; my $class = ref($proto) || $proto;
my $self = {}; my $self = {};
...@@ -53,14 +53,14 @@ sub new { ...@@ -53,14 +53,14 @@ sub new {
# is_win # is_win
# #
sub is_win16 { my $self = shift; return defined($self->_module($win16api, @_)); } sub is_win16($) { my $self = shift; return defined($self->_module($win16api, @_)); }
sub is_win32 { my $self = shift; return defined($self->_module($win32api, @_)); } sub is_win32($) { my $self = shift; return defined($self->_module($win32api, @_)); }
######################################################################## ########################################################################
# external_name # external_name
# #
sub _external_name { sub _external_name($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -89,7 +89,7 @@ sub _external_name { ...@@ -89,7 +89,7 @@ sub _external_name {
return join(" & ", @external_names2); return join(" & ", @external_names2);
} }
sub _external_names { sub _external_names($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -102,7 +102,7 @@ sub _external_names { ...@@ -102,7 +102,7 @@ sub _external_names {
} }
} }
sub external_name { sub external_name($) {
my $self = shift; my $self = shift;
foreach my $winapi (@winapis) { foreach my $winapi (@winapis) {
...@@ -116,19 +116,19 @@ sub external_name { ...@@ -116,19 +116,19 @@ sub external_name {
return undef; return undef;
} }
sub external_name16 { my $self = shift; return $self->_external_name($win16api, @_); } sub external_name16($) { my $self = shift; return $self->_external_name($win16api, @_); }
sub external_name32 { my $self = shift; return $self->_external_name($win32api, @_); } sub external_name32($) { my $self = shift; return $self->_external_name($win32api, @_); }
sub external_names16 { my $self = shift; return $self->_external_names($win16api, @_); } sub external_names16($) { my $self = shift; return $self->_external_names($win16api, @_); }
sub external_names32 { my $self = shift; return $self->_external_names($win32api, @_); } sub external_names32($) { my $self = shift; return $self->_external_names($win32api, @_); }
sub external_names { my $self = shift; return ($self->external_names16, $self->external_names32); } sub external_names($) { my $self = shift; return ($self->external_names16, $self->external_names32); }
######################################################################## ########################################################################
# module # module
# #
sub _module { sub _module($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -154,7 +154,7 @@ sub _module { ...@@ -154,7 +154,7 @@ sub _module {
return join(" & ", @modules); return join(" & ", @modules);
} }
sub _modules { sub _modules($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -167,21 +167,21 @@ sub _modules { ...@@ -167,21 +167,21 @@ sub _modules {
} }
} }
sub module16 { my $self = shift; return $self->_module($win16api, @_); } sub module16($) { my $self = shift; return $self->_module($win16api, @_); }
sub module32 { my $self = shift; return $self->_module($win32api, @_); } sub module32($) { my $self = shift; return $self->_module($win32api, @_); }
sub module { my $self = shift; return join (" & ", $self->modules); } sub module($) { my $self = shift; return join (" & ", $self->modules); }
sub modules16 { my $self = shift; return $self->_modules($win16api, @_); } sub modules16($) { my $self = shift; return $self->_modules($win16api, @_); }
sub modules32 { my $self = shift; return $self->_modules($win32api, @_); } sub modules32($) { my $self = shift; return $self->_modules($win32api, @_); }
sub modules { my $self = shift; return ($self->modules16, $self->modules32); } sub modules($) { my $self = shift; return ($self->modules16, $self->modules32); }
######################################################################## ########################################################################
# ordinal # ordinal
# #
sub _ordinal { sub _ordinal($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -210,7 +210,7 @@ sub _ordinal { ...@@ -210,7 +210,7 @@ sub _ordinal {
return join(" & ", @ordinals2); return join(" & ", @ordinals2);
} }
sub _ordinals { sub _ordinals($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
...@@ -223,21 +223,21 @@ sub _ordinals { ...@@ -223,21 +223,21 @@ sub _ordinals {
} }
} }
sub ordinal16 { my $self = shift; return $self->_ordinal($win16api, @_); } sub ordinal16($) { my $self = shift; return $self->_ordinal($win16api, @_); }
sub ordinal32 { my $self = shift; return $self->_ordinal($win32api, @_); } sub ordinal32($) { my $self = shift; return $self->_ordinal($win32api, @_); }
sub ordinal { my $self = shift; return join (" & ", $self->ordinals); } sub ordinal($) { my $self = shift; return join (" & ", $self->ordinals); }
sub ordinals16 { my $self = shift; return $self->_ordinals($win16api, @_); } sub ordinals16($) { my $self = shift; return $self->_ordinals($win16api, @_); }
sub ordinals32 { my $self = shift; return $self->_ordinals($win32api, @_); } sub ordinals32($) { my $self = shift; return $self->_ordinals($win32api, @_); }
sub ordinals { my $self = shift; return ($self->ordinals16, $self->ordinals32); } sub ordinals($) { my $self = shift; return ($self->ordinals16, $self->ordinals32); }
######################################################################## ########################################################################
# prefix # prefix
# #
sub prefix { sub prefix($) {
my $self = shift; my $self = shift;
my $module16 = $self->module16; my $module16 = $self->module16;
my $module32 = $self->module32; my $module32 = $self->module32;
...@@ -288,7 +288,7 @@ sub prefix { ...@@ -288,7 +288,7 @@ sub prefix {
# calling_convention # calling_convention
# #
sub calling_convention16 { sub calling_convention16($) {
my $self = shift; my $self = shift;
my $return_kind16 = $self->return_kind16; my $return_kind16 = $self->return_kind16;
...@@ -319,7 +319,7 @@ sub calling_convention16 { ...@@ -319,7 +319,7 @@ sub calling_convention16 {
} }
} }
sub calling_convention32 { sub calling_convention32($) {
my $self = shift; my $self = shift;
local $_ = $self->calling_convention; local $_ = $self->calling_convention;
...@@ -336,28 +336,28 @@ sub calling_convention32 { ...@@ -336,28 +336,28 @@ sub calling_convention32 {
} }
} }
sub get_all_module_ordinal16 { sub get_all_module_ordinal16($) {
my $self = shift; my $self = shift;
my $internal_name = $self->internal_name; my $internal_name = $self->internal_name;
return winapi::get_all_module_internal_ordinal16($internal_name); return winapi::get_all_module_internal_ordinal16($internal_name);
} }
sub get_all_module_ordinal32 { sub get_all_module_ordinal32($) {
my $self = shift; my $self = shift;
my $internal_name = $self->internal_name; my $internal_name = $self->internal_name;
return winapi::get_all_module_internal_ordinal32($internal_name); return winapi::get_all_module_internal_ordinal32($internal_name);
} }
sub get_all_module_ordinal { sub get_all_module_ordinal($) {
my $self = shift; my $self = shift;
my $internal_name = $self->internal_name; my $internal_name = $self->internal_name;
return winapi::get_all_module_internal_ordinal($internal_name); return winapi::get_all_module_internal_ordinal($internal_name);
} }
sub _return_kind { sub _return_kind($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
my $return_type = $self->return_type; my $return_type = $self->return_type;
...@@ -365,15 +365,15 @@ sub _return_kind { ...@@ -365,15 +365,15 @@ sub _return_kind {
return $winapi->translate_argument($return_type); return $winapi->translate_argument($return_type);
} }
sub return_kind16 { sub return_kind16($) {
my $self = shift; return $self->_return_kind($win16api, @_); my $self = shift; return $self->_return_kind($win16api, @_);
} }
sub return_kind32 { sub return_kind32($) {
my $self = shift; return $self->_return_kind($win32api, @_); my $self = shift; return $self->_return_kind($win32api, @_);
} }
sub _argument_kinds { sub _argument_kinds($$) {
my $self = shift; my $self = shift;
my $winapi = shift; my $winapi = shift;
my $refargument_types = $self->argument_types; my $refargument_types = $self->argument_types;
...@@ -396,11 +396,11 @@ sub _argument_kinds { ...@@ -396,11 +396,11 @@ sub _argument_kinds {
return [@argument_kinds]; return [@argument_kinds];
} }
sub argument_kinds16 { sub argument_kinds16($) {
my $self = shift; return $self->_argument_kinds($win16api, @_); my $self = shift; return $self->_argument_kinds($win16api, @_);
} }
sub argument_kinds32 { sub argument_kinds32($) {
my $self = shift; return $self->_argument_kinds($win32api, @_); my $self = shift; return $self->_argument_kinds($win32api, @_);
} }
...@@ -408,7 +408,7 @@ sub argument_kinds32 { ...@@ -408,7 +408,7 @@ sub argument_kinds32 {
# Accounting # Accounting
# #
sub function_called { sub function_called($$) {
my $self = shift; my $self = shift;
my $called_function_names = \%{$self->{CALLED_FUNCTION_NAMES}}; my $called_function_names = \%{$self->{CALLED_FUNCTION_NAMES}};
...@@ -417,7 +417,7 @@ sub function_called { ...@@ -417,7 +417,7 @@ sub function_called {
$$called_function_names{$name}++; $$called_function_names{$name}++;
} }
sub function_called_by { sub function_called_by($$) {
my $self = shift; my $self = shift;
my $called_by_function_names = \%{$self->{CALLED_BY_FUNCTION_NAMES}}; my $called_by_function_names = \%{$self->{CALLED_BY_FUNCTION_NAMES}};
...@@ -426,14 +426,14 @@ sub function_called_by { ...@@ -426,14 +426,14 @@ sub function_called_by {
$$called_by_function_names{$name}++; $$called_by_function_names{$name}++;
} }
sub called_function_names { sub called_function_names($) {
my $self = shift; my $self = shift;
my $called_function_names = \%{$self->{CALLED_FUNCTION_NAMES}}; my $called_function_names = \%{$self->{CALLED_FUNCTION_NAMES}};
return sort(keys(%$called_function_names)); return sort(keys(%$called_function_names));
} }
sub called_by_function_names { sub called_by_function_names($) {
my $self = shift; my $self = shift;
my $called_by_function_names = \%{$self->{CALLED_BY_FUNCTION_NAMES}}; my $called_by_function_names = \%{$self->{CALLED_BY_FUNCTION_NAMES}};
......
...@@ -26,7 +26,7 @@ use options qw($options); ...@@ -26,7 +26,7 @@ use options qw($options);
use output qw($output); use output qw($output);
use winapi qw(@winapis); use winapi qw(@winapis);
sub check_modules { sub check_modules($$) {
my $complete_module = shift; my $complete_module = shift;
my $module2functions = shift; my $module2functions = shift;
...@@ -67,10 +67,10 @@ sub check_modules { ...@@ -67,10 +67,10 @@ sub check_modules {
} }
} }
sub check_all_modules { sub check_all_modules($) {
my $include2info = shift; my $include2info = shift;
&winapi_documentation::report_documentation; winapi_documentation::report_documentation();
if($options->headers_unused && $options->include) { if($options->headers_unused && $options->include) {
foreach my $name (sort(keys(%$include2info))) { foreach my $name (sort(keys(%$include2info))) {
......
...@@ -25,7 +25,7 @@ use options qw($options); ...@@ -25,7 +25,7 @@ use options qw($options);
use output qw($output); use output qw($output);
use winapi qw($win16api $win32api @winapis); use winapi qw($win16api $win32api @winapis);
sub check_function { sub check_function($) {
my $function = shift; my $function = shift;
my $return_type = $function->return_type; my $return_type = $function->return_type;
...@@ -58,7 +58,7 @@ sub check_function { ...@@ -58,7 +58,7 @@ sub check_function {
} }
} }
sub _check_function { sub _check_function($$$$$$) {
my $return_type = shift; my $return_type = shift;
my $calling_convention = shift; my $calling_convention = shift;
my $external_name = shift; my $external_name = shift;
...@@ -289,7 +289,7 @@ sub _check_function { ...@@ -289,7 +289,7 @@ sub _check_function {
} }
} }
sub check_statements { sub check_statements($$) {
my $functions = shift; my $functions = shift;
my $function = shift; my $function = shift;
...@@ -305,7 +305,7 @@ sub check_statements { ...@@ -305,7 +305,7 @@ sub check_statements {
} }
} }
sub _check_statements { sub _check_statements($$$) {
my $winapi = shift; my $winapi = shift;
my $functions = shift; my $functions = shift;
my $function = shift; my $function = shift;
...@@ -384,7 +384,7 @@ sub _check_statements { ...@@ -384,7 +384,7 @@ sub _check_statements {
} }
} }
sub check_file { sub check_file($$) {
my $file = shift; my $file = shift;
my $functions = shift; my $functions = shift;
......
...@@ -23,7 +23,7 @@ use strict; ...@@ -23,7 +23,7 @@ use strict;
use output qw($output); use output qw($output);
use options qw($options); use options qw($options);
sub parse_c_file { sub parse_c_file($$) {
my $file = shift; my $file = shift;
my $callbacks = shift; my $callbacks = shift;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment