OSDN Git Service

makefile of clang.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Tue, 24 Jun 2014 23:07:34 +0000 (07:07 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Tue, 24 Jun 2014 23:07:34 +0000 (07:07 +0800)
16 files changed:
src/texsourc/coerce.h
src/texsourc/itex.c
src/texsourc/local.c
src/texsourc/makefile.clang [new file with mode: 0644]
src/texsourc/tex0.c
src/texsourc/tex2.c
src/texsourc/tex3.c
src/texsourc/tex4.c
src/texsourc/tex5.c
src/texsourc/tex8.c
src/texsourc/tex9.c
src/texsourc/texd.h
src/texsourc/yandy_inlines.c
src/texsourc/yandy_macros.h
src/texsourc/yandytex.c
src/texsourc/yandytex.h

index b305ac0..8f6dcd6 100644 (file)
@@ -228,7 +228,7 @@ void find_font_dimen_(boolean);
 void scan_something_internal_(small_number, boolean);
 #define scan_something_internal(level, negative) scan_something_internal_((small_number) (level), (boolean) (negative))
 void scan_int(void);
-void scan_dimen_(bool, bool, bool);
+void scan_dimen_(boolean, boolean, boolean);
 #define scan_dimen(mu, inf, shortcut) scan_dimen_((boolean) (mu), (boolean) (inf), (boolean) (shortcut))
 void scan_glue_(small_number);
 #define scan_glue(level) scan_glue_((small_number) (level))
@@ -238,7 +238,7 @@ halfword str_toks_(pool_pointer);
 halfword the_toks(void);
 void ins_the_toks(void);
 void conv_toks(void);
-halfword scan_toks_(bool, bool);
+halfword scan_toks_(boolean, boolean);
 #define scan_toks(macrodef, xpand) scan_toks_((boolean) (macrodef), (boolean) (xpand))
 void read_toks_(integer, halfword);
 #define read_toks(n, r) read_toks_((integer) (n), (halfword) (r))
index 1b14367..6a26b7e 100644 (file)
@@ -109,12 +109,12 @@ void initialize (void)
 
     if (flag)
     {
-      puts("Inverted mapping xord[] pairs:\n");
+      puts("Inverted mapping xord[] pairs:");
 
       for (k = 0; k < 256; k++)
       {
         if (xord[k] != 127)
-          printf("%d => %d\n", k, xord[k]);
+          printf("%lld => %d\n", k, xord[k]);
       }
     }
   }
@@ -1495,7 +1495,7 @@ boolean load_fmt_file (void)
 #ifdef ALLOCATEMAIN
 /* we already read this once earlier to grab mem_top */
   if (trace_flag)
-    printf("Read from fmt file mem_top = %d TeX words\n", x);
+    printf("Read from fmt file mem_top = %lld TeX words\n", x);
 
   mem = allocate_main_memory(x); /* allocate main memory at this point */
 
@@ -1539,7 +1539,7 @@ boolean load_fmt_file (void)
     if (x > current_pool_size)
     {
       if (trace_flag)
-        printf("undump string pool reallocation (%d > %d)\n", x, current_pool_size);
+        printf("undump string pool reallocation (%lld > %d)\n", x, current_pool_size);
 
       str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
     }
@@ -1566,7 +1566,7 @@ boolean load_fmt_file (void)
     if (x > current_max_strings)
     {
       if (trace_flag)
-        printf("undump string pointer reallocation (%d > %d)\n", x, current_max_strings);
+        printf("undump string pointer reallocation (%lld > %d)\n", x, current_max_strings);
 
       str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
     }
@@ -1686,7 +1686,7 @@ boolean load_fmt_file (void)
   undump_int(cs_count);
 
   if (trace_flag)
-    printf("itex undump cs_count %d ", cs_count);
+    printf("itex undump cs_count %lld ", cs_count);
 
   {
     undump_int(x); /* font_mem_size */
@@ -1696,12 +1696,12 @@ boolean load_fmt_file (void)
 
 #ifdef ALLOCATEFONT
     if (trace_flag)
-      printf("Read from fmt fmem_ptr = %d\n", x);
+      printf("Read from fmt fmem_ptr = %lld\n", x);
 
     if (x > current_font_mem_size)
     {
       if (trace_flag)
-        printf("Undump realloc font_info (%d > %d)\n", x, current_font_mem_size);
+        printf("Undump realloc font_info (%lld > %d)\n", x, current_font_mem_size);
 
       font_info = realloc_font_info (x - current_font_mem_size + increment_font_mem_size);
     }
@@ -2064,7 +2064,7 @@ void show_frozen (void)
   int i, j, n;
 
   fprintf(log_file, "\n");
-  fprintf(log_file, "(%d fonts frozen in format file:\n", font_ptr);
+  fprintf(log_file, "(%lld fonts frozen in format file:\n", font_ptr);
 
   for (i = 1; i <= font_ptr; i++)
   {
@@ -3451,7 +3451,7 @@ done2:
   cs_count = frozen_control_sequence - 1 - hash_used;
 
   if (trace_flag)
-    printf("itex cs_count %d hash_size %d hash_extra %d hash_used %d",
+    printf("itex cs_count %lld hash_size %d hash_extra %d hash_used %ld",
         cs_count, hash_size, hash_extra, hash_used);
 
   for (p = hash_base; p <= hash_used; p++)
index 7c3adb9..0a72766 100644 (file)
@@ -291,7 +291,7 @@ void read_repl_sub (FILE * repl_input)
     if (*buffer == '%' || *buffer == ';' || *buffer == '\n')
       continue;
 
-    if ((m = sscanf (buffer, "%d%n %s", &chrs, &n, &charname)) == 0)
+    if ((m = sscanf(buffer, "%d%n %s", &chrs, &n, &charname)) == 0)
       continue;
     else if (m == 2)
     {
@@ -557,7 +557,7 @@ void *ourrealloc (void *old, size_t new_size)
   {
     if (trace_flag)
     {
-      sprintf(log_line, "EXPANDED! %d (%d) == %d (%d)\n",
+      sprintf(log_line, "EXPANDED! %p (%d) == %p (%d)\n",
           mnew, new_size, old, old_size);
       show_line(log_line, 0);
     }
@@ -666,7 +666,7 @@ int allocate_tries (int trie_max)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Addresses trie_trl %d trie_tro %d trie_trc %d\n", trie_trl, trie_tro, trie_trc);
+    sprintf(log_line, "Addresses trie_trl %p trie_tro %p trie_trc %p\n", trie_trl, trie_tro, trie_trc);
     show_line(log_line, 0);
   }
 
@@ -725,7 +725,7 @@ int realloc_hyphen (int hyphen_prime)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Addresses hyph_word %d hyph_list %d\n", hyph_word, hyph_list);
+    sprintf(log_line, "Addresses hyph_word %p hyph_list %p\n", hyph_word, hyph_list);
     show_line(log_line, 0);
   }
 
@@ -806,7 +806,7 @@ memory_word *allocate_main_memory (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Address main memory == %d\n", main_memory);
+    sprintf(log_line, "Address main memory == %p\n", main_memory);
     show_line(log_line, 0);
   }
 
@@ -817,7 +817,7 @@ memory_word *allocate_main_memory (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Offset address main memory == %d\n", mem);
+    sprintf(log_line, "Offset address main memory == %p\n", mem);
     show_line(log_line, 0);
   }
 
@@ -864,7 +864,7 @@ memory_word * realloc_main (int lo_size, int hi_size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "main memory", main_memory);
+    sprintf(log_line, "Old Address %s == %p\n", "main memory", main_memory);
     show_line(log_line, 0);
   }
 
@@ -944,7 +944,7 @@ memory_word * realloc_main (int lo_size, int hi_size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "New Address %s == %d\n", "main memory", new_memory);
+    sprintf(log_line, "New Address %s == %p\n", "main memory", new_memory);
     show_line(log_line, 0);
   }
 
@@ -953,7 +953,7 @@ memory_word * realloc_main (int lo_size, int hi_size)
 /*  shift everything upward to make space for new low area */
     if (trace_flag)
     {
-      sprintf(log_line, "memmove %d %d %d \n", new_memory + lo_size,
+      sprintf(log_line, "memmove %p %p %d \n", new_memory + lo_size,
           new_memory, (current_mem_size + 1) * sizeof(memory_word));
       show_line(log_line, 0);
     }
@@ -1005,7 +1005,7 @@ memory_word * realloc_font_info (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n",  "font_info", font_info);
+    sprintf(log_line, "Old Address %s == %p\n",  "font_info", font_info);
     show_line(log_line, 0);
   }
 /*  during initial allocation, font_info == NULL - realloc acts like malloc */
@@ -1060,7 +1060,7 @@ memory_word * realloc_font_info (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "New Address %s == %d\n", "font_info", font_info);
+    sprintf(log_line, "New Address %s == %p\n", "font_info", font_info);
     show_line(log_line, 0);
   }
 
@@ -1086,7 +1086,7 @@ packed_ASCII_code * realloc_str_pool (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "string pool", str_pool);
+    sprintf(log_line, "Old Address %s == %p\n", "string pool", str_pool);
     show_line(log_line, 0);
   }
 
@@ -1140,7 +1140,7 @@ packed_ASCII_code * realloc_str_pool (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "New Address %s == %d\n", "string pool", str_pool);
+    sprintf(log_line, "New Address %s == %p\n", "string pool", str_pool);
     show_line(log_line, 0);
   }
   
@@ -1163,7 +1163,7 @@ pool_pointer *realloc_str_start (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "string start", str_start);
+    sprintf(log_line, "Old Address %s == %p\n", "string start", str_start);
     show_line(log_line, 0);
   }
 
@@ -1217,7 +1217,7 @@ pool_pointer *realloc_str_start (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "New Address %s == %d\n", "string start", str_start);
+    sprintf(log_line, "New Address %s == %p\n", "string start", str_start);
     show_line(log_line, 0);
   }
 
@@ -1263,9 +1263,9 @@ int allocate_ini (int size)
   
   if (trace_flag)
   {
-    sprintf(log_line, "Addresses trie_l %d trie_o %d trie_c %d\n", trie_l, trie_o, trie_c);
+    sprintf(log_line, "Addresses trie_l %p trie_o %p trie_c %p\n", trie_l, trie_o, trie_c);
     show_line(log_line, 0);
-    sprintf(log_line, "Addresses trie_r %d trie_hash %d trie_taken %d\n",
+    sprintf(log_line, "Addresses trie_r %p trie_hash %p trie_taken %p\n",
       trie_r, trie_hash, trie_taken);
     show_line(log_line, 0);
   }
@@ -1295,7 +1295,7 @@ memory_word *realloc_save_stack (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "save stack", save_stack);
+    sprintf(log_line, "Old Address %s == %p\n", "save stack", save_stack);
     show_line(log_line, 0);
   }
 
@@ -1351,7 +1351,7 @@ memory_word *realloc_save_stack (int size)
   {
     sprintf(log_line, "Current %s %d\n", "save_size", current_save_size);
     show_line(log_line, 0);
-    sprintf(log_line, "New Address %s == %d\n", "save stack", save_stack);
+    sprintf(log_line, "New Address %s == %p\n", "save stack", save_stack);
     show_line(log_line, 0);
   }
 
@@ -1373,7 +1373,7 @@ in_state_record *realloc_input_stack (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n",  "input stack", input_stack);
+    sprintf(log_line, "Old Address %s == %p\n",  "input stack", input_stack);
     show_line(log_line, 0);
   }
 
@@ -1429,7 +1429,7 @@ in_state_record *realloc_input_stack (int size)
   {
     sprintf(log_line, "Current %s %d\n", "stack_size", current_stack_size);
     show_line(log_line, 0);
-    sprintf(log_line, "New Address %s == %d\n", "input stack", input_stack);
+    sprintf(log_line, "New Address %s == %p\n", "input stack", input_stack);
     show_line(log_line, 0);
   }
 
@@ -1451,7 +1451,7 @@ list_state_record *realloc_nest_stack (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n",  "nest stack", nest);
+    sprintf(log_line, "Old Address %s == %p\n",  "nest stack", nest);
     show_line(log_line, 0);
   }
 
@@ -1507,7 +1507,7 @@ list_state_record *realloc_nest_stack (int size)
   {
     sprintf(log_line, "Current %s %d\n", "nest_size", current_nest_size);
     show_line(log_line, 0);
-    sprintf(log_line, "New Address %s == %d\n", "nest stack", nest);
+    sprintf(log_line, "New Address %s == %p\n", "nest stack", nest);
     show_line(log_line, 0);
   }
 
@@ -1529,7 +1529,7 @@ halfword *realloc_param_stack (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n",  "param stack", param_stack);
+    sprintf(log_line, "Old Address %s == %p\n",  "param stack", param_stack);
     show_line(log_line, 0);
   }
 
@@ -1585,7 +1585,7 @@ halfword *realloc_param_stack (int size)
   {
     sprintf(log_line, "Current %s %d\n", "param_size", current_param_size);
     show_line(log_line, 0);
-    sprintf(log_line, "New Address %s == %d\n", "param stack", param_stack);
+    sprintf(log_line, "New Address %s == %p\n", "param stack", param_stack);
     show_line(log_line, 0);
   }
 
@@ -1607,7 +1607,7 @@ ASCII_code * realloc_buffer (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "buffer", buffer);
+    sprintf(log_line, "Old Address %s == %p\n", "buffer", buffer);
     show_line(log_line, 0);
   }
 
@@ -1670,7 +1670,7 @@ ASCII_code * realloc_buffer (int size)
   {
     sprintf(log_line, "Current %s %d\n", "buffer", current_buf_size);
     show_line(log_line, 0);
-    sprintf(log_line, "New Address %s == %d\n", "buffer", buffer);
+    sprintf(log_line, "New Address %s == %p\n", "buffer", buffer);
     show_line(log_line, 0);
   }
 
@@ -1828,8 +1828,8 @@ int free_memory (void)
 
   if (trace_flag)
   {
-    printf("Main Memory: variable node %d (%d - %d);\n"
-      "             one word %d (%d - %d)\n",
+    printf("Main Memory: variable node %lld (%lld - %ld);\n"
+      "             one word %ld (%ld - %ld)\n",
       lo_mem_max - mem_min, mem_min, lo_mem_max,
       mem_end - hi_mem_min, hi_mem_min, mem_end);
   }
@@ -3288,7 +3288,7 @@ void print_cs_name (FILE *output, int h)
     if (output == stdout)
       show_line(log_line, 0);
     else
-      fprintf(output, log_line);
+      fprintf(output, "%s", log_line);
   }
 
 }
@@ -3366,7 +3366,7 @@ void print_cs_names (FILE *output, int pass)
     if (output == stdout)
       show_line(log_line, 0);
     else
-      fprintf(output, log_line);
+      fprintf(output, "%s", log_line);
   }
 
   if (ccount > 0)
@@ -3412,7 +3412,7 @@ void print_cs_names (FILE *output, int pass)
       if (output == stdout)
         show_line(log_line, 0);
       else
-        fprintf(output, log_line);
+        fprintf(output, "%s", log_line);
     }
 
     free((void *)cnumtable);
diff --git a/src/texsourc/makefile.clang b/src/texsourc/makefile.clang
new file mode 100644 (file)
index 0000000..9e97df4
--- /dev/null
@@ -0,0 +1,99 @@
+# Copyright 2007 TeX Users Group.
+# Copyright 2014 Clerk Ma.
+#
+# You may freely use, modify and/or distribute this file.
+
+# Makefile for Y&YTeX
+
+CC = clang-cl
+LINK = link
+RC = rc
+
+CFLAGS=/nologo /c /MT /GF /Ox /W4 /DMSDOS /DTeX \
+       /I"kpathsea" /I"zlib" /I"libmd5" /D_CRT_SECURE_NO_WARNINGS \
+       -Wno-char-subscripts -Wno-dangling-else \
+       -Wno-deprecated-declarations
+
+LFLAGS=/NOLOGO /MAP
+
+objs = yandytex.obj itex.obj openinou.obj subroute.obj local.obj \
+       tex0.obj tex1.obj tex2.obj tex3.obj tex4.obj \
+       tex5.obj tex6.obj tex7.obj tex8.obj tex9.obj \
+       yandy_pool.obj yandytex.res md5.obj yandy_inlines.obj
+
+yandytex.exe: $(objs)
+       $(LINK) $(LFLAGS) yandytex itex openinou subroute local \
+       tex0 tex1 tex2 tex3 tex4 tex5 tex6 tex7 tex8 tex9 \
+       yandy_pool yandytex.res md5 yandy_inlines \
+       kpathsea\kpathsea.lib zlib\zlib.lib
+       del ..\yandy\bin\yandytex.exe
+       copy yandytex.exe ..\yandy\bin\yandytex.exe
+
+md5.obj: libmd5\md5.c
+       $(CC) -Ilibmd5 $(CFLAGS) libmd5\md5.c
+
+yandytex.res: yandytex.rc
+       rc /nologo yandytex.rc
+
+yandytex.obj: yandytex.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+       $(CC) /DINITEX $(CFLAGS) yandytex.c
+
+itex.obj: itex.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+       $(CC) /DINITEX $(CFLAGS) itex.c
+
+openinou.obj: openinou.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+       $(CC) $(CFLAGS) openinou.c
+
+subroute.obj: subroute.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+       $(CC) $(CFLAGS) subroute.c
+
+local.obj: local.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+       $(CC) /DINITEX $(CFLAGS) local.c
+
+tex0.obj: tex0.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex1.obj: tex1.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex2.obj: tex2.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex3.obj: tex3.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex4.obj: tex4.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex5.obj: tex5.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex6.obj: tex6.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex7.obj: tex7.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex8.obj: tex8.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+tex9.obj: tex9.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+yandy_pool.obj: yandy_pool.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+yandy_inlines.obj: yandy_inlines.c \
+       texd.h texmf.h texmfmem.h coerce.h yandy_macros.h
+
+.SUFFIXES:
+.SUFFIXES: .obj .c
+
+c..obj:
+       $(CC) $(CFLAGS) $*.c
+
index b751321..ac06fa0 100644 (file)
@@ -151,54 +151,54 @@ void print_ (integer s)
           return;
         }
 
-        if ((s == new_line_char))
+        if (s == new_line_char)
           if (selector < pseudo)
           {
             print_ln();
             return;
           }
           
-          nl = new_line_char;
-          new_line_char = -1;
+        nl = new_line_char;
+        new_line_char = -1;
           
-          /* translate ansi to dos 850 */
-          if (!show_in_hex && s < 256 && s >= 32)
+        /* translate ansi to dos 850 */
+        if (!show_in_hex && s < 256 && s >= 32)
+        {
+          if (show_in_dos && s > 127)
           {
-            if (show_in_dos && s > 127)
+            if (wintodos[s - 128] > 0)
             {
-              if (wintodos[s - 128] > 0)
-              {
-                print_char(wintodos[s - 128]);
-              }
-              else
-              {
-                j = str_start[s];
-
-                while (j < str_start[s + 1])
-                {
-                  print_char(str_pool[j]);
-                  incr(j);
-                }
-              }
+              print_char(wintodos[s - 128]);
             }
             else
             {
-              print_char(s);       /* don't translate to hex */
+              j = str_start[s];
+
+              while (j < str_start[s + 1])
+              {
+                print_char(str_pool[j]);
+                incr(j);
+              }
             }
           }
           else
-          {                       /* not just a character */
-            j = str_start[s];
+          {
+            print_char(s);       /* don't translate to hex */
+          }
+        }
+        else
+        {                       /* not just a character */
+          j = str_start[s];
 
-            while (j < str_start[s + 1])
-            {
-              print_char(str_pool[j]);
-              incr(j);
-            }
+          while (j < str_start[s + 1])
+          {
+            print_char(str_pool[j]);
+            incr(j);
           }
+        }
 
-          new_line_char = nl; /* restore eol */
-          return;
+        new_line_char = nl; /* restore eol */
+        return;
       }
     }
   }
@@ -1422,7 +1422,7 @@ restart:
     {
       q = p + node_size(p);
 
-      while ((mem[q].hh.rh == empty_flag))
+      while (is_empty(q))
       {
         t = rlink(q);
 
@@ -1513,7 +1513,7 @@ restart:
   {
     if (trace_flag)
     {
-      sprintf(log_line, "mem_min %d, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
+      sprintf(log_line, "mem_min %lld, mem_start %ld, block_size %d\n", mem_min, mem_start, block_size);
       show_line(log_line, 0);
     }
 
@@ -1985,7 +1985,7 @@ void print_mark_ (integer p)
 /* sec 0176 */
 void print_rule_dimen(scaled d)
 {
-  if ((d == -1073741824L)) /* - 2^30 */
+  if (is_running(d))
     print_char('*');
   else
     print_scaled(d);
index 91f0697..02e116a 100644 (file)
@@ -221,7 +221,7 @@ void show_context (void)
         if (state != token_list)
         {
           if (name <= 17)
-            if ((name == 0))
+            if (name == 0)
               if (base_ptr == 0)
                 print_nl("<*>");
               else
index 3ba22ad..c3a13ef 100644 (file)
@@ -1556,7 +1556,7 @@ void pack_file_name_(str_number n, str_number a, str_number e)
 
     if (trace_flag)
     {
-      sprintf(log_line, " pack_file_name `%s' (%d) ", name_of_file + 1, name_length); /* debugging */
+      sprintf(log_line, " pack_file_name `%s' (%lld) ", name_of_file + 1, name_length); /* debugging */
       show_line(log_line, 0);
     }
 
@@ -1724,7 +1724,8 @@ void prompt_file_name_(char * s, str_number e)
 {
   integer k;
 
-  if (interaction == scroll_mode);
+  if (interaction == scroll_mode)
+    do_nothing();
 
   if (!strcmp("input file name", s))
     print_err("I can't find file `");
@@ -2102,7 +2103,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire
   {
     if (trace_flag)
     {
-      sprintf(log_line, "font_ptr %d font_max %d fmem_ptr %d lf %d font_mem_size %d\n",
+      sprintf(log_line, "font_ptr %lld font_max %d fmem_ptr %lld lf %ld font_mem_size %ld\n",
           font_ptr, font_max, fmem_ptr, lf, font_mem_size);
       show_line(log_line, 0);
     }
index cede894..fd217d5 100644 (file)
@@ -98,7 +98,7 @@ void dvi_swap (void)
   if (trace_flag)
   {
     show_char('\n');
-    sprintf(log_line, "dvi_swap() %d", dvi_gone);
+    sprintf(log_line, "dvi_swap() %lld", dvi_gone);
     show_line(log_line, 0);
   }
 
index e4c2c33..606d0da 100644 (file)
@@ -1789,13 +1789,13 @@ void fin_align (void)
       }
       else if (type(q) == rule_node)
       {
-        if ((width(q) == -1073741824L))  /* 2^30  */
+        if (is_running(width(q)))
           width(q) = width(p);
 
-        if ((height(q) == -1073741824L))  /* 2^30  */
+        if (is_running(height(q)))
           height(q) = height(p);
 
-        if ((depth(q) == -1073741824L))  /* 2^30  */
+        if (is_running(depth(q)))
           depth(q) = depth(p);
 
         if (o != 0)
index f499c39..45fda26 100644 (file)
@@ -512,8 +512,8 @@ void do_register_command_ (small_number a)
 found:
   if (q == tex_register)
     scan_optional_equals();
-  else
-    if (scan_keyword("by"));
+  else if (scan_keyword("by"))
+    do_nothing();
 
   arith_error = false;
 
@@ -835,7 +835,7 @@ void new_font_(small_number a)
           {
             if (trace_flag)
             {
-              sprintf(log_line, "SKIPPING %ld ", s);
+              sprintf(log_line, "SKIPPING %lld ", s);
               show_line(log_line, 0);
             }
             goto common_ending;
@@ -848,7 +848,7 @@ void new_font_(small_number a)
         {
           if (trace_flag)
           {
-            sprintf(log_line, "SKIPPING %ld ", s);
+            sprintf(log_line, "SKIPPING %lld ", s);
             show_line(log_line, 0);
           }
           goto common_ending;
@@ -865,7 +865,7 @@ void new_font_(small_number a)
 common_ending:
   if (trace_flag)
   {
-    sprintf(log_line, "NEW FONT %d ", f);
+    sprintf(log_line, "NEW FONT %lld ", f);
     show_line(log_line, 0);
   }
 
index 0307663..6a6e87a 100644 (file)
@@ -130,44 +130,44 @@ void close_files_and_terminate (void)
       fprintf(log_file, "%c\n", ' ');
       fprintf(log_file, "\n");
       fprintf(log_file, "%s%s\n", "Here is how much of TeX's memory", " you used:");
-      fprintf(log_file, "%c%ld%s", ' ', (int)(str_ptr - init_str_ptr), " string");
+      fprintf(log_file, "%c%lld%s", ' ', (integer)(str_ptr - init_str_ptr), " string");
 
       if (str_ptr != init_str_ptr + 1)
         putc('s',  log_file);
 
 #ifdef ALLOCATESTRING
       if (show_current)
-        fprintf(log_file, "%s%ld\n", " out of ", (int)(current_max_strings - init_str_ptr));
+        fprintf(log_file, "%s%d\n", " out of ", (int)(current_max_strings - init_str_ptr));
       else
 #endif
-        fprintf(log_file, "%s%ld\n", " out of ", (int)(max_strings - init_str_ptr));
+        fprintf(log_file, "%s%d\n", " out of ", (int)(max_strings - init_str_ptr));
 
 #ifdef ALLOCATESTRING
       if (show_current)
-        fprintf(log_file, "%c%ld%s%ld\n", ' ', (int)(pool_ptr - init_pool_ptr), " string characters out of ", current_pool_size - init_pool_ptr);
+        fprintf(log_file, "%c%lld%s%lld\n", ' ', (integer)(pool_ptr - init_pool_ptr), " string characters out of ", current_pool_size - init_pool_ptr);
       else
 #endif
-        fprintf(log_file, "%c%ld%s%ld\n", ' ', (int)(pool_ptr - init_pool_ptr), " string characters out of ", pool_size - init_pool_ptr);
+        fprintf(log_file, "%c%lld%s%lld\n", ' ', (integer)(pool_ptr - init_pool_ptr), " string characters out of ", pool_size - init_pool_ptr);
 
 #ifdef ALLOCATEMAIN
       if (show_current)
-        fprintf(log_file, "%c%ld%s%ld\n", ' ', (int)(lo_mem_max - mem_min + mem_end - hi_mem_min + 2), " words of memory out of ", current_mem_size);
+        fprintf(log_file, "%c%lld%s%d\n", ' ', (integer)(lo_mem_max - mem_min + mem_end - hi_mem_min + 2), " words of memory out of ", current_mem_size);
       else
 #endif
-        fprintf(log_file, "%c%ld%s%ld\n", ' ', (int)(lo_mem_max - mem_min + mem_end - hi_mem_min + 2), " words of memory out of ", mem_end + 1 - mem_min);
+        fprintf(log_file, "%c%lld%s%lld\n", ' ', (integer)(lo_mem_max - mem_min + mem_end - hi_mem_min + 2), " words of memory out of ", mem_end + 1 - mem_min);
 
-      fprintf(log_file, "%c%ld%s%ld\n", ' ', (int)(cs_count), " multiletter control sequences out of ", (hash_size + hash_extra));
-      fprintf(log_file, "%c%ld%s%ld%s", ' ', (int)(fmem_ptr), " words of font info for ", (int)(font_ptr - font_base), " font");
+      fprintf(log_file, "%c%lld%s%d\n", ' ', (cs_count), " multiletter control sequences out of ", (hash_size + hash_extra));
+      fprintf(log_file, "%c%lld%s%lld%s", ' ', (fmem_ptr), " words of font info for ", (font_ptr - font_base), " font");
 
       if (font_ptr != 1)
         putc('s',  log_file);
 
 #ifdef ALLOCATEFONT
       if (show_current)
-        fprintf(log_file, "%s%ld%s%ld\n", ", out of ", current_font_mem_size, " for ", font_max - font_base);
+        fprintf(log_file, "%s%d%s%d\n", ", out of ", current_font_mem_size, " for ", font_max - font_base);
       else
 #endif
-        fprintf(log_file, "%s%ld%s%ld\n", ", out of ", font_mem_size, " for ", font_max - font_base);
+        fprintf(log_file, "%s%d%s%d\n", ", out of ", font_mem_size, " for ", font_max - font_base);
 
       fprintf(log_file, "%c%ld%s", ' ', hyph_count, " hyphenation exception");
 
@@ -224,7 +224,7 @@ void close_files_and_terminate (void)
         fprintf(log_file, " (i = in_stack, n = nest_stack, p = param_stack, b = buf_stack, s = save_stack)\n");
 
       if (!knuth_flag)
-        fprintf(log_file, " %d inputs open max out of %ld\n", high_in_open, max_in_open);
+        fprintf(log_file, " %lld inputs open max out of %d\n", high_in_open, max_in_open);
 
       if (show_line_break_stats && first_pass_count > 0)
       {
@@ -244,10 +244,10 @@ void close_files_and_terminate (void)
         third_count = final_pass_count - paragraph_failed;
 
         if (first_pass_count > 0)
-          fprintf(log_file, "\n %d first pass (\\pretolerance = %d)", first_pass_count, pretolerance);
+          fprintf(log_file, "\n %d first pass (\\pretolerance = %lld)", first_pass_count, pretolerance);
 
         if (second_pass_count > 0)
-          fprintf(log_file, "\n %d second pass (\\tolerance = %d)", second_pass_count, tolerance);
+          fprintf(log_file, "\n %d second pass (\\tolerance = %lld)", second_pass_count, tolerance);
 
         if (final_pass_count > 0 || emergency_stretch > 0)
         {
@@ -311,13 +311,13 @@ void close_files_and_terminate (void)
           dvi_out(max_push / 256);
           dvi_out(max_push % 256);
 
-          if (total_pages >= 65536)    // 99/Oct/10 dvi_t 16 bit problem
+          if (total_pages >= 65536)
           {
-            sprintf(log_line, "\nWARNING: page count (dvi_t) in DVI file will be %ld not %ld\n",
+            sprintf(log_line, "\nWARNING: page count (dvi_t) in DVI file will be %lld not %lld\n",
               (total_pages % 65536), total_pages);
 
             if (log_opened)
-              (void) fputs (log_line, log_file);
+              fputs(log_line, log_file);
 
             show_line(log_line, 1);
           }
@@ -325,8 +325,8 @@ void close_files_and_terminate (void)
           dvi_out((total_pages / 256) % 256);
           dvi_out(total_pages % 256);
 
-          if (show_fonts_used && log_opened)     /* 97/Dec/24 */
-            show_font_info();           // now in local.c
+          if (show_fonts_used && log_opened)
+            show_font_info();
 
           while (font_ptr > 0)
           {
@@ -347,9 +347,9 @@ void close_files_and_terminate (void)
             decr(k);
           }
 
-          if (trace_flag) /* 93/Dec/28 - bkph */
+          if (trace_flag)
           {
-            sprintf(log_line, "\ndviwrite %d", dvi_gone);
+            sprintf(log_line, "\ndviwrite %lld", dvi_gone);
             show_line(log_line, 0);
           }
 
index a906e45..fcda6ab 100644 (file)
@@ -847,6 +847,7 @@ char *unixify (char *);
 #include "coerce.h"
 
 /* sec 79 */
+extern inline void do_nothing(void);
 extern inline void update_terminal(void);
 extern inline void check_full_save_stack(void);
 extern inline void push_input(void);
index 8999fea..490bfd3 100644 (file)
 
 #include "texd.h"
 
+inline void do_nothing(void)
+{
+  if (trace_flag)
+    printf("DO_NOTHING.\n");
+}
+
 inline void update_terminal(void)
 {
 #ifndef _WINDOWS
@@ -115,9 +121,10 @@ inline void append_lc_hex (ASCII_code c)
 /* sec 0073 */
 inline void print_err (const char * s)
 {
-  if (interaction == error_stop_mode);
-    print_nl("! ");
-
+  if (interaction == error_stop_mode)
+    do_nothing();
+  
+  print_nl("! ");
   prints(s);
 }
 /* sec 0079 */
index b363306..95ce9c7 100644 (file)
@@ -116,7 +116,7 @@ while (0)
 #endif
 /* sec 0124 */
 #define empty_flag  max_halfword
-#define is_empty(a) (link(a) = empty_flag)
+#define is_empty(a) (link(a) == empty_flag)
 #define node_size   info
 #define llink(a)    info(a+1)
 #define rlink(a)    link(a+1)
index f4913f7..12e06d9 100644 (file)
@@ -25,7 +25,6 @@
 #define edit_value          tex_edit_value
 
 extern char * replacement[];
-static char * program_name = NULL;
 int    gargc;   /* number of args - set to zero after initialization */
 char **gargv;
 
@@ -141,7 +140,7 @@ void fix_date_and_time (void)
   (void) time(&clock);
 
   if (trace_flag)
-    printf("The time is %u\n", clock);
+    printf("The time is %lld\n", clock);
 
   if (clock < 0)
     puts("Time not available!");
@@ -150,7 +149,7 @@ void fix_date_and_time (void)
 
   if (tmptr == NULL)
   {
-    printf("Cannot convert time (%0ld)!\n", clock);
+    printf("Cannot convert time (%0lld)!\n", clock);
     year     = 2038;
     month    = 1;
     day      = 18;
@@ -559,7 +558,7 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
             uexit(EXIT_FAILURE); 
           }
 
-          (void) sprintf (s, "%d", linenumber);
+          (void) sprintf (s, "%lld", linenumber);
 
           while (*s != '\0')
             s++;
index 29f141e..5549167 100644 (file)
@@ -76,7 +76,6 @@ typedef char small_number;
 
 typedef enum
 {
-  NO_FILE_PATH = -1,
   TEXFORMATPATH,
   TEXINPUTPATH,
   TFMFILEPATH,