summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-07-17 16:08:25 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-07-17 16:08:25 +0000
commitf9f170e6483ce11f02a97e26b1ccf0a3e8cb9bfc (patch)
treeaef406659c131b665910c2bb48e0ccb132de5610 /Build
parent3d92be8e488983918d91c10fc014881310317265 (diff)
various small fixes for 64Bit systems
texk/dvipsk: add casts to avoid compiler warnings texk/gsftopk: add casts to avoid compiler warnings texk/ps2pkm: import changes from libs/t1lib texk/ttfdump: add casts to avoid compiler warnings texk/dviljk: add casts for printing and proper format specs for scanf to avoid compiler warnings and potential bugs git-svn-id: svn://tug.org/texlive/trunk@14299 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/libs/libpng/ChangeLog3
-rw-r--r--Build/source/texk/dviljk/ChangeLog8
-rw-r--r--Build/source/texk/dviljk/config.h2
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c14
-rw-r--r--Build/source/texk/dvipsk/ChangeLog6
-rw-r--r--Build/source/texk/dvipsk/writet1.c4
-rw-r--r--Build/source/texk/gsftopk/ChangeLog5
-rw-r--r--Build/source/texk/gsftopk/gsftopk.c4
-rw-r--r--Build/source/texk/ps2pkm/ChangeLog7
-rw-r--r--Build/source/texk/ps2pkm/regions.c7
-rw-r--r--Build/source/texk/ps2pkm/util.c6
-rw-r--r--Build/source/texk/seetexk/ChangeLog2
-rw-r--r--Build/source/texk/ttfdump/ChangeLog5
-rw-r--r--Build/source/texk/ttfdump/libttf/cmap.c2
-rw-r--r--Build/source/texk/ttfdump/libttf/cvt.c2
15 files changed, 52 insertions, 25 deletions
diff --git a/Build/source/libs/libpng/ChangeLog b/Build/source/libs/libpng/ChangeLog
index 04bdce52cf8..bd06702047c 100644
--- a/Build/source/libs/libpng/ChangeLog
+++ b/Build/source/libs/libpng/ChangeLog
@@ -6,10 +6,13 @@
* svn mv libpng-1.2.37 libpng-1.2.38: update source tree.
* update files in libpng-1.2.38.
+ * libpng-1.2.38/png.c (png_64bit_product): declare as static.
+
2009-06-19 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: enable compiler warnings.
* Makefile.am (AM_CFLAGS): enable compiler warnings.
+
* libpng-1.2.37/png.c (png_64bit_product): declare as static.
2009-06-04 Martin Schröder <martin@oneiros.de>
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index 9d8d50611cf..3bed8b36c03 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -1,3 +1,11 @@
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * config.h: define FMT_long4 as "%ld" or "%d" when long4 is
+ long or int resp.
+ * dvi2xx.c (main, DoSpecial): cast long4 to long for printing.
+ (DecodeArgs): use FMT_long4 for scanf; on 64Bit systems
+ sscanf(string, "%ld", &<int>) is wrong.
+
2009-07-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (dvilj.man): rebuild only in maintainer-mode.
diff --git a/Build/source/texk/dviljk/config.h b/Build/source/texk/dviljk/config.h
index 97af49738fd..bcdf4c577c1 100644
--- a/Build/source/texk/dviljk/config.h
+++ b/Build/source/texk/dviljk/config.h
@@ -199,8 +199,10 @@ typedef SCHAR_TYPE signed_char;
#if SIZEOF_LONG > 4
# define long4 int
+# define FMT_long4 "%d"
#else
# define long4 long
+# define FMT_long4 "%ld"
#endif
#include <stdarg.h>
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index 0fedea81632..69453cafbbd 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -378,9 +378,9 @@ main(int argc, char *argv[])
DEBUG_PRINT ("BOP for [");
for (i = 0; i <= 9; i++) {
count[i] = NoSignExtend(dvifp, 4);
- DEBUG_PRINT1 ("%d.", (int) count[i]);
+ DEBUG_PRINT1 ("%ld.", (long) count[i]);
}
- DEBUG_PRINT1 ("] at %ld.\n", cpagep);
+ DEBUG_PRINT1 ("] at %ld.\n", (long)cpagep);
ppagep = (long)NoSignExtend(dvifp, 4);
h = v = w = x = y = z = 0;
hh = vv = 0;
@@ -2907,7 +2907,7 @@ Primary author of Dvi2xx: Gustaf Neumann; -k maintainer: K. Berry.");
#endif
break;
case 'f': /* next arg is starting pagenumber */
- if ( sscanf(tcp + 1, "%ld", &FirstPage) != 1 )
+ if ( sscanf(tcp + 1, FMT_long4, &FirstPage) != 1 )
Fatal("Argument is not a valid integer\n");
FirstPageSpecified = _TRUE;
break;
@@ -3020,7 +3020,7 @@ Primary author of Dvi2xx: Gustaf Neumann; -k maintainer: K. Berry.");
break;
#endif
case 'p': /* print n pages */
- if ( sscanf(tcp + 1, "%ld", &PrintPages) != 1 )
+ if ( sscanf(tcp + 1, FMT_long4, &PrintPages) != 1 )
Fatal("Argument is not a valid integer\n");
if (PrintPages < 1)
Fatal("Argument of -p must be greater than 0\n");
@@ -3070,7 +3070,7 @@ Primary author of Dvi2xx: Gustaf Neumann; -k maintainer: K. Berry.");
break;
#endif
case 't': /* ending pagenumber */
- if ( sscanf(tcp + 1, "%ld", &LastPage) != 1 )
+ if ( sscanf(tcp + 1, FMT_long4, &LastPage) != 1 )
Fatal("Argument is not a valid integer\n");
LastPageSpecified = _TRUE;
break;
@@ -3856,9 +3856,9 @@ void DoSpecial(char *str, int n)
if (labs(x_pos)<labs(y_pos)) x_pos = x_pos+3;
else y_pos = y_pos+3;
if (GrayFill) {
- EMIT4("\033*c%lda%ldb%dg2P", x_pos, y_pos, GrayScale);
+ EMIT4("\033*c%lda%ldb%dg2P", (long)x_pos, (long)y_pos, GrayScale);
} else {
- EMIT4("\033*c%lda%ldb%dg3P", x_pos, y_pos, Pattern);
+ EMIT4("\033*c%lda%ldb%dg3P", (long)x_pos, (long)y_pos, Pattern);
}
last_rx = last_ry = UNKNOWN;
#endif
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index 12ddf3d01e5..786aaf95a92 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * writet1.c (t1_flush_cs): cast ptr diff to unsigned long for
+ printing.
+ NB: sizeof(ptr)==sizeof(long) for both 32Bit and 64Bit systems.
+
2009-07-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* squeeze/squeeze.c (__CYGWIN__): #include <unistd.h> and <io.h>
diff --git a/Build/source/texk/dvipsk/writet1.c b/Build/source/texk/dvipsk/writet1.c
index d28f2a3936f..0576bba9bad 100644
--- a/Build/source/texk/dvipsk/writet1.c
+++ b/Build/source/texk/dvipsk/writet1.c
@@ -1593,7 +1593,7 @@ static void t1_flush_cs(boolean is_subr)
for (ptr = tab; ptr < end_tab; ptr++) {
if (ptr->used) {
if (is_subr)
- sprintf(t1_line_array, "dup %u %u", ptr - tab, ptr->cslen);
+ sprintf(t1_line_array, "dup %lu %u", (unsigned long) (ptr - tab), ptr->cslen);
else
sprintf(t1_line_array, "/%s %u", ptr->name, ptr->cslen);
p = strend(t1_line_array);
@@ -1604,7 +1604,7 @@ static void t1_flush_cs(boolean is_subr)
else {
/* replace unsused subr's by return_cs */
if (is_subr) {
- sprintf(t1_line_array, "dup %u %u%s ", ptr - tab, cs_len,
+ sprintf(t1_line_array, "dup %lu %u%s ", (unsigned long) (ptr - tab), cs_len,
cs_token_pair[0]);
p = strend(t1_line_array);
memcpy(p, return_cs, cs_len);
diff --git a/Build/source/texk/gsftopk/ChangeLog b/Build/source/texk/gsftopk/ChangeLog
index 9d2509c2667..3906a4b266d 100644
--- a/Build/source/texk/gsftopk/ChangeLog
+++ b/Build/source/texk/gsftopk/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * gsftopk.c (pk_rll_cvt): cast ptr diff to long for printing.
+ NB: sizeof(ptr)==sizeof(long) for both 32Bit and 64Bit systems.
+
2009-06-20 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (AM_CFLAGS): enable compiler warnings.
diff --git a/Build/source/texk/gsftopk/gsftopk.c b/Build/source/texk/gsftopk/gsftopk.c
index e4b20ca5792..38222224b05 100644
--- a/Build/source/texk/gsftopk/gsftopk.c
+++ b/Build/source/texk/gsftopk/gsftopk.c
@@ -1742,8 +1742,8 @@ pk_rll_cvt(void)
++cost;
}
if (cost != 2 * (bitmap_end - bitmap))
- printf("Cost miscalculation: expected %d, got %d\n", cost,
- 2 * (bitmap_end - bitmap));
+ printf("Cost miscalculation: expected %d, got %ld\n", cost,
+ 2 * (long) (bitmap_end - bitmap));
pk_len = bitmap_end - bitmap;
return True;
}
diff --git a/Build/source/texk/ps2pkm/ChangeLog b/Build/source/texk/ps2pkm/ChangeLog
index 7b0f4ef46db..225eeb0b2c6 100644
--- a/Build/source/texk/ps2pkm/ChangeLog
+++ b/Build/source/texk/ps2pkm/ChangeLog
@@ -1,7 +1,12 @@
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regions.c (NewEdge): align to sizeof(long), as in t1lib.
+ * util.c (vm_alloc): align to 64-bit boundary, as in t1lib.
+
2009-06-23 Peter Breitenlohner <peb@mppmu.mpg.de>
* fontfcn.c, regions.c, regions.h, scanfont.c, t1funcs.c:
- drop #ifdef HAVE_PROTOTYPES, unconditionalty use prototypes.
+ drop #ifdef HAVE_PROTOTYPES, unconditionally use prototypes.
2009-06-22 Peter Breitenlohner <peb@mppmu.mpg.de>
diff --git a/Build/source/texk/ps2pkm/regions.c b/Build/source/texk/ps2pkm/regions.c
index 6d778b9e8d4..a5979d9681c 100644
--- a/Build/source/texk/ps2pkm/regions.c
+++ b/Build/source/texk/ps2pkm/regions.c
@@ -308,11 +308,8 @@ if the xvalues are long aligned by ANDing the address with the
(sizeof(long) - 1)--if non zero, the xvalues are not aligned well. We
set 'iy' to the ymin value that would give us good alignment:
*/
-#if defined (__alpha)
- iy = ymin - (((long) xvalues) & (sizeof(LONG) - 1)) / sizeof(pel);
-#else
- iy = ymin - (((int) xvalues) & (sizeof(LONG) - 1)) / sizeof(pel);
-#endif
+ iy = ymin - (((unsigned long) xvalues) & (sizeof(LONG) - 1)) / sizeof(pel);
+
r = (struct edgelist *)Allocate(sizeof(struct edgelist), &template,
(ymax - iy) * sizeof(pel));
diff --git a/Build/source/texk/ps2pkm/util.c b/Build/source/texk/ps2pkm/util.c
index 21fb13b43a9..81afafb9516 100644
--- a/Build/source/texk/ps2pkm/util.c
+++ b/Build/source/texk/ps2pkm/util.c
@@ -66,12 +66,8 @@ char *vm_alloc(bytes)
{
char *answer;
- /* Round to next LONG multiple (32-bit) */
-#if defined(sun) || defined(__hpux) || defined(__alpha)
+ /* Align returned bytes to 64-bit boundary */
bytes = (bytes + 7) & ~7;
-#else
- bytes = (bytes + 3) & ~3;
-#endif
/* take space from what is left otherwise allocate another CHUNK */
if (bytes > vm_free)
diff --git a/Build/source/texk/seetexk/ChangeLog b/Build/source/texk/seetexk/ChangeLog
index 3a72eb00ee2..f4dd34337ae 100644
--- a/Build/source/texk/seetexk/ChangeLog
+++ b/Build/source/texk/seetexk/ChangeLog
@@ -5,7 +5,7 @@
2009-06-23 Peter Breitenlohner <peb@mppmu.mpg.de>
* dvibook.c, dvitodvi.c: drop #ifdef HAVE_PROTOTYPES,
- unconditionalty use prototypes.
+ unconditionally use prototypes.
2009-06-22 Peter Breitenlohner <peb@mppmu.mpg.de>
diff --git a/Build/source/texk/ttfdump/ChangeLog b/Build/source/texk/ttfdump/ChangeLog
index 87424d5d08b..564fa0d8132 100644
--- a/Build/source/texk/ttfdump/ChangeLog
+++ b/Build/source/texk/ttfdump/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * cmap.c (ttfPrintCMAP4) cast USHORT/sizeof() to int for printing.
+ * cvt.c (ttfPrintCVT): cast USHORT*sizeof() to int for printing.
+
2009-06-18 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (AM_CFLAGS): enable compiler warnings.
diff --git a/Build/source/texk/ttfdump/libttf/cmap.c b/Build/source/texk/ttfdump/libttf/cmap.c
index 3374829b4d8..0fa44d50369 100644
--- a/Build/source/texk/ttfdump/libttf/cmap.c
+++ b/Build/source/texk/ttfdump/libttf/cmap.c
@@ -629,7 +629,7 @@ static void ttfPrintCMAP4(FILE *fp,SubTablePtr subTable)
j = subTable->map.cmap4->segCountX2/2 - i;
j = subTable->map.cmap4->idRangeOffset[i] -
j*sizeof(USHORT);
- fprintf(fp, " gId# = %d\n",j/sizeof(USHORT));
+ fprintf(fp, " gId# = %d\n", (int) (j/sizeof(USHORT)));
}
else
fprintf(fp, " gId# = N/A\n");
diff --git a/Build/source/texk/ttfdump/libttf/cvt.c b/Build/source/texk/ttfdump/libttf/cvt.c
index 364ae66f21a..0e9c2f14782 100644
--- a/Build/source/texk/ttfdump/libttf/cvt.c
+++ b/Build/source/texk/ttfdump/libttf/cvt.c
@@ -51,7 +51,7 @@ void ttfPrintCVT(FILE *fp, FWord *cvt, USHORT cvtLength)
fprintf(fp,"'cvt ' Table - Control Value Table\n");
fprintf(fp,"----------------------------------\n");
- fprintf(fp,"Size = %d bytes, %d entries\n",cvtLength*sizeof(FWord),
+ fprintf(fp,"Size = %d bytes, %d entries\n", (int) (cvtLength*sizeof(FWord)),
cvtLength);
for (i=0;i<cvtLength;i++)