[tlbuild] luatex 0.40.2 "avoid variable declaration after statement" patch

Vladimir Volovich vvv at vsu.ru
Wed Jun 3 22:19:37 CEST 2009


Hi Taco,

please review and apply as you see fit the following changes to avoid
variable declaration after statement:

==============================
--- texk/web2c/luatexdir/image/writeimg.c	(revision 13610)
+++ texk/web2c/luatexdir/image/writeimg.c	(working copy)
@@ -852,10 +852,10 @@
 
 void out_image(integer ref, scaled hpos, scaled vpos)
 {
+    image *a = img_array[ref];
     scaledpos pos;
     pos.h = hpos;
     pos.v = vpos;
-    image *a = img_array[ref];
     out_img(a, pstruct, &pos);
 }
 
--- texk/web2c/luatexdir/luafontloader/src/luafflib.c	(revision 13610)
+++ texk/web2c/luatexdir/luafontloader/src/luafflib.c	(working copy)
@@ -2130,9 +2130,10 @@
   }
   
   if (sf->loadvalidation_state != 0) {
+    int val, st;
     lua_newtable(L);
-    int val = 1;
-    int st = sf->loadvalidation_state;
+    val = 1;
+    st = sf->loadvalidation_state;
     if (st & lvs_bad_ps_fontname) { 
        lua_pushliteral(L, "bad_ps_fontname"); lua_rawseti(L,-2,val++); 
     }
--- texk/web2c/luatexdir/lua/luainit.c	(revision 13610)
+++ texk/web2c/luatexdir/lua/luainit.c	(working copy)
@@ -530,6 +530,7 @@
     }
     /* now run the file */
     if (startup_filename != NULL) {
+        char *v1;
         /* hide the 'tex' and 'pdf' table */
         tex_table_id = hide_lua_table(Luas, "tex");
         token_table_id = hide_lua_table(Luas, "token");
@@ -585,7 +586,7 @@
         get_lua_boolean("texconfig", "halt_on_error", &haltonerrorp);
 
         /* restrictedshell */
-        char *v1 = NULL;
+        v1 = NULL;
         get_lua_string("texconfig", "shell_escape", &v1);
         if (v1) {
             if (*v1 == 't' || *v1 == 'y' || *v1 == '1') {
--- texk/web2c/luatexdir/tex/primitive.c	(revision 13610)
+++ texk/web2c/luatexdir/tex/primitive.c	(working copy)
@@ -331,6 +331,7 @@
 {
     str_number s;               /* actual |str_number| used */
     integer prim_val;           /* needed to fill |prim_eqtb| */
+    char *thes;
     assert(o >= off);
     if (ss < string_offset) {
         if (ss > 127)
@@ -340,7 +341,7 @@
     } else {
         s = ss;
     }
-    char *thes = makecstring(s);
+    thes = makecstring(s);
     if (cmd_origin == tex_command || cmd_origin == core_command) {
         primitive_def(thes, strlen(thes), c, o);
     }
--- texk/web2c/luatexdir/utils/avlstuff.c	(revision 13610)
+++ texk/web2c/luatexdir/utils/avlstuff.c	(working copy)
@@ -163,7 +163,7 @@
 
 static void destroy_oentry(void *pa, void *pb)
 {
-    (void) pb;
+    /* (void) pb; */
     oentry *p = (oentry *) pa;
     xfree(p);
 }
--- texk/web2c/luatexdir/utils/synctex.c	(revision 13610)
+++ texk/web2c/luatexdir/utils/synctex.c	(working copy)
@@ -1023,8 +1023,9 @@
 	if (SYNCTEX_IGNORE(nothing)) {
         return;
     } else {
+                size_t len;
 		pos = synch_p_with_c(cur);
-		size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"x%i,%i:%i,%i\n",
+		len = SYNCTEX_fprintf(SYNCTEX_FILE,"x%i,%i:%i,%i\n",
 			synctex_ctxt.tag,synctex_ctxt.line,
 			pos.h UNIT,pos.v UNIT);
 		if(len>0) {
--- texk/web2c/luatexdir/font/luafont.c	(revision 13610)
+++ texk/web2c/luatexdir/font/luafont.c	(working copy)
@@ -2000,15 +2000,16 @@
                 if (vlink_no_break(cur)!=null)
                     handle_lig_nest(no_break(cur),vlink_no_break(cur));
                 while ((fwd = vlink(cur)) != null ) {
+                  halfword nob, pst, next;
                     if (type(fwd) != glyph_node) break;
-                    halfword nob = tlink_no_break(cur);
-                    halfword pst = tlink_post_break(cur);
+                    nob = tlink_no_break(cur);
+                    pst = tlink_post_break(cur);
                     if ((nob == null || !test_ligature(&lig, nob, fwd)) &&
                         (pst == null || !test_ligature(&lig, pst, fwd)) )
                         break;
                     nesting_append(no_break(cur),copy_node(fwd));
                     handle_lig_nest(no_break(cur),nob);
-                    halfword next = vlink(fwd);
+                    next = vlink(fwd);
                     uncouple_node(fwd);
                     try_couple_nodes(cur, next);
                     nesting_append(post_break(cur),fwd);
@@ -2027,7 +2028,7 @@
                         /* Building an init_disc followed by a select_disc
                          * {a-}{b}{AB} {-}{}{} 'c'
                          */
-                        halfword last = vlink(next);
+                        halfword last = vlink(next), tail;
                         uncouple_node(next);
                         try_couple_nodes(fwd, last);
                         /* {a-}{b}{AB} {-}{c}{} */
@@ -2044,7 +2045,7 @@
                             nesting_prepend_list(no_break(fwd),copy_node_list(vlink_no_break(cur)));
                         }
                         /* {a-}{b}{ABC} {b-}{c}{AB-} */
-                        halfword tail = tlink_no_break(cur);
+                        tail = tlink_no_break(cur);
                         nesting_append(no_break(cur),copy_node(next));
                         handle_lig_nest(no_break(cur),tail);
                         /* {a-}{BC}{ABC} {b-}{c}{AB-} */
--- texk/web2c/luatexdir/pdf/pdfpage.h	(revision 13610)
+++ texk/web2c/luatexdir/pdf/pdfpage.h	(working copy)
@@ -45,6 +45,11 @@
 
 #  define setpdffloat(a,b,c) {(a).m = (b); (a).e = (c);}
 
+#ifdef hz
+/* AIX 4.3 defines hz as 100 in system headers */
+#undef hz
+#endif
+
 typedef struct {
     pdfpos pdf;                 /* pos. on page (PDF page raster) */
     pdfpos pdf_bt_pos;          /* pos. at begin of BT-ET group (PDF page raster) */
==============================

Best,
v.


More information about the tlbuild mailing list