diff --git a/Basic/lib/PDL/Core/pdl.h.PL b/Basic/lib/PDL/Core/pdl.h.PL index 1fcbe386e..c36caa14a 100644 --- a/Basic/lib/PDL/Core/pdl.h.PL +++ b/Basic/lib/PDL/Core/pdl.h.PL @@ -640,13 +640,13 @@ typedef struct pdl_slice_args { register PDL_Indx __tdims1 = __tdims[1]; \ register PDL_Indx *__offsp = PDL->get_threadoffsp(&(brc)); \ if (!__offsp ) return PDL->make_error_simple(PDL_EFATAL, "Error in get_threadoffsp"); \ - PDL_COMMENT("incs are each pdl's stride, declared at func start") \ - PDL_COMMENT("offs are each pthread's starting offset into each pdl") \ + /* incs are each pdl's stride, declared at func start */ \ + /* offs are each pthread's starting offset into each pdl */ \ ptrStep1 \ for( __tind1 = 0 ; \ __tind1 < __tdims1 ; \ __tind1++ \ - PDL_COMMENT("step by tinc1, undoing inner-loop of tinc0*tdims0") \ + /* step by tinc1, undoing inner-loop of tinc0*tdims0 */ \ PDL_EXPAND ptrStep2 \ ) \ { \ @@ -655,11 +655,11 @@ typedef struct pdl_slice_args { __tind0++ \ PDL_EXPAND ptrStep3 \ ) { \ - PDL_COMMENT("This is the tightest loop. Make sure inside is optimal.") + /* This is the tightest loop. Make sure inside is optimal. */ #define PDL_BROADCASTLOOP_END(brc, ptrStep1) \ } \ } \ - PDL_COMMENT("undo outer-loop of tinc1*tdims1, and original per-pthread offset") \ + /* undo outer-loop of tinc1*tdims1, and original per-pthread offset */ \ ptrStep1 \ __brcloopval = PDL->iterbroadcastloop(&(brc),2); \ if ( __brcloopval < 0 ) return PDL->make_error_simple(PDL_EFATAL, "Error in iterbroadcastloop"); \ diff --git a/Basic/lib/PDL/PP.pm b/Basic/lib/PDL/PP.pm index a45b7204b..6f0b6d843 100644 --- a/Basic/lib/PDL/PP.pm +++ b/Basic/lib/PDL/PP.pm @@ -454,21 +454,6 @@ our $header_c = pp_line_numbers(__LINE__, <<'EOF'); * THIS FILE WAS GENERATED BY PDL::PP from %s! Do not modify! */ -#define PDL_COMMENT(comment) -PDL_COMMENT("This preprocessor symbol is used to add commentary in the PDL ") -PDL_COMMENT("autogenerated code. Normally, one would use typical C-style ") -PDL_COMMENT("multiline comments (i.e. /* comment */). However, because such ") -PDL_COMMENT("comments do not nest, it's not possible for PDL::PP users to ") -PDL_COMMENT("comment-out sections of code using multiline comments, as is ") -PDL_COMMENT("often the practice when debugging, for example. So, when you ") -PDL_COMMENT("see something like this: ") -PDL_COMMENT(" ") - PDL_COMMENT("Memory access") -PDL_COMMENT(" ") -PDL_COMMENT("just think of it as a C multiline comment like: ") -PDL_COMMENT(" ") -PDL_COMMENT(" /* Memory access */ ") - #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \ if (destroy) { \ comp_free_code \ @@ -483,11 +468,11 @@ PDL_COMMENT(" /* Memory access */ ") #include "pdl.h" #include "pdlcore.h" #define PDL %s -extern Core* PDL; PDL_COMMENT("Structure hold core C functions") +extern Core* PDL; /* Structure hold core C functions */ EOF our $header_xs = <<'EOF'; -Core* PDL = NULL; PDL_COMMENT("Structure hold core C functions") +Core* PDL = NULL; /* Structure hold core C functions */ MODULE = %1$s PACKAGE = %2$s PREFIX=pdl_run_ @@ -496,8 +481,8 @@ PROTOTYPES: DISABLE EOF our $header_xsboot = pp_line_numbers(__LINE__, <<'EOF'); BOOT: - PDL_COMMENT("Get pointer to structure of core shared C routines") - PDL_COMMENT("make sure PDL::Core is loaded") + /* Get pointer to structure of core shared C routines */ + /* make sure PDL::Core is loaded */ EOF use Config; diff --git a/Basic/lib/PDL/PP/PDLCode.pm b/Basic/lib/PDL/PP/PDLCode.pm index 534ce8841..365781a03 100644 --- a/Basic/lib/PDL/PP/PDLCode.pm +++ b/Basic/lib/PDL/PP/PDLCode.pm @@ -111,11 +111,11 @@ sub new { $this->{Code} = (join '',sort values %$sizeprivs). ($dont_add_brcloop?'':join '', map "$_\n", 'if (!$PRIV(broadcast).incs) $CROAK("broadcast.incs NULL");', - 'PDL_COMMENT("broadcastloop declarations")', + '/* broadcastloop declarations */', 'int __brcloopval;', - 'register PDL_Indx __tind0,__tind1; PDL_COMMENT("counters along dim")', + 'register PDL_Indx __tind0,__tind1; /* counters along dim */', 'register PDL_Indx __tnpdls = $PRIV(broadcast).npdls;', - 'PDL_COMMENT("dims here are how many steps along those dims")', + '/* dims here are how many steps along those dims */', (map "register PDL_Indx __tinc0_$parnames->[$_] = PDL_BRC_INC(\$PRIV(broadcast).incs,__tnpdls,$_,0);", 0..$#$parnames), (map "register PDL_Indx __tinc1_$parnames->[$_] = PDL_BRC_INC(\$PRIV(broadcast).incs,__tnpdls,$_,1);", 0..$#$parnames), eol_protect( @@ -416,13 +416,13 @@ sub get_str { EOF return $good_str if !defined(my $bad = $this->[1]); my $str = <get_str($parent,$context) ]} #undef PDL_BAD_CODE #undef PDL_IF_BAD -} else { PDL_COMMENT("** else do 'good' Code **") +} else { /* ** else do 'good' Code ** */ @{[ PDL::PP::indent 2, $good_str ]}} EOF @@ -469,14 +469,14 @@ sub myprelude { my($this,$parent,$context) = @_; $loopend =~ /^-/ ? "(__${loopdim}_size$loopend)" : "PDLMIN($loopend, (__${loopdim}_size))"; } - $text .= "{PDL_COMMENT(\"Open $_\") PDL_EXPAND2(register PDL_Indx $loopvar=$loopstart, $loopstopvar=$loopend); for(; $loopvar$cmp$loopstopvar; $loopvar+=$loopinc) {"; + $text .= "{/* Open $_ */ PDL_EXPAND2(register PDL_Indx $loopvar=$loopstart, $loopstopvar=$loopend); for(; $loopvar$cmp$loopstopvar; $loopvar+=$loopinc) {"; $i; } @{$this->[0]}; $text; } sub mypostlude { my($this,$parent,$context) = @_; splice @$context, - ($#{$this->[0]}+1); - return join '', map "}} PDL_COMMENT(\"Close $_\")", @{$this->[0]}; + return join '', map "}} /* Close $_ */", @{$this->[0]}; } package PDL::PP::GenericSwitch; @@ -509,7 +509,7 @@ sub myprelude { push @{$parent->{Gencurtype}}, undef; # so that $GENERIC can get at it die "ERROR: need to rethink NaN support in GenericSwitch\n" if defined $this->[1] and $parent->{ftypes_type}; - qq[switch ($this->[3]) { PDL_COMMENT("Start generic switch")\n]; + qq[switch ($this->[3]) { /* Start generic switch */\n]; } my @GENTYPE_ATTRS = qw(integer real unsigned); diff --git a/Libtmp/LegacyComplex/complex.pd b/Libtmp/LegacyComplex/complex.pd index 3abe62e2a..395af36cf 100644 --- a/Libtmp/LegacyComplex/complex.pd +++ b/Libtmp/LegacyComplex/complex.pd @@ -765,10 +765,9 @@ pp_def 'Cpow', $GENERIC() ar = $a(m=>0), ai = $a(m=>1); $GENERIC() br = $b(m=>0), bi = $b(m=>1); -PDL_COMMENT(real ndarray (scalar or 1-ndarray)) +/* real ndarray (scalar or 1-ndarray) */ if($PDL(b)->dims[0]==0) bi = 0; -PDL_COMMENT(printf("ar: %f ai: %f\nbr: %f bi: %f\nDimsB: %ld\n",ar,ai,br,bi,$PDL(b)->dims[0]);) double logr, logi, x, y; double s, c;