ogajduse / rpms / texlive

Forked from rpms/texlive 6 years ago
Clone
4931932
--- libs/teckit/source/Compiler.cpp
4931932
+++ libs/teckit/source/Compiler.cpp	2007-03-02 10:34:35.000000000 +0000
4931932
@@ -1397,13 +1397,16 @@ Compiler::Compiler(const char* txt, UInt
4931932
 				if (dest != 0) {
4931932
 					int	result = compress2(dest + 8, &destLen, compiledTable, compiledSize, Z_BEST_COMPRESSION);
4931932
 					if (result == Z_OK) {
4931932
-						destLen += 8;
4931932
-						realloc(dest, destLen);
4931932
-						WRITE(((FileHeader*)dest)->type, kMagicNumberCmp);
4931932
-						WRITE(((FileHeader*)dest)->version, compiledSize);
4931932
-						free(compiledTable);
4931932
-						compiledTable = dest;
4931932
-						compiledSize = destLen;
4931932
+						if (realloc(dest, destLen+8) != NULL) {
4931932
+							destLen += 8;
4931932
+							WRITE(((FileHeader*)dest)->type, kMagicNumberCmp);
4931932
+							WRITE(((FileHeader*)dest)->version, compiledSize);
4931932
+							free(compiledTable);
4931932
+							compiledTable = dest;
4931932
+							compiledSize = destLen;
4931932
+						}
4931932
+						else
4931932
+							free(dest);
4931932
 					}
4931932
 					else
4931932
 						free(dest);
4931932
--- texk/kpathsea/xputenv.c
4931932
+++ texk/kpathsea/xputenv.c	2007-03-02 10:14:53.000000000 +0000
4931932
@@ -95,7 +95,7 @@ xputenv(const char *var, const char *val
4931932
     if (cur_loc == saved_count) {
4931932
         /* No old string. */
4931932
         saved_count++;
4931932
-        saved_env = XRETALLOC(saved_env, saved_count, const char *);
4931932
+        XRETALLOC(saved_env, saved_count, const char *);
4931932
     } else {
4931932
         /* We owned the old string. */
4931932
         free(saved_env[cur_loc]);
4931932
--- texk/ps2pkm/token.c
4931932
+++ texk/ps2pkm/token.c	2007-01-10 09:26:00.000000000 +0100
4931932
@@ -108,7 +108,7 @@ static DOUBLE P10(exponent)
4931932
   if (exponent < 0) {
4931932
     power = 0.1;
4931932
     value = (exponent & 1 ? power : 1.0);
4931932
-    exponent = -(++exponent >> 1); /* portable C for -(exponent/2) */
4931932
+    exponent = -((exponent+1) >> 1); /* portable C for -(exponent/2) */
4931932
   }
4931932
   else {
4931932
     power = 10.0;
4931932
--- texk/ps2pkm/type1.c
4931932
+++ texk/ps2pkm/type1.c	2007-01-10 17:09:30.000000000 +0100
4931932
@@ -110,11 +110,11 @@ typedef struct xobject xobject;
4931932
 static DOUBLE tmpx;  /* Store macro argument in tmpx to avoid re-evaluation */
4931932
 static LONG tmpi;    /* Store converted value in tmpi to avoid re-evaluation */
4931932
  
4931932
-#define FABS(x) (((tmpx = (x)) < 0.0) ? -tmpx : tmpx)
4931932
+#define FABS(x) ({ tmpx = (x); (tmpx < 0.0) ? -tmpx : tmpx; })
4931932
  
4931932
-#define CEIL(x) (((tmpi = (LONG) (tmpx = (x))) < tmpx) ? ++tmpi : tmpi)
4931932
+#define CEIL(x) ({ tmpi = (LONG) (tmpx = (x)); (tmpi < tmpx) ? ++tmpi : tmpi; })
4931932
  
4931932
-#define FLOOR(x) (((tmpi = (LONG) (tmpx = (x))) > tmpx) ? --tmpi : tmpi)
4931932
+#define FLOOR(x) ({ tmpi = (LONG) (tmpx = (x)); (tmpi > tmpx) ? --tmpi : tmpi; })
4931932
  
4931932
 #define ROUND(x) FLOOR((x) + 0.5)
4931932
  
4931932
--- texk/web2c/mpware/mpto.c
4931932
+++ texk/web2c/mpware/mpto.c	2007-03-02 10:36:04.000000000 +0000
4931932
@@ -24,11 +24,7 @@
4931932
 
4931932
 #include <stdio.h>
4931932
 #include <stdlib.h>
4931932
-
4931932
-#ifdef WIN32
4931932
 #include <string.h>
4931932
-#endif
4931932
-
4931932
 
4931932
 /* MetaPost itself has a configurable max line length, but we can afford to
4931932
    use smaller values than that */
4931932
--- texk/web2c/pdftexdir/utils.c
4931932
+++ texk/web2c/pdftexdir/utils.c	2007-03-02 10:16:35.000000000 +0000
4931932
@@ -1369,7 +1369,7 @@ int newcolorstack(integer s, integer lit
4931932
         colstacks_size += STACK_INCREMENT;
4931932
         /* If (MAX_COLORSTACKS mod STACK_INCREMENT = 0) then we don't
4931932
            need to check the case that size overruns MAX_COLORSTACKS. */
4931932
-        colstacks = xretalloc(colstacks, colstacks_size, colstack_type);
4931932
+        xretalloc(colstacks, colstacks_size, colstack_type);
4931932
     }
4931932
     /* claim new color stack */
4931932
     colstack_num = colstacks_used++;
4931932
--- texk/makeindexk/genind.h
4931932
+++ texk/makeindexk/genind.h	2007-03-15 15:28:43.000000000 +0000
4931932
@@ -25,6 +25,20 @@
4931932
  *
4931932
  */
4931932
 
4931932
+#ifndef __has_idx_printf
4931932
+#define __has_idx_printf
4931932
+#include <stdarg.h>
4931932
+static __inline__ int idx_printf(FILE *stream, const char *format, ...)
4931932
+{
4931932
+    int ret;
4931932
+    va_list ap;
4931932
+    va_start(ap, format);
4931932
+    ret = vfprintf(stream, format, ap);
4931932
+    va_end(ap);
4931932
+    return ret;
4931932
+}
4931932
+#endif
4931932
+
4931932
 #define IND_ERROR(F, D) { \
4931932
     if (idx_dot) { \
4931932
 	fprintf(ilg_fp, "\n"); \
4931932
@@ -33,7 +47,7 @@
4931932
     fprintf(ilg_fp, \
4931932
     "## Warning (input = %s, line = %d; output = %s, line = %d):\n   -- ", \
4931932
 	    curr->fn, curr->lc, ind_fn, ind_lc+1); \
4931932
-    fprintf(ilg_fp, F, D); \
4931932
+    idx_printf(ilg_fp, F, D); \
4931932
     ind_ec++; \
4931932
 }
4931932
 
4931932
--- texk/makeindexk/mkind.h
4931932
+++ texk/makeindexk/mkind.h	2007-03-15 15:29:28.000000000 +0000
4931932
@@ -253,10 +253,24 @@
4931932
 #define STREQ(A, B)  (strcmp(A, B) == 0)
4931932
 #define STRNEQ(A, B) (strcmp(A, B) != 0)
4931932
 
4931932
+#ifndef __has_idx_printf
4931932
+#define __has_idx_printf
4931932
+#include <stdarg.h>
4931932
+static __inline__ int idx_printf(FILE *stream, const char *format, ...)
4931932
+{
4931932
+    int ret;
4931932
+    va_list ap;
4931932
+    va_start(ap, format);
4931932
+    ret = vfprintf(stream, format, ap);
4931932
+    va_end(ap);
4931932
+    return ret;
4931932
+}
4931932
+#endif
4931932
+
4931932
 #define MESSAGE(F, S) { \
4931932
     if (verbose) \
4931932
-	fprintf(stderr, F, S); \
4931932
-    fprintf(ilg_fp, F, S); \
4931932
+	idx_printf(stderr, F, S); \
4931932
+    idx_printf(ilg_fp, F, S); \
4931932
 }
4931932
 
4931932
 #if USE_KPATHSEA /* kpathsea defines a different FATAL */
4931932
@@ -264,7 +278,7 @@
4931932
 #endif
4931932
 
4931932
 #define FATAL(F, S) { \
4931932
-    fprintf(stderr, F, S); \
4931932
+    idx_printf(stderr, F, S); \
4931932
     fprintf(stderr, USAGE, pgm_fn); \
4931932
     EXIT(1); \
4931932
 }
4931932
--- texk/makeindexk/scanid.h
4931932
+++ texk/makeindexk/scanid.h	2007-03-15 15:27:12.000000000 +0000
4931932
@@ -101,6 +101,20 @@
4931932
     return (FALSE); \
4931932
 }
4931932
 
4931932
+#ifndef __has_idx_printf
4931932
+#define __has_idx_printf
4931932
+#include <stdarg.h>
4931932
+static __inline__ int idx_printf(FILE *stream, const char *format, ...)
4931932
+{
4931932
+    int ret;
4931932
+    va_list ap;
4931932
+    va_start(ap, format);
4931932
+    ret = vfprintf(stream, format, ap);
4931932
+    va_end(ap);
4931932
+    return ret;
4931932
+}
4931932
+#endif
4931932
+
4931932
 #define IDX_ERROR(F, D) { \
4931932
     if (idx_dot) { \
4931932
 	fprintf(ilg_fp, "\n"); \
4931932
@@ -108,7 +122,7 @@
4931932
     } \
4931932
     fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n   -- ", \
4931932
 	    idx_fn, idx_lc); \
4931932
-    fprintf(ilg_fp, F, D); \
4931932
+    idx_printf(ilg_fp, F, D); \
4931932
     idx_ec++; \
4931932
 }
4931932
 
4931932
--- texk/makeindexk/scanst.h
4931932
+++ texk/makeindexk/scanst.h	2007-03-15 15:48:48.000000000 +0000
4931932
@@ -145,6 +145,20 @@
4931932
 
4931932
 #define INDENTLEN_DEF 16
4931932
 
4931932
+#ifndef __has_idx_printf
4931932
+#define __has_idx_printf
4931932
+#include <stdarg.h>
4931932
+static __inline__ int idx_printf(FILE *stream, const char *format, ...)
4931932
+{
4931932
+    int ret;
4931932
+    va_list ap;
4931932
+    va_start(ap, format);
4931932
+    ret = vfprintf(stream, format, ap);
4931932
+    va_end(ap);
4931932
+    return ret;
4931932
+}
4931932
+#endif
4931932
+
4931932
 #define STY_ERROR(F, D) { \
4931932
     if (idx_dot) { \
4931932
 	fprintf(ilg_fp, "\n"); \
4931932
@@ -152,7 +166,7 @@
4931932
     } \
4931932
     fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n   -- ", \
4931932
 	    sty_fn, sty_lc); \
4931932
-    fprintf(ilg_fp, F, D); \
4931932
+    idx_printf(ilg_fp, F, D); \
4931932
     sty_ec++; \
4931932
     put_dot = FALSE; \
4931932
 }