Alter the functions declaration order or predeclare them so perl can
authorFrancois Gouget <fgouget@free.fr>
Sat, 30 Oct 2004 02:11:19 +0000 (02:11 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Sat, 30 Oct 2004 02:11:19 +0000 (02:11 +0000)
check the prototypes.

tools/c2man.pl
tools/winapi_check/modules.pm
tools/winapi_check/winapi_local.pm
tools/winemaker

index 67c9e1b33d28415a21b076cbb315c775f1ff3f84..b4e24cc1d70b81ab271aa9006a3829008a4a3e23 100755 (executable)
@@ -66,6 +66,23 @@ my $year = $datetime[5] + 1900;
 my $date = "$months[$datetime[4]] $year";
 
 
+sub output_api_comment($);
+sub output_api_footer($);
+sub output_api_header($);
+sub output_api_name($);
+sub output_api_synopsis($);
+sub output_close_api_file();
+sub output_comment($);
+sub output_html_index_files();
+sub output_html_stylesheet();
+sub output_open_api_file($);
+sub output_sgml_dll_file($);
+sub output_sgml_master_file($);
+sub output_spec($);
+sub process_comment($);
+sub process_extra_comment($);
+
+
 # Generate the list of exported entries for the dll
 sub process_spec_file($)
 {
index 06121b9cbc8d8ed8522a0a954f832d9ecde4eaa2..7d0077c05a058d0fbc52867a86ff2dbd8e559436 100644 (file)
@@ -186,44 +186,6 @@ sub all_modules($) {
     return sort(keys(%$module2spec_file));
 }
 
-sub complete_modules($$) {
-    my $self = shift;
-
-    my $c_files = shift;
-
-    my %dirs;
-
-    foreach my $file (@$c_files) {
-       my $dir = file_directory("$current_dir/$file");
-       $dirs{$dir}++;
-    }
-
-    my @c_files = get_c_files("winelib");
-    @c_files = files_skip(@c_files);
-    foreach my $file (@c_files) {
-       my $dir = file_directory($file);
-       if(exists($dirs{$dir})) {
-           $dirs{$dir}--;
-       }
-    }
-
-    my @complete_modules = ();
-    foreach my $module ($self->all_modules) {
-       my $index = -1;
-       my @dirs = $self->allowed_dirs_for_module($module);
-       foreach my $dir (@dirs) {
-           if(exists($dirs{$dir}) && $dirs{$dir} == 0) {
-               $index++;
-           }
-       }
-       if($index == $#dirs) {
-           push @complete_modules, $module;
-       }
-    }
-
-    return @complete_modules;
-}
-
 sub is_allowed_module($$) {
     my $self = shift;
 
@@ -326,6 +288,44 @@ sub found_module_in_dir($$$) {
     $$used_module_dirs{$module}{$dir}++;
 }
 
+sub complete_modules($$) {
+    my $self = shift;
+
+    my $c_files = shift;
+
+    my %dirs;
+
+    foreach my $file (@$c_files) {
+       my $dir = file_directory("$current_dir/$file");
+       $dirs{$dir}++;
+    }
+
+    my @c_files = get_c_files("winelib");
+    @c_files = files_skip(@c_files);
+    foreach my $file (@c_files) {
+       my $dir = file_directory($file);
+       if(exists($dirs{$dir})) {
+           $dirs{$dir}--;
+       }
+    }
+
+    my @complete_modules = ();
+    foreach my $module ($self->all_modules) {
+       my $index = -1;
+       my @dirs = $self->allowed_dirs_for_module($module);
+       foreach my $dir (@dirs) {
+           if(exists($dirs{$dir}) && $dirs{$dir} == 0) {
+               $index++;
+           }
+       }
+       if($index == $#dirs) {
+           push @complete_modules, $module;
+       }
+    }
+
+    return @complete_modules;
+}
+
 sub global_report($) {
     my $self = shift;
 
index aa83bf3e8a6a8790458bbbcd18ca2ab712343451..fb9a3309fb36128047e0d5e68580cfa5bb885d24 100644 (file)
@@ -25,39 +25,6 @@ use options qw($options);
 use output qw($output);
 use winapi qw($win16api $win32api @winapis);
 
-sub check_function($) {
-    my $function = shift;
-
-    my $return_type = $function->return_type;
-    my $calling_convention = $function->calling_convention;
-    my $calling_convention16 = $function->calling_convention16;
-    my $calling_convention32 = $function->calling_convention32;
-    my $internal_name = $function->internal_name;
-    my $external_name16 = $function->external_name16;
-    my $external_name32 = $function->external_name32;
-    my $module16 = $function->module16;
-    my $module32 = $function->module32;
-    my $refargument_types = $function->argument_types;
-
-    if(!defined($refargument_types)) {
-       return;
-    }
-
-    if($options->win16 && $options->report_module($module16)) {
-       _check_function($return_type,
-                       $calling_convention, $external_name16,
-                       $internal_name, $refargument_types,
-                       $win16api);
-    }
-
-    if($options->win32 && $options->report_module($module32)) {
-       _check_function($return_type,
-                       $calling_convention, $external_name32,
-                       $internal_name, $refargument_types,
-                       $win32api);
-    }
-}
-
 sub _check_function($$$$$$) {
     my $return_type = shift;
     my $calling_convention = shift;
@@ -303,19 +270,36 @@ sub _check_function($$$$$$) {
     }
 }
 
-sub check_statements($$) {
-    my $functions = shift;
+sub check_function($) {
     my $function = shift;
 
+    my $return_type = $function->return_type;
+    my $calling_convention = $function->calling_convention;
+    my $calling_convention16 = $function->calling_convention16;
+    my $calling_convention32 = $function->calling_convention32;
+    my $internal_name = $function->internal_name;
+    my $external_name16 = $function->external_name16;
+    my $external_name32 = $function->external_name32;
     my $module16 = $function->module16;
     my $module32 = $function->module32;
+    my $refargument_types = $function->argument_types;
+
+    if(!defined($refargument_types)) {
+       return;
+    }
 
     if($options->win16 && $options->report_module($module16)) {
-       _check_statements($win16api, $functions, $function);
+       _check_function($return_type,
+                       $calling_convention, $external_name16,
+                       $internal_name, $refargument_types,
+                       $win16api);
     }
 
     if($options->win32 && $options->report_module($module32)) {
-       _check_statements($win16api, $functions, $function);
+       _check_function($return_type,
+                       $calling_convention, $external_name32,
+                       $internal_name, $refargument_types,
+                       $win32api);
     }
 }
 
@@ -398,6 +382,22 @@ sub _check_statements($$$) {
     }
 }
 
+sub check_statements($$) {
+    my $functions = shift;
+    my $function = shift;
+
+    my $module16 = $function->module16;
+    my $module32 = $function->module32;
+
+    if($options->win16 && $options->report_module($module16)) {
+       _check_statements($win16api, $functions, $function);
+    }
+
+    if($options->win32 && $options->report_module($module32)) {
+       _check_statements($win16api, $functions, $function);
+    }
+}
+
 sub check_file($$) {
     my $file = shift;
     my $functions = shift;
index 7b27d6b653a0433353aa5d7e8eccf29060f200b9..8572a99664c91d3a0752eafe700b3d2eee80910a 100755 (executable)
@@ -403,6 +403,45 @@ sub bsearch($$)
   }
 }
 
+##
+# Retrieves the contents of the specified directory.
+# We either get it from the directories hashtable which acts as a
+# cache, or use opendir, readdir, closedir and store the result
+# in the hashtable.
+sub get_directory_contents($)
+{
+  my $dirname=$_[0];
+  my $directory;
+
+  #print "getting the contents of $dirname\n";
+
+  # check for a cached version
+  $dirname =~ s+/$++;
+  if ($dirname eq "") {
+    $dirname=cwd;
+  }
+  $directory=$directories{$dirname};
+  if (defined $directory) {
+    #print "->@$directory\n";
+    return $directory;
+  }
+
+  # Read this directory
+  if (opendir(DIRECTORY, "$dirname")) {
+    my @files=readdir DIRECTORY;
+    closedir(DIRECTORY);
+    $directory=\@files;
+  } else {
+    # Return an empty list
+    #print "error: cannot open $dirname\n";
+    my @files;
+    $directory=\@files;
+  }
+  #print "->@$directory\n";
+  $directories{$dirname}=$directory;
+  return $directory;
+}
+
 
 
 #####
@@ -1023,45 +1062,6 @@ sub fix_file_and_directory_names($)
 # its contents (files and directories)
 my %directories;
 
-##
-# Retrieves the contents of the specified directory.
-# We either get it from the directories hashtable which acts as a
-# cache, or use opendir, readdir, closedir and store the result
-# in the hashtable.
-sub get_directory_contents($)
-{
-  my $dirname=$_[0];
-  my $directory;
-
-  #print "getting the contents of $dirname\n";
-
-  # check for a cached version
-  $dirname =~ s+/$++;
-  if ($dirname eq "") {
-    $dirname=cwd;
-  }
-  $directory=$directories{$dirname};
-  if (defined $directory) {
-    #print "->@$directory\n";
-    return $directory;
-  }
-
-  # Read this directory
-  if (opendir(DIRECTORY, "$dirname")) {
-    my @files=readdir DIRECTORY;
-    closedir(DIRECTORY);
-    $directory=\@files;
-  } else {
-    # Return an empty list
-    #print "error: cannot open $dirname\n";
-    my @files;
-    $directory=\@files;
-  }
-  #print "->@$directory\n";
-  $directories{$dirname}=$directory;
-  return $directory;
-}
-
 ##
 # Try to find a file for the specified filename. The attempt is
 # case-insensitive which is why it's not trivial. If a match is