diff -urN pcf2bdf-1.04~/pcf2bdf.cc pcf2bdf-1.04/pcf2bdf.cc --- pcf2bdf-1.04~/pcf2bdf.cc 2002-10-20 18:35:29.000000000 +0200 +++ pcf2bdf-1.04/pcf2bdf.cc 2006-07-11 22:51:12.000000000 +0200 @@ -4,9 +4,12 @@ * see xc/lib/font/bitmap/pcfread.c,pcfwrite.c for detail */ +#define __STDC_FORMAT_MACROS + #include #include #include +#include #if defined(_MSC_VER) // Microsoft Visual C++ # include @@ -28,13 +31,14 @@ // miscellaneous definition /////////////////////////////////////////////////// -typedef bool bool8; -typedef unsigned char uint8; -typedef unsigned char byte8; -typedef short int16; -typedef unsigned short uint16; -typedef long int32; -typedef unsigned long uint32; +typedef uint8_t bool8; +typedef int8_t int8; +typedef uint8_t uint8; +typedef uint8_t byte8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; // section ID enum type32 { @@ -436,12 +440,12 @@ { if (verbose) { - fprintf(stderr, "\t%s.leftSideBearing = %d\n", name, m->leftSideBearing); - fprintf(stderr, "\t%s.rightSideBearing = %d\n", name, m->rightSideBearing); - fprintf(stderr, "\t%s.characterWidth = %d\n", name, m->characterWidth); - fprintf(stderr, "\t%s.ascent = %d\n", name, m->ascent); - fprintf(stderr, "\t%s.descent = %d\n", name, m->descent); - fprintf(stderr, "\t%s.attributes = %04x\n", name, m->attributes); + fprintf(stderr, "\t%s.leftSideBearing = %" PRId16 "\n", name, m->leftSideBearing); + fprintf(stderr, "\t%s.rightSideBearing = %" PRId16 "\n", name, m->rightSideBearing); + fprintf(stderr, "\t%s.characterWidth = %" PRId16 "\n", name, m->characterWidth); + fprintf(stderr, "\t%s.ascent = %" PRId16 "\n", name, m->ascent); + fprintf(stderr, "\t%s.descent = %" PRId16 "\n", name, m->descent); + fprintf(stderr, "\t%s.attributes = %04" PRIx16 "\n", name, m->attributes); } } @@ -467,20 +471,20 @@ accelerators.maxOverlap = read_int32(); if (verbose) { - fprintf(stderr, "\tnoOverlap = %d\n", (int)accelerators.noOverlap); - fprintf(stderr, "\tconstantMetrics = %d\n", - (int)accelerators.constantMetrics); - fprintf(stderr, "\tterminalFont = %d\n", - (int)accelerators.terminalFont); - fprintf(stderr, "\tconstantWidth = %d\n", - (int)accelerators.constantWidth); - fprintf(stderr, "\tinkInside = %d\n", (int)accelerators.inkInside); - fprintf(stderr, "\tinkMetrics = %d\n", (int)accelerators.inkMetrics); - fprintf(stderr, "\tdrawDirection = %d\n", - (int)accelerators.drawDirection); - fprintf(stderr, "\tfontAscent = %d\n", (int)accelerators.fontAscent); - fprintf(stderr, "\tfontDescent = %d\n", (int)accelerators.fontDescent); - fprintf(stderr, "\tmaxOverlap = %d\n", (int)accelerators.maxOverlap); + fprintf(stderr, "\tnoOverlap = %" PRId8 "\n", (int8)accelerators.noOverlap); + fprintf(stderr, "\tconstantMetrics = %" PRId8 "\n", + (int8)accelerators.constantMetrics); + fprintf(stderr, "\tterminalFont = %" PRId8 "\n", + (int8)accelerators.terminalFont); + fprintf(stderr, "\tconstantWidth = %" PRId8 "\n", + (int8)accelerators.constantWidth); + fprintf(stderr, "\tinkInside = %" PRId8 "\n", (int8)accelerators.inkInside); + fprintf(stderr, "\tinkMetrics = %" PRId8 "\n", (int8)accelerators.inkMetrics); + fprintf(stderr, "\tdrawDirection = %" PRId8 "\n", + (int8)accelerators.drawDirection); + fprintf(stderr, "\tfontAscent = %" PRId8 "\n", (int8)accelerators.fontAscent); + fprintf(stderr, "\tfontDescent = %" PRId8 "\n", (int8)accelerators.fontDescent); + fprintf(stderr, "\tmaxOverlap = %" PRId8 "\n", (int8)accelerators.maxOverlap); } read_metric(&accelerators.minBounds); read_metric(&accelerators.maxBounds); @@ -667,7 +671,7 @@ } else if (verbose) - fprintf(stderr, "%ld\n", props[i].value.v); + fprintf(stderr, "%" PRId32 "\n", props[i].value.v); } // read old accelerators section @@ -711,7 +715,7 @@ break; } if (verbose) - fprintf(stderr, "\tnMetrics = %ld\n", nMetrics); + fprintf(stderr, "\tnMetrics = %" PRId32 "\n", nMetrics); fontbbx = metrics[0]; for (i = 1; i < nMetrics; i++) { @@ -746,10 +750,10 @@ // if (verbose) { - fprintf(stderr, "\t1<