Last perl function prototype issues

Francois Gouget fgouget at free.fr
Thu Oct 28 19:36:38 CDT 2004


Some perl function prototype predeclaration issues I missed in the last 
past. With this patch it's all done.

Changelog:

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

    Alter the functions declaration order or predeclare them so perl can 
check the prototypes.


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
-------------- next part --------------
Index: tools/c2man.pl
===================================================================
RCS file: /var/cvs/wine/tools/c2man.pl,v
retrieving revision 1.18
diff -u -r1.18 c2man.pl
--- tools/c2man.pl	4 Oct 2004 18:57:02 -0000	1.18
+++ tools/c2man.pl	25 Oct 2004 13:24:28 -0000
@@ -66,6 +66,23 @@
 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: tools/winemaker
===================================================================
RCS file: /var/cvs/wine/tools/winemaker,v
retrieving revision 1.76
diff -u -r1.76 winemaker
--- tools/winemaker	3 Mar 2004 02:19:20 -0000	1.76
+++ tools/winemaker	23 Oct 2004 20:19:27 -0000
@@ -403,6 +403,45 @@
   }
 }
 
+##
+# 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;
+}
+
 
 
 #####
@@ -1024,45 +1063,6 @@
 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
 # found then we return the pathname with the correct case.
Index: tools/winapi_check/modules.pm
===================================================================
RCS file: /var/cvs/wine/tools/winapi_check/modules.pm,v
retrieving revision 1.23
diff -u -r1.23 modules.pm
--- tools/winapi_check/modules.pm	22 Oct 2004 19:55:42 -0000	1.23
+++ tools/winapi_check/modules.pm	23 Oct 2004 20:15:03 -0000
@@ -186,44 +186,6 @@
     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 @@
     $$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: tools/winapi_check/winapi_local.pm
===================================================================
RCS file: /var/cvs/wine/tools/winapi_check/winapi_local.pm,v
retrieving revision 1.42
diff -u -r1.42 winapi_local.pm
--- tools/winapi_check/winapi_local.pm	22 Oct 2004 19:55:42 -0000	1.42
+++ tools/winapi_check/winapi_local.pm	23 Oct 2004 20:16:46 -0000
@@ -25,39 +25,6 @@
 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_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($$) {
+    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;


More information about the wine-patches mailing list