Loading ...
Sorry, an error occurred while loading the content.

70What's in a $name ?

Expand Messages
  • James E Keenan
    Mar 15, 2010
    • 0 Attachment
      We're down to one global variable -- or perhaps two!

      The $name in line 509 (inside PARAGRAPH loop inside sub process_file)
      and the $name in line 1113 (sub INPUT_handler) are the culprits. I
      can't tell whether they're the same global variable or not. I also
      can't tell where they are getting assigned.

      I have renamed all other instances of variables named $name (e.g.,
      $xname in one location, $yname in another) -- and even other
      variables that merely started that way (e.g., $name_printed is now
      $printed_name).

      More eyeballs? Thanks.

      jimk


      $ grep -nC6 '$name' lib/ExtUtils/ParseXS.pm
      501- @args = split(/\s*,\s*/, $orig_args);
      502- for (@args) {
      503- if ($args{inout} and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)
      \b\s*//) {
      504- my $out_type = $1;
      505- next if $out_type eq 'IN';
      506- $only_C_inlist{$_} = 1 if $out_type eq "OUTLIST";
      507: # $name in line below appears to a global not
      previously declared or
      508- # defined
      509: push @outlist, $name if $out_type =~ /OUTLIST$/;
      510- $in_out{$_} = $out_type;
      511- }
      512- }
      513- }
      514- if (defined($class)) {
      515- my $arg0 = ((defined($static) or $func_name eq 'new')
      --
      1106- # remove trailing semicolon if no initialisation
      1107- s/\s*;$//g unless /[=;+].*\S/;
      1108-
      1109- # Process the length(foo) declarations
      1110- if (s/^([^=]*)\blength\(\s*(\w+)\s*\)\s*$/$1
      XSauto_length_of_$2=NO_INIT/x) {
      1111- print "\tSTRLEN\tSTRLEN_length_of_$2;\n";
      1112: # $name in line below is global ?
      1113: $lengthof{$2} = $name;
      1114: # $islengthof{$name} = $1;
      1115- $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_
      $2;\n";
      1116- }
      1117-
      1118- # check for optional initialisation code
      1119- my $var_init = '';
      1120- $var_init = $1 if s/\s*([=;+].*)$//s;
    • Show all 2 messages in this topic