OSDN Git Service

updated macro.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Tue, 13 May 2014 17:25:43 +0000 (01:25 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Tue, 13 May 2014 17:25:43 +0000 (01:25 +0800)
src/texsourc/itex.c
src/texsourc/tex4.c
src/texsourc/tex5.c
src/texsourc/texmfmem.h
src/texsourc/yandy_macros.h
src/texsourc/yandy_pdf_backend.c

index 12d5111..00dd9a4 100644 (file)
@@ -157,7 +157,7 @@ void initialize (void)
 #ifdef ALLOCATEMAIN
   if (is_initex)
 #endif
-    mem[page_head].hh.v.RH = 0;
+    link(page_head) = 0;
 
   last_glue = empty_flag;
   last_penalty = 0;
index 6f513f7..1cc7bc2 100644 (file)
@@ -419,23 +419,16 @@ void special_out_(halfword p)
 #ifdef ALLOCATESTRING
   if (pool_ptr + 32000 > current_pool_size)
     str_pool = realloc_str_pool (increment_pool_size);
-/* We don't bother to check whether this worked - will catch later */
-#endif
-/* Potential problem here if current_pool_size is not much more than pool_ptr! */
-/* Fixed 97/Mar/9 in version 2.0.3 */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-#ifdef ALLOCATESTRING
+
   show_token_list(link(write_tokens(p)), 0, 10000000L);
-/*  Above is safe, since print/print_char/print_esc will extend string space */
 #else
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
   show_token_list(link(write_tokens(p)), 0, pool_size - pool_ptr);
 #endif
 
   selector = old_setting;
   str_room(1);
 
-  if (cur_length < 256)  /* can use xxx1 ? */
+  if (cur_length < 256)
   {
     dvi_out(xxx1);
     dvi_out(cur_length);
@@ -488,7 +481,7 @@ void write_out_(halfword p)
       {
         get_token();
       }
-    while(!(cur_tok == end_write_token)); /*1996/Jan/10*/
+    while(!(cur_tok == end_write_token));
   }
 
   mode = oldmode;
index a17c4db..6dda55c 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "texd.h"
 
-/* rebox_ used to be in tex4.c */
 /* sec 0715 */
 halfword rebox_(halfword b, scaled w)
 {
@@ -275,6 +274,7 @@ void make_vcenter_(halfword q)
     confusion("vcenter");
     return;         // abort_flag set
   }
+
   delta = height(v) + depth(v);
   height(v) = axis_height(cur_size) + half(delta);
   depth(v) = delta - height(v);
index d367305..ea4cc44 100644 (file)
@@ -87,7 +87,7 @@ typedef union
   } v;
 
   struct
-  { /* Make B0,B1 overlap the most significant bytes of LH.  */
+  {
 #ifdef WORDS_BIGENDIAN
     halfword junk;
     quarterword B0, B1;
@@ -170,7 +170,7 @@ typedef struct
     unsigned char B3, B2, B1, B0;
 #endif
   } u;
-} ffour_quarters; /* was fourunsignedchars; */
+} ffour_quarters;
 
 #define fquarterword unsigned char
 
@@ -190,4 +190,4 @@ typedef union
 #ifndef WORDS_BIGENDIAN
 #define cint u.CINT
 #define qqqq v.QQQQ
-#endif
+#endif
\ No newline at end of file
index 22d59df..aa2c4aa 100644 (file)
 /* sec 0041 */
 #define cur_length (pool_ptr - str_start[str_ptr])
 /* sec 0054 */
-#define no_print     16
-#define term_only    17
-#define log_only     18
-#define term_and_log 19
-#define pseudo       20
-#define new_string   21
-#define max_selector 21
+enum 
+{
+  no_print     = 16,
+  term_only    = 17,
+  log_only     = 18,
+  term_and_log = 19,
+  pseudo       = 20,
+  new_string   = 21,
+  max_selector = 21,
+};
 /* sec 0073 */
-#define batch_mode      0
-#define nonstop_mode    1
-#define scroll_mode     2
-#define error_stop_mode 3
+enum
+{
+  batch_mode      = 0,
+  nonstop_mode    = 1,
+  scroll_mode     = 2,
+  error_stop_mode = 3,
+};
 /* sec 0076 */
-#define spotless             0
-#define warning_issued       1
-#define error_message_issued 2
-#define fatal_error_stop     3
+enum
+{
+  spotless             = 0,
+  warning_issued       = 1,
+  error_message_issued = 2,
+  fatal_error_stop     = 3,
+};
 /* sec 0105 */
 #define nx_plux_y(...)   mult_and_add(..., 07777777777L)
 #define mult_integers(a) mult_and_add(a,0,017777777777L)
index d06ba81..7b552a5 100644 (file)
@@ -151,9 +151,9 @@ void pdf_error(const char * t, const char * p)
 // char to string.
 char * pdf_char_to_string(unsigned char i)
 {
-  char * str = (char *) malloc(2);
+  char str[2];
   str[0] = i;
-  str[1] = 0;
+  str[1] = '\0';
   return str;
 }
 // output one char: normal.
@@ -412,6 +412,10 @@ void pdf_font_def (internal_font_number f)
       yandy_font[pdf_font_sum] = HPDF_GetFont(yandy_pdf, fnt_name, NULL);
       HPDF_Page_SetFontAndSize(yandy_page, yandy_font[pdf_font_sum], (font_size[f] / 65535));
     }
+    else
+    {
+      HPDF_Page_SetFontAndSize(yandy_page, yandy_font[0], (font_size[f] / 65535));
+    }
   }
   else
   {
@@ -552,12 +556,9 @@ void pdf_hlist_out (void)
   scaled left_edge;
   scaled save_h, save_v;
   halfword this_box;
-/*  glue_ord g_order;  */
-  int g_order;           /* 95/Jan/7 */
-/*  char g_sign;  */
-  int g_sign;            /* 95/Jan/7 */
+  int g_order;
+  int g_sign;
   halfword p;
-  //integer save_loc;
   halfword leader_box;
   scaled leader_wd;
   scaled lx;