dvitomp fix from Akira master trunk
authorTaco Hoekwater <taco@metatex.org>
Sun, 27 Jul 2008 13:18:11 +0000 (13:18 +0000)
committerTaco Hoekwater <taco@metatex.org>
Sun, 27 Jul 2008 13:18:11 +0000 (13:18 +0000)
git-svn-id: svn+ssh://scm.foundry.supelec.fr/svn/metapost/mplib/trunk@651 b0617d17-b707-0410-b22c-fd2634e05cc4

src/texk/web2c/mpdir/mpxout.w

index caf4915..00c73a4 100644 (file)
@@ -649,7 +649,9 @@ input file.  Since \MP\ expects such files to have the extension \.{.MPX},
 the output of \.{DVItoMP} is sometimes called an ``\.{MPX}'' file.\r
 \r
 @ The following parameters can be changed at compile time to extend or\r
 the output of \.{DVItoMP} is sometimes called an ``\.{MPX}'' file.\r
 \r
 @ The following parameters can be changed at compile time to extend or\r
-reduce \.{DVItoMP}'s capacity.\r
+reduce \.{DVItoMP}'s capacity. \r
+\r
+TODO: dynamic reallocation\r
 \r
 @d virtual_space 1000000 /* maximum total bytes of typesetting commands for virtual fonts */\r
 @d max_fonts 1000 /* maximum number of distinct fonts per \.{DVI} file */\r
 \r
 @d virtual_space 1000000 /* maximum total bytes of typesetting commands for virtual fonts */\r
 @d max_fonts 1000 /* maximum number of distinct fonts per \.{DVI} file */\r
@@ -1275,8 +1277,8 @@ static void mpx_in_VF (MPX mpx, integer f) {
   @<Start reading the preamble from a \.{VF} file@>;@/\r
   @<Initialize the data structures for the virtual font@>;@/\r
   p=mpx_get_byte(mpx);\r
   @<Start reading the preamble from a \.{VF} file@>;@/\r
   @<Initialize the data structures for the virtual font@>;@/\r
   p=mpx_get_byte(mpx);\r
-  while ( mpx->p>=fnt_def1 ) { \r
-    if ( mpx->p>fnt_def1+3 ) \r
+  while ( p>=fnt_def1 ) { \r
+    if ( p>fnt_def1+3 ) \r
       font_abort("Bad VF file for ",f);\r
     mpx_define_font(mpx, mpx_first_par(mpx, p));\r
     p=mpx_get_byte(mpx);\r
       font_abort("Bad VF file for ",f);\r
     mpx_define_font(mpx, mpx_first_par(mpx, p));\r
     p=mpx_get_byte(mpx);\r
@@ -1288,7 +1290,7 @@ static void mpx_in_VF (MPX mpx, integer f) {
     @<Store the character packet in |cmd_buf|@>;\r
     p=mpx_get_byte(mpx);\r
   }\r
     @<Store the character packet in |cmd_buf|@>;\r
     p=mpx_get_byte(mpx);\r
   }\r
-  if ( mpx->p==post ) { \r
+  if ( p==post ) { \r
     @<Finish setting up the data structures for the new virtual font@>;\r
     mpx->vf_reading=was_vf_reading;\r
     return;\r
     @<Finish setting up the data structures for the new virtual font@>;\r
     mpx->vf_reading=was_vf_reading;\r
     return;\r
@@ -1984,9 +1986,6 @@ case bop:
 @.bop occurred before eop@>\r
   break;\r
 case eop: \r
 @.bop occurred before eop@>\r
   break;\r
 case eop: \r
-  if ( mpx->stk_siz!=0 )\r
-    bad_dvi("stack not empty at end of page");\r
-@.stack not empty...@>\r
   return;\r
   break;\r
 case push: \r
   return;\r
   break;\r
 case push: \r
@@ -2044,6 +2043,9 @@ static int mpx_dvitomp (MPX mpx, char *dviname) {
     @<Do initialization required before starting a new page@>;\r
     mpx_start_picture(mpx);\r
     mpx_do_dvi_commands(mpx);\r
     @<Do initialization required before starting a new page@>;\r
     mpx_start_picture(mpx);\r
     mpx_do_dvi_commands(mpx);\r
+    if ( mpx->stk_siz!=0 )\r
+      bad_dvi("stack not empty at end of page");\r
+@.stack not empty...@>\r
     mpx_stop_picture(mpx);\r
     fprintf(mpx->mpxfile,"mpxbreak\n");\r
   }\r
     mpx_stop_picture(mpx);\r
     fprintf(mpx->mpxfile,"mpxbreak\n");\r
   }\r