diff options
Diffstat (limited to 'gs/lib')
-rw-r--r-- | gs/lib/gs_btokn.ps | 3 | ||||
-rw-r--r-- | gs/lib/gs_dps1.ps | 4 | ||||
-rw-r--r-- | gs/lib/gs_dps2.ps | 12 | ||||
-rw-r--r-- | gs/lib/gs_init.ps | 24 | ||||
-rw-r--r-- | gs/lib/gs_lev2.ps | 19 |
5 files changed, 32 insertions, 30 deletions
diff --git a/gs/lib/gs_btokn.ps b/gs/lib/gs_btokn.ps index 4b8a11d18..9bc607ecc 100644 --- a/gs/lib/gs_btokn.ps +++ b/gs/lib/gs_btokn.ps @@ -282,6 +282,7 @@ cntdict /dicttype { (%stdout) (w) file 2 index 2 index writeobject pop pop } odef /writeobject { % <file> <obj> <tag> writeobject - + 2 .argindex pop % check # of args 3 copy exch % We must allocate the array in local VM % to avoid a possible invalidaccess. @@ -293,7 +294,7 @@ cntdict /dicttype { /.objectprinttest { % <obj> .objectprinttest - % This is a pseudo-operator so it will restore the stack % if it gets an error. - mark 0 0 3 index .cntobj cleartomark pop + mark 0 0 3 .argindex .cntobj cleartomark pop } bind odef /.printerror { $error /binary get .languagelevel 2 ge and { diff --git a/gs/lib/gs_dps1.ps b/gs/lib/gs_dps1.ps index 95bde219e..57e01ad9a 100644 --- a/gs/lib/gs_dps1.ps +++ b/gs/lib/gs_dps1.ps @@ -68,13 +68,13 @@ level2dict begin % ------ Fonts ------ % /selectfont % <fontname> <size> selectfont - - { 1 index findfont + { 1 .argindex findfont 1 index dup type /arraytype eq { makefont } { scalefont } ifelse setfont pop pop } odef % undefinefont has to take local/global VM into account. /undefinefont % <fontname> undefinefont - - { .FontDirectory 1 index .undef + { .FontDirectory 1 .argindex .undef .currentglobal { % Current mode is global; delete from local directory too. //systemdict /LocalFontDirectory .knownget diff --git a/gs/lib/gs_dps2.ps b/gs/lib/gs_dps2.ps index 10da01fe2..5b8bdb487 100644 --- a/gs/lib/gs_dps2.ps +++ b/gs/lib/gs_dps2.ps @@ -113,7 +113,7 @@ end /sethalftone { % <dict> sethalftone - % We must create the new dictionary in the same VM as the % operand; otherwise, invalidaccess errors may occur. - .currentglobal 1 index dup gcheck .setglobal + .currentglobal 1 .argindex dup gcheck .setglobal dup //.halftonetypes 1 index /HalftoneType get get exec exec .setglobal pop } odef @@ -179,7 +179,7 @@ end % behavior of Adobe interpreters. /defineuserobject { % <index> <value> defineuserobject - .UserObjects .knownget { - length dup 3 index le { + length dup 3 .argindex le { % Stack: index value len 2 index eq { 1 index 2 mul } { 1 index 1 add } ifelse .localvmarray .UserObjects get @@ -189,15 +189,15 @@ end pop } ifelse } { - .UserObjects 3 index 1 add 10 .max .localvmarray put + .UserObjects 3 .argindex 1 add 10 .max .localvmarray put } ifelse - .UserObjects get 2 index 2 index put pop pop + .UserObjects get 2 .argindex 2 index put pop pop } odef /execuserobject { % <index> execuserobject - - .UserObjects get 1 index get exch pop exec + .UserObjects get 1 .argindex get exch pop exec } odef /undefineuserobject { % <index> undefineuserobject - - .UserObjects get 1 index null put pop + .UserObjects get 1 .argindex null put pop } odef % ------ Cache control ------ % diff --git a/gs/lib/gs_init.ps b/gs/lib/gs_init.ps index fd88b3f86..f54b8b7ff 100644 --- a/gs/lib/gs_init.ps +++ b/gs/lib/gs_init.ps @@ -265,6 +265,7 @@ QUIET not { printgreeting flush } if % Define a special version of def for storing local objects into global % dictionaries. Like .forceput, this exists only during initialization. /.forcedef { % <key> <value> .forcedef - + 1 .argindex pop % check # of args currentdict 3 1 roll .forceput } .bind odef @@ -379,7 +380,7 @@ userdict /#copies 1 put .beginpage } odef /currentmatrix { - .currentmatrix 6 index astore pop + .currentmatrix 6 .argindex astore pop } odef % .currentnumcopies is redefined in Level 2. /.currentnumcopies { #copies } odef @@ -446,7 +447,7 @@ userdict /.echo.mode true put } loop } bind def /filter - { //filterdict 1 index .knownget + { //filterdict 1 .argindex .knownget { exch pop exec } { /filter .systemvar /undefined signalerror } ifelse @@ -515,7 +516,7 @@ userdict /.echo.mode true put } bind def % The following is only for compatibility with Adobe interpreters. /setdash { - 1 index length 11 gt { /setdash .systemvar /limitcheck signalerror } if + 1 .argindex length 11 gt { /setdash .systemvar /limitcheck signalerror } if //setdash } odef /setdevice @@ -569,7 +570,7 @@ odef % should use .internalstopped to avoid setting newerror et al. /.internalstopped { //null 1 .stopped //null ne } bind def /store { % Don't alter operands before completing. - 1 index where { 2 index 2 index put pop pop } { def } ifelse + 1 .argindex where { 2 index 2 index put pop pop } { def } ifelse } odef /.typenames mark .typenames counttomark packedarray exch pop def /type { @@ -582,7 +583,7 @@ currentdict /.typenames .undef /.wheredict 10 dict def /.where /where load def /where { - //.wheredict 1 index .knownget { exec } { .where } ifelse + //.wheredict 1 .argindex .knownget { exec } { .where } ifelse } odef % internaldict is defined in systemdict, but the dictionary is allocated @@ -1953,10 +1954,6 @@ readonly def } .bind executeonly odef /deletefile { - count 1 lt { - //deletefile /stackunderflow signalerror - } - if dup { deletefile } stopped { pop //deletefile $error /errorname get signalerror } { @@ -1975,7 +1972,7 @@ readonly def % the file can be deleted later, even if SAFER is set. /.tempfile { .tempfile % filename file - //SAFETY /tempfiles get 2 index true .forceput + //SAFETY /tempfiles get 2 .argindex true .forceput } .bind executeonly odef % If we are running in SAFER mode, lock things down @@ -2071,7 +2068,8 @@ currentdict /INTERPOLATE known not { (%END INTERPOLATE) .skipeof } if { .currentglobal % w h bit [] {}...{} multi ncomp glob //false .setglobal 9 dict begin % w h bit [] {}...{} multi ncomp glob - 2 index { 1 index 7 add } { 8 } ifelse + 2 .argindex { 1 index 7 add } { 8 } ifelse + dup .argindex pop % check # of arguments copy gsave pop % preserve the arguments { 0 /DeviceGray 0 /DeviceRGB /DeviceCMYK } 1 index get setcolorspace % ... glob w h bit [] {}...{} multi ncomp @@ -2113,7 +2111,8 @@ currentdict /INTERPOLATE known not { (%END INTERPOLATE) .skipeof } if image } { /INTERPOLATE .systemvar - { .currentglobal //false .setglobal + { 4 .argindex pop % check # of args + .currentglobal //false .setglobal 8 dict begin .setglobal /ImageType 1 def /DataSource 1 index def @@ -2139,6 +2138,7 @@ currentdict /INTERPOLATE known not { (%END INTERPOLATE) .skipeof } if .interpolate imagemask } { /INTERPOLATE .systemvar { + 4 .argindex pop % check # of args .currentglobal //false .setglobal 8 dict begin .setglobal /ImageType 1 def diff --git a/gs/lib/gs_lev2.ps b/gs/lib/gs_lev2.ps index 899a8b49c..7d17ed347 100644 --- a/gs/lib/gs_lev2.ps +++ b/gs/lib/gs_lev2.ps @@ -50,7 +50,7 @@ level2dict begin } .bind def /.checksetparams { % <newdict> <opname> <checkdict> % .checksetparams <newdict> - 2 index { + 2 .argindex { % Stack: newdict opname checkdict key newvalue 3 copy 3 1 roll .knownget { exec not { @@ -109,7 +109,7 @@ level2dict begin systemdict begin /psuserparams 48 dict def /getuserparam { % <name> getuserparam <value> - /userparams .systemvar 1 index get exch pop + /userparams .systemvar 1 .argindex get exch pop } odef % Fill in userparams (created by the interpreter) with current values. mark .currentuserparams @@ -179,7 +179,7 @@ currentdict /pssystemparams known not { /pssystemparams 40 dict readonly def } if /getsystemparam { % <name> getsystemparam <value> - //pssystemparams 1 index .knownget { exch pop } { .getsystemparam } ifelse + //pssystemparams 1 .argindex .knownget { exch pop } { .getsystemparam } ifelse } odef end /currentsystemparams { % - currentsystemparams <dict> @@ -188,6 +188,7 @@ end /setsystemparams { % <dict> setsystemparams - % Check that we will be able to set the PostScript-level % system parameters. + dup pop % check # of args /SAFETY .systemvar /safe get { % SAFER mode disallows some changes [ /GenericResourceDir /FontResourceDir /GenericResourcePathSep ] { @@ -234,7 +235,7 @@ end % Redefine cache parameter setting to interact properly with userparams. /setcachelimit { - mark /MaxFontItem 2 index .dicttomark setuserparams pop + mark /MaxFontItem 2 .argindex .dicttomark setuserparams pop } .bind odef /setcacheparams { % The MaxFontCache parameter is a system parameter, which we might @@ -398,7 +399,7 @@ psuserparams /ProcessDSCComment {.checkprocesscomment} put % VMReclaim and VMThreshold are user parameters. /setvmthreshold { % <int> setvmthreshold - - mark /VMThreshold 2 index .dicttomark setuserparams pop + mark /VMThreshold 2 .argindex .dicttomark setuserparams pop } odef /vmreclaim { % <int> vmreclaim - dup 0 gt { @@ -468,7 +469,7 @@ end % serverdict /.startjob { % <exit_bool> <password> <finish_proc> % .startjob <ok_bool> vmstatus pop pop serverdict /.jobsavelevel get eq - 2 index .checkpassword 0 gt and { + 2 .argindex .checkpassword 0 gt and { exch .checkpassword exch count 3 roll count 3 sub { pop } repeat cleardictstack % Reset the e-stack back to the 2 .stopped in .runexec, @@ -660,7 +661,7 @@ currentdict end % ------ Color spaces ------ % -% Move setcolorsapce, setcolor, and colorspacedict to level2dict +% Move setcolorspace, setcolor, and colorspacedict to level2dict level2dict /setcolorspace .cspace_util 1 index get put level2dict /setcolor .cspace_util 1 index get put level2dict /colorspacedict .cspace_util 1 index get put @@ -692,7 +693,7 @@ level2dict /colorspacedict .cspace_util 1 index get put /findcolorrendering { % <intentname> findcolorrendering % <crdname> <found> /ColorRendering /ProcSet findresource - 1 index dup type /nametype eq { .namestring } if (.) concatstrings + 1 .argindex dup type /nametype eq { .namestring } if (.) concatstrings 1 index /GetPageDeviceName get exec dup type /nametype eq { .namestring } if (.) concatstrings 2 index /GetHalftoneName get exec dup type /nametype eq { .namestring } if concatstrings concatstrings @@ -829,7 +830,7 @@ def def /makepattern { % <proto_dict> <matrix> makepattern <pattern> - //.patterntypes 2 index /PatternType get get + //.patterntypes 2 .argindex /PatternType get get .currentglobal false .setglobal exch % Stack: proto matrix global buildproc 3 index dup length 1 add dict .copydict |