Skip to content

Commit 4cf711a

Browse files
committed
Add missing debug guards
1 parent 6d778b7 commit 4cf711a

18 files changed

Lines changed: 60 additions & 22 deletions

src/azteccode.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,9 @@ begin
734734
} loop
735735
/cws cws 0 c getinterval def
736736

737-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
737+
options /debugcws known
738+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
739+
and { /bwipp.debugcws cws //raiseerror exec } if
738740

739741
%
740742
% Reed-Solomon algorithm

src/codablockf.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,9 @@ begin
585585
rcws rcws length 1 sub csum 103 mod put
586586
} for
587587

588-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
588+
options /debugcws known
589+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
590+
and { /bwipp.debugcws cws //raiseerror exec } if
589591

590592
%
591593
% Derive the bits for each row

src/code128.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,9 @@ begin
706706
cws j csum put
707707
cws j 1 add 106 put % stp
708708

709-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
709+
options /debugcws known
710+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
711+
and { /bwipp.debugcws cws //raiseerror exec } if
710712

711713
%
712714
% Derive space bar succession

src/code16k.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,9 @@ begin
776776
c1 dcws 2 add mul add 107 mod /c2 exch def
777777
/cws [ cws aload pop c1 c2 ] def
778778

779-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
779+
options /debugcws known
780+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
781+
and { /bwipp.debugcws cws //raiseerror exec } if
780782

781783
sam -1 eq sam 10 idiv 2 mod 1 eq or {
782784
/stopencs //code16k.stopencsodd def

src/code49.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,9 @@ dup [ exch 16 exch 1 32 getinterval aload pop ] /code49.weighty exch readonly de
11261126
ccs ccs length 8 sub 7 getinterval 0 exch {add} forall 49 mod
11271127
ccs ccs length 1 sub 3 -1 roll put
11281128

1129-
options /debugcws known { /bwipp.debugcws ccs //raiseerror exec } if
1129+
options /debugcws known
1130+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
1131+
and { /bwipp.debugcws ccs //raiseerror exec } if
11301132

11311133
%
11321134
% Derive the bits for each row

src/codeone.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ begin
890890
/cws [ dcws cws length sub {0} repeat cws aload pop ] def
891891
} ifelse
892892

893-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
893+
options /debugcws known
894+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
895+
and { /bwipp.debugcws cws //raiseerror exec } if
894896

895897
%
896898
% De-interleave the codewords into blocks

src/datamatrix.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,9 @@ begin
826826
} for
827827
} if
828828

829-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
829+
options /debugcws known
830+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
831+
and { /bwipp.debugcws cws //raiseerror exec } if
830832

831833
%
832834
% Lookup symbol metrics based on number of codewords and user specification

src/dotcode.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,9 @@ begin
843843
] def
844844
} if
845845

846-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
846+
options /debugcws known
847+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
848+
and { /bwipp.debugcws cws //raiseerror exec } if
847849

848850
%
849851
% Check that the codewords will fit in the symbol

src/hanxin.ps.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,9 @@ begin
743743
/cws pad def
744744
} if
745745

746-
options /debugcws known { /bwipp.debugcws cws //raiseerror exec } if
746+
options /debugcws known
747+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
748+
and { /bwipp.debugcws cws //raiseerror exec } if
747749

748750
%
749751
% Create the bitmap

src/jabcode.ps.src

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ begin
407407
(11) addtobits % EOM
408408

409409
% TODO Cascade
410-
options /debugbits known {
411-
/bwipp.debugbits [ bits {48 sub} forall ] //raiseerror exec
412-
} if
410+
options /debugbits known
411+
/uk.co.terryburton.bwipp.global_ctx dup where {exch get /enabledebug known} {pop false} ifelse
412+
and { /bwipp.debugbits [ bits {48 sub} forall ] //raiseerror exec } if
413413

414414
/diffside 21 def
415415
/sameshape false def

0 commit comments

Comments
 (0)