OSDN Git Service

removed a strcat bug (via want_version).
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Sat, 5 Jul 2014 11:57:40 +0000 (19:57 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Sat, 5 Jul 2014 11:57:40 +0000 (19:57 +0800)
src/texsourc/Makefile.gcc
src/texsourc/local.c
src/texsourc/makefile
src/texsourc/tex3.c
src/texsourc/tex9.c
src/texsourc/texd.h
src/texsourc/yandy_inlines.c

index a3a653c..2175d59 100644 (file)
@@ -3,16 +3,14 @@
 #
 # You may freely use, modify and/or distribute this file.
 #
-# makefle for linux (tested in ubuntu 14.04).
+# makefle for linux (tested in ubuntu 14.04: gcc/clang).
 #
 # apt-get install libkpathsea6 libkpathsea-dev
-# apt-get install libhpdf-2.2.1 libhpdf-dev
-# apt-get install libpng12-0 libpng12-dev
 # apt-get install zlib1g zlib1g-dev
 #
 
 CC = gcc
-CFLAGS = -DMSDOS -DTeX -DINITEX -DINI -Ilibmd5
+CFLAGS = -O2 -DMSDOS -DTeX -DINITEX -DINI -Ilibmd5
 LDFLAGS = -lkpathsea -lz
 
 objects = yandytex.o itex.o openinou.o subroute.o local.o \
index 3f230b7..018f563 100644 (file)
@@ -2412,7 +2412,6 @@ int analyze_flag (int c, char *optarg)
   switch (c)
   {
     case 'v':
-      want_version = true;
       verbose_flag = true;
       break;
     case 'i':
@@ -2770,7 +2769,6 @@ int init_commands (int ac, char **av)
   reset_exceptions      = false;
   non_ascii             = false;
   key_replace           = false;
-  want_version          = false;
   open_trace_flag       = false;
   trace_flag            = false;
   verbose_flag          = false;
@@ -2822,18 +2820,6 @@ int init_commands (int ac, char **av)
   if (optind == 0)
     optind = ac;
 
-/*
-  if (want_version)
-  {
-    stamp_it(log_line);
-    strcat(log_line, "\n");
-    show_line(log_line, 0);
-    stampcopy(log_line);
-    strcat(log_line, "\n");
-    show_line(log_line, 0);
-  }
-*/
-
   return 0;
 }
 
@@ -3255,7 +3241,7 @@ int endit(int flag)
     if (total_pages > 0)
     {
       show_inter_val((finish_time - main_time) / total_pages);
-      printf(" sec per page.");
+      printf(" sec per page.\n");
     }
   }
 
@@ -3634,4 +3620,4 @@ void show_font_info (void)
   }
 
   free((void *)fnumtable);
-}
\ No newline at end of file
+}
index 6601596..3c7d2bf 100644 (file)
@@ -23,7 +23,7 @@ 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 libpng\libpng.lib zlib\zlib.lib \
+       kpathsea\kpathsea.lib zlib\zlib.lib \
        dvipdfmx\libdvipdfmx.lib
        del ..\yandy\bin\yandytex.exe
        copy yandytex.exe ..\yandy\bin\yandytex.exe
index 1db8023..ea299ff 100644 (file)
@@ -1826,16 +1826,6 @@ void open_log_file (void)
   log_opened = true;
 
   {
-    if (want_version)
-    {
-      stamp_it(log_line);
-      strcat(log_line, "\n");
-      (void) fputs(log_line, log_file);
-      stampcopy(log_line);
-      strcat(log_line, "\n");
-      (void) fputs(log_line, log_file);
-    }
-    
     fprintf(log_file, "%s (%s %s)", tex_version, application, yandyversion);
 
     if (format_ident > 0)
index ccd69e3..97fb25e 100644 (file)
@@ -167,56 +167,56 @@ void close_files_and_terminate (void)
         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%d%s%d\n", ", out of ", font_mem_size, " for ", font_max - font_base);
+        fprintf(log_file, "%s%lu%s%d\n", ", out of ", font_mem_size, " for ", font_max - font_base);
 
-      fprintf(log_file, "%c%ld%s", ' ', hyph_count, " hyphenation exception");
+      fprintf(log_file, "%c%d%s", ' ', hyph_count, " hyphenation exception");
 
       if (hyph_count != 1)
         putc('s',  log_file);
 
-      fprintf(log_file, "%s%ld\n",  " out of ", hyphen_prime);
+      fprintf(log_file, "%s%lld\n",  " out of ", hyphen_prime);
       fprintf(log_file, " ");
-      fprintf(log_file, "%ld%s", (int)max_in_stack, "i,");
-      fprintf(log_file, "%ld%s", (int)max_nest_stack, "n,");
-      fprintf(log_file, "%ld%s", (int)max_param_stack, "p,");
-      fprintf(log_file, "%ld%s", (int)max_buf_stack + 1, "b,");
-      fprintf(log_file, "%ld%s", (int)max_save_stack + 6, "s");
+      fprintf(log_file, "%d%s", (int) max_in_stack, "i,");
+      fprintf(log_file, "%d%s", (int) max_nest_stack, "n,");
+      fprintf(log_file, "%d%s", (int) max_param_stack, "p,");
+      fprintf(log_file, "%d%s", (int) max_buf_stack + 1, "b,");
+      fprintf(log_file, "%d%s", (int) max_save_stack + 6, "s");
       fprintf(log_file, " stack positions out of ");
 
 #ifdef ALLOCATESAVESTACK
       if (show_current)
-        fprintf(log_file, "%ld%s", current_stack_size, "i,");
+        fprintf(log_file, "%d%s", current_stack_size, "i,");
       else
 #endif
-        fprintf(log_file, "%ld%s", stack_size, "i,");
+        fprintf(log_file, "%d%s", stack_size, "i,");
 
 #ifdef ALLOCATENESTSTACK
       if (show_current)
-        fprintf(log_file, "%ld%s", current_nest_size, "n,");
+        fprintf(log_file, "%d%s", current_nest_size, "n,");
       else
 #endif
-        fprintf(log_file, "%ld%s", nest_size, "n,");
+        fprintf(log_file, "%d%s", nest_size, "n,");
 
 #ifdef ALLOCATEPARAMSTACK
       if (show_current)
-        fprintf(log_file, "%ld%s", current_param_size, "p,");
+        fprintf(log_file, "%d%s", current_param_size, "p,");
       else
 #endif
-        fprintf(log_file, "%ld%s", param_size, "p,");
+        fprintf(log_file, "%d%s", param_size, "p,");
 
 #ifdef ALLOCATEBUFFER
       if (show_current)
-        fprintf(log_file, "%ld%s", current_buf_size, "b,");
+        fprintf(log_file, "%d%s", current_buf_size, "b,");
       else
 #endif
         fprintf(log_file, "%ld%s", buf_size, "b,");
 
 #ifdef ALLOCATESAVESTACK
       if (show_current)
-        fprintf(log_file, "%ld%s", current_save_size, "s");
+        fprintf(log_file, "%d%s", current_save_size, "s");
       else
 #endif
-        fprintf(log_file, "%ld%s", save_size, "s");
+        fprintf(log_file, "%d%s", save_size, "s");
 
       fprintf(log_file, "\n");
 
index 57cd093..64c5da8 100644 (file)
@@ -751,7 +751,6 @@ EXTERN boolean show_fonts_used;
 EXTERN boolean reset_exceptions;
 EXTERN boolean show_current;
 EXTERN boolean return_flag;
-EXTERN boolean want_version;
 EXTERN boolean civilize_flag;
 EXTERN boolean show_numeric;
 EXTERN boolean restrict_to_ascii;
@@ -845,35 +844,34 @@ void add_variable_space(int);
 char *unixify (char *);
 
 #include "coerce.h"
-#undef inline
-#define inline
+
 /* sec 79 */
-extern inline void node_list_display(integer p);
-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);
-extern inline void pop_input(void);
-extern inline void print_err (const char * s);
-extern inline void ensure_dvi_open(void);
-extern inline void write_dvi(size_t a, size_t b);
-extern inline void prompt_input(const char *s);
-extern inline void synch_h(void);
-extern inline void synch_v(void);
-extern inline void set_cur_lang(void);
-extern char * md5_file (FILE * in_file);
-extern inline void str_room (int val);
-extern inline void tail_append_ (pointer val);
+extern void node_list_display(integer p);
+extern void do_nothing(void);
+extern void update_terminal(void);
+extern void check_full_save_stack(void);
+extern void push_input(void);
+extern void pop_input(void);
+extern void print_err (const char * s);
+extern void ensure_dvi_open(void);
+extern void write_dvi(size_t a, size_t b);
+extern void prompt_input(const char *s);
+extern void synch_h(void);
+extern void synch_v(void);
+extern void set_cur_lang(void);
+extern char * md5_file(FILE * in_file);
+extern void str_room(int val);
+extern void tail_append_(pointer val);
 #define tail_append(a) tail_append_((pointer) a)
-extern inline void tex_help (unsigned int n, ...);
-extern inline void append_char(ASCII_code c);
-extern inline void append_lc_hex(ASCII_code c);
-extern inline void succumb(void);
-extern inline void dvi_out_ (ASCII_code op);
+extern void tex_help(unsigned int n, ...);
+extern void append_char(ASCII_code c);
+extern void append_lc_hex(ASCII_code c);
+extern void succumb(void);
+extern void dvi_out_(ASCII_code op);
 #define dvi_out(op) dvi_out_((ASCII_code) (op))
-extern inline void free_avail_(halfword p);
+extern void free_avail_(halfword p);
 #define free_avail(p) free_avail_((halfword) (p))
-extern inline void flush_string (void);
+extern void flush_string (void);
 extern str_number load_pool_strings (integer spare_size);
 extern str_number make_string_pool (const char *s);
 #define help0()     tex_help(0)
index 91449dc..786ddb7 100644 (file)
 
 #include "texd.h"
 
-inline void do_nothing(void)
+void do_nothing(void)
 {
   if (trace_flag)
     printf("DO_NOTHING.\n");
 }
 
-inline void update_terminal(void)
+void update_terminal(void)
 {
 #ifndef _WINDOWS
   fflush(stdout);
 #endif
 }
 
-inline void check_full_save_stack(void)
+void check_full_save_stack(void)
 {
   if (save_ptr > max_save_stack)
   {
@@ -56,18 +56,18 @@ inline void check_full_save_stack(void)
 #endif
   }
 }
-inline void write_dvi(size_t a, size_t b)
+void write_dvi(size_t a, size_t b)
 {
   if (fwrite((char *) &dvi_buf[a], sizeof(dvi_buf[a]),
     ((b) - (a) + 1), dvi_file) != ((b) - (a) + 1))
     FATAL_PERROR ("\n! dvi file");
 }
-inline void prompt_input(const char * s)
+void prompt_input(const char * s)
 {
   prints(s);
   term_input();
 }
-inline void set_cur_lang(void)
+void set_cur_lang(void)
 {
   if (language <= 0)
     cur_lang = 0;
@@ -76,7 +76,7 @@ inline void set_cur_lang(void)
   else
     cur_lang = language;
 }
-inline void free_avail_(halfword p)
+void free_avail_(halfword p)
 {
   link(p) = avail;
   avail = p;
@@ -85,13 +85,13 @@ inline void free_avail_(halfword p)
 #endif
 }
 /* sec 0042 */
-inline void append_char (ASCII_code c)
+void append_char (ASCII_code c)
 {
   str_pool[pool_ptr] = c;
   incr(pool_ptr);
 }
 /* sec 0042 */
-inline void str_room(int val)
+void str_room(int val)
 {
 #ifdef ALLOCATESTRING
   if (pool_ptr + val > current_pool_size)
@@ -105,13 +105,13 @@ inline void str_room(int val)
 #endif
 }
 /* sec 0044 */
-inline void flush_string (void)
+void flush_string (void)
 {
   decr(str_ptr);
   pool_ptr = str_start[str_ptr];
 }
 /* sec 0048 */
-inline void append_lc_hex (ASCII_code c)
+void append_lc_hex (ASCII_code c)
 {
   if (c < 10)
     append_char(c + '0');
@@ -119,7 +119,7 @@ inline void append_lc_hex (ASCII_code c)
     append_char(c - 10 + 'a');
 }
 /* sec 0073 */
-inline void print_err (const char * s)
+void print_err (const char * s)
 {
   if (interaction == error_stop_mode)
     do_nothing();
@@ -128,7 +128,7 @@ inline void print_err (const char * s)
   prints(s);
 }
 /* sec 0079 */
-inline void tex_help (unsigned int n, ...)
+void tex_help (unsigned int n, ...)
 {
   int i;
   va_list help_arg;
@@ -145,7 +145,7 @@ inline void tex_help (unsigned int n, ...)
   va_end(help_arg);
 }
 /* sec 0093 */
-inline void succumb (void)
+void succumb (void)
 {
   if (interaction == error_stop_mode)
     interaction = scroll_mode;
@@ -164,20 +164,20 @@ inline void succumb (void)
   jump_out();
 }
 /* sec 0180 */
-inline void node_list_display(integer p)
+void node_list_display(integer p)
 {
   append_char('.');
   show_node_list(p);
   decr(pool_ptr);
 }
 /* sec 0214 */
-inline void tail_append_ (pointer val)
+void tail_append_ (pointer val)
 {
   link(tail) = val;
   tail = link(tail);
 }
 /* sec 0321 */
-inline void push_input(void)
+void push_input(void)
 {
   if (input_ptr > max_in_stack)
   {
@@ -205,13 +205,13 @@ inline void push_input(void)
   incr(input_ptr);
 }
 /* sec 0322 */
-inline void pop_input(void)
+void pop_input(void)
 {
   decr(input_ptr);
   cur_input = input_stack[input_ptr];
 }
 /* sec 0532 */
-inline void ensure_dvi_open(void)
+void ensure_dvi_open(void)
 {
   if (output_file_name == 0)
   {
@@ -229,7 +229,10 @@ inline void ensure_dvi_open(void)
   }
 }
 /* sec 0598 */
-inline void dvi_out_(ASCII_code op)
+md5_state_t dvi_md5_state;
+md5_byte_t  dvi_md5_digest[16];
+
+void dvi_out_(ASCII_code op)
 {
   dvi_buf[dvi_ptr] = op;
   incr(dvi_ptr);
@@ -238,7 +241,7 @@ inline void dvi_out_(ASCII_code op)
     dvi_swap();
 }
 /* sec 0616 */
-inline void synch_h(void)
+void synch_h(void)
 {
   if (cur_h != dvi_h)
   {
@@ -247,7 +250,7 @@ inline void synch_h(void)
   }
 }
 /* sec 0616 */
-inline void synch_v(void)
+void synch_v(void)
 {
   if (cur_v != dvi_v)
   {