aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/bitmap/bdfread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/bitmap/bdfread.c')
-rw-r--r--libXfont/src/bitmap/bdfread.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/libXfont/src/bitmap/bdfread.c b/libXfont/src/bitmap/bdfread.c
index 2464c03cc..e2770dc1c 100644
--- a/libXfont/src/bitmap/bdfread.c
+++ b/libXfont/src/bitmap/bdfread.c
@@ -76,7 +76,7 @@ extern int bdfFileLineNum;
/***====================================================================***/
static Bool
-bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
+bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
int glyph, int scan, CARD32 *sizes)
{
int widthBits,
@@ -99,7 +99,7 @@ bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
if (widthBytes * height > 0) {
picture = malloc(widthBytes * height);
if (!picture) {
- bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height);
+ bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height);
goto BAILOUT;
}
} else
@@ -247,7 +247,7 @@ bdfFreeFontBits(FontPtr pFont)
static Bool
-bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
+bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
int bit, int byte, int glyph, int scan)
{
unsigned char *line;
@@ -291,13 +291,13 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
}
if (nchars > INT32_MAX / sizeof(CharInfoRec)) {
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
- sizeof(CharInfoRec));
+ (int) sizeof(CharInfoRec));
goto BAILOUT;
}
ci = calloc(nchars, sizeof(CharInfoRec));
if (!ci) {
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
- sizeof(CharInfoRec));
+ (int) sizeof(CharInfoRec));
goto BAILOUT;
}
bitmapFont->metrics = ci;
@@ -306,7 +306,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bitmapExtra->glyphNames = malloc(nchars * sizeof(Atom));
if (!bitmapExtra->glyphNames) {
bdfError("Couldn't allocate glyphNames (%d*%d)\n",
- nchars, sizeof(Atom));
+ nchars, (int) sizeof(Atom));
goto BAILOUT;
}
}
@@ -314,7 +314,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bitmapExtra->sWidths = malloc(nchars * sizeof(int));
if (!bitmapExtra->sWidths) {
bdfError("Couldn't allocate sWidth (%d *%d)\n",
- nchars, sizeof(int));
+ nchars, (int) sizeof(int));
return FALSE;
}
}
@@ -380,7 +380,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bdfEncoding[char_row] = malloc(256 * sizeof(CharInfoPtr));
if (!bdfEncoding[char_row]) {
bdfError("Couldn't allocate row %d of encoding (%d*%d)\n",
- char_row, INDICES, sizeof(CharInfoPtr));
+ char_row, INDICES, (int) sizeof(CharInfoPtr));
goto BAILOUT;
}
for (i = 0; i < 256; i++)
@@ -490,7 +490,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
if (!bitmapFont->encoding) {
bdfError("Couldn't allocate ppCI (%d,%d)\n",
NUM_SEGMENTS(nencoding),
- sizeof(CharInfoPtr*));
+ (int) sizeof(CharInfoPtr*));
goto BAILOUT;
}
pFont->info.allExist = TRUE;
@@ -515,7 +515,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)])
goto BAILOUT;
}
- ACCESSENCODINGL(bitmapFont->encoding,i) =
+ ACCESSENCODINGL(bitmapFont->encoding,i) =
bdfEncoding[char_row][char_col];
}
i++;
@@ -610,14 +610,14 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
pFont->info.isStringProp = stringProps;
if (stringProps == NULL) {
bdfError("Couldn't allocate stringProps (%d*%d)\n",
- (nProps + BDF_GENPROPS), sizeof(Bool));
+ (nProps + BDF_GENPROPS), (int) sizeof(Bool));
goto BAILOUT;
}
pFont->info.props = props = calloc(nProps + BDF_GENPROPS,
sizeof(FontPropRec));
if (props == NULL) {
bdfError("Couldn't allocate props (%d*%d)\n", nProps + BDF_GENPROPS,
- sizeof(FontPropRec));
+ (int) sizeof(FontPropRec));
goto BAILOUT;
}
@@ -782,7 +782,7 @@ bdfUnloadFont(FontPtr pFont)
}
int
-bdfReadFont(FontPtr pFont, FontFilePtr file,
+bdfReadFont(FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan)
{
bdfFileState state;
@@ -800,7 +800,8 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont = calloc(1, sizeof(BitmapFontRec));
if (!bitmapFont) {
- bdfError("Couldn't allocate bitmapFontRec (%d)\n", sizeof(BitmapFontRec));
+ bdfError("Couldn't allocate bitmapFontRec (%d)\n",
+ (int) sizeof(BitmapFontRec));
goto BAILOUT;
}
@@ -813,10 +814,11 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont->bitmapExtra = calloc(1, sizeof(BitmapExtraRec));
if (!bitmapFont->bitmapExtra) {
- bdfError("Couldn't allocate bitmapExtra (%d)\n", sizeof(BitmapExtraRec));
+ bdfError("Couldn't allocate bitmapExtra (%d)\n",
+ (int) sizeof(BitmapExtraRec));
goto BAILOUT;
}
-
+
bitmapFont->bitmapExtra->glyphNames = 0;
bitmapFont->bitmapExtra->sWidths = 0;
@@ -836,7 +838,7 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
cols = pFont->info.lastCol - pFont->info.firstCol + 1;
r = r - pFont->info.firstRow;
c = c - pFont->info.firstCol;
- bitmapFont->pDefault = ACCESSENCODING(bitmapFont->encoding,
+ bitmapFont->pDefault = ACCESSENCODING(bitmapFont->encoding,
r * cols + c);
}
}
@@ -859,7 +861,7 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bdfError("Failed to add bitmap ink metrics\n");
goto BAILOUT;
}
- }
+ }
if (bitmapFont->bitmapExtra)
bitmapFont->bitmapExtra->info.inkMetrics = pFont->info.inkMetrics;
@@ -924,7 +926,7 @@ bdfPadToTerminal(FontPtr pFont)
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- bzero(&new, sizeof(CharInfoRec));
+ bzero(&new, sizeof(CharInfoRec));
new.metrics.ascent = pFont->info.fontAscent;
new.metrics.descent = pFont->info.fontDescent;
new.metrics.leftSideBearing = 0;