Author: jkeenan
Date: Thu Feb  8 06:13:01 2007
New Revision: 16923

Modified:
   branches/buildtools/tools/build/ops2c.pl

Log:
Small refactorings, e.g., eliminated $mmp_v, which was only used once (in the
line following its declaration); eliminated commented-out code.  Tested via
'make'; 'make' succeeded.  This is a step on the way to gathering the script's
code into subroutines and thereby making the code more easily and directly
testable.


Modified: branches/buildtools/tools/build/ops2c.pl
==============================================================================
--- branches/buildtools/tools/build/ops2c.pl    (original)
+++ branches/buildtools/tools/build/ops2c.pl    Thu Feb  8 06:13:01 2007
@@ -117,31 +117,20 @@
     mkdir( $incdir, 0755 ) or die "ops2c.pl: Could not mkdir $incdir $!!\n";
 }
 
-#open my $HEADER, '>', $header
-#    or die "ops2c.pl: Cannot open header file '$header' for writing: $!!\n";
-
-#open my $SOURCE, '>', $source
-#    or die "ops2c.pl: Cannot open source file '$source' for writing: $!!\n";
-
-
-#my $preamble = <<END_C;
-#/* ex: set ro:
-# * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
-# *
-# * This file is generated automatically from '$file' (and possibly other
-# * .ops files). by $0.
-# *
-# * Any changes made here will be lost!
-# *
-# */
-#
-#END_C
-
 my $preamble = _compose_preamble($file, $0);
 
-my $mmp_v     = "${major_version}_${minor_version}_${patch_version}";
-my $init_func = "Parrot_DynOp_${base}${suffix}_$mmp_v";
+#my $mmp_v     = "${major_version}_${minor_version}_${patch_version}";
+#my $init_func = "Parrot_DynOp_${base}${suffix}_$mmp_v";
+my $init_func = join q{_}, (
+    q{Parrot},
+    q{DynOp},
+    $base . $suffix,
+    $major_version,
+    $minor_version,
+    $patch_version
+);
 
+# Open the C-header (.h) file
 open my $HEADER, '>', $header
     or die "ops2c.pl: Cannot open header file '$header' for writing: $!!\n";
 
@@ -163,18 +152,7 @@
     my $run_core_func = $trans->run_core_func_decl($base);
     print $HEADER "$run_core_func;\n";
 }
-my $bs = "${base}${suffix}_";
-
-# append the C code coda
-#print $HEADER <<END_C;
-#
-#/*
-# * Local variables:
-# *   c-file-style: "parrot"
-# * End:
-# * vim: expandtab shiftwidth=4:
-# */
-#END_C
+my $bs = "${base}${suffix}_";   # Also invoked as ${bs}
 
 _print_coda($HEADER);
 
@@ -637,17 +615,6 @@
 
 }
 
-# append the C code coda
-#print $SOURCE <<END_C;
-#
-#/*
-# * Local variables:
-# *   c-file-style: "parrot"
-# * End:
-# * vim: expandtab shiftwidth=4:
-# */
-#END_C
-
 _print_coda($SOURCE);
 
 close $SOURCE or die "Unable to close handle to $source: $!";

Reply via email to