From 6f1b843c87395c617f48793607797face574a188 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Fri, 14 Nov 2003 16:48:57 +0000 Subject: XFree86 4.3.0.1 --- header.c | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'header.c') diff --git a/header.c b/header.c index 2d99839..291ba01 100644 --- a/header.c +++ b/header.c @@ -43,12 +43,16 @@ in this Software without prior written authorization from The Open Group. * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF * THIS SOFTWARE. */ +/* $XFree86: xc/programs/fstobdf/header.c,v 3.7 2001/12/14 20:00:46 dawes Exp $ */ #include -#include "FSlib.h" +#include +#include +#include +#include "fstobdf.h" -long pointSize; -long yResolution; +unsigned long pointSize; +unsigned long yResolution; static char *warning[] = { @@ -63,12 +67,11 @@ static char *warning[] = }; static char * -FindStringProperty(propName, propLength, propInfo, propOffsets, propData) - char *propName; - int *propLength; - FSPropInfo *propInfo; - FSPropOffset *propOffsets; - unsigned char *propData; +FindStringProperty(char *propName, + int *propLength, + FSPropInfo *propInfo, + FSPropOffset *propOffsets, + unsigned char *propData) { FSPropOffset *propOffset; int length; @@ -90,7 +93,7 @@ FindStringProperty(propName, propLength, propInfo, propOffsets, propData) #endif if ((propOffset->name.length == length) && - !strncmp(propData + propOffset->name.position, propName, length)) { + !strncmp((char*)propData + propOffset->name.position, propName, length)) { *propLength = propOffset->value.length; return (char *)(propData + propOffset->value.position); } @@ -101,12 +104,11 @@ FindStringProperty(propName, propLength, propInfo, propOffsets, propData) } static int -FindNumberProperty(propName, propValue, propInfo, propOffsets, propData) - char *propName; - int *propValue; - FSPropInfo *propInfo; - FSPropOffset *propOffsets; - unsigned char *propData; +FindNumberProperty(char *propName, + unsigned long *propValue, + FSPropInfo *propInfo, + FSPropOffset *propOffsets, + unsigned char *propData) { FSPropOffset *propOffset; int i; @@ -118,7 +120,7 @@ FindNumberProperty(propName, propValue, propInfo, propOffsets, propData) if ((propOffset->type == PropTypeSigned) || (propOffset->type == PropTypeUnsigned)) { if ((propOffset->name.length == length) && - !strncmp(propData + propOffset->name.position, propName, length)) { + !strncmp((char*)propData + propOffset->name.position, propName, length)) { *propValue = propOffset->value.position; return (propOffset->type); } @@ -132,12 +134,11 @@ FindNumberProperty(propName, propValue, propInfo, propOffsets, propData) * FONTBOUNDINGBOX lines */ Bool -EmitHeader(outFile, fontHeader, propInfo, propOffsets, propData) - FILE *outFile; - FSXFontInfoHeader *fontHeader; - FSPropInfo *propInfo; - FSPropOffset *propOffsets; - unsigned char *propData; +EmitHeader(FILE *outFile, + FSXFontInfoHeader *fontHeader, + FSPropInfo *propInfo, + FSPropOffset *propOffsets, + unsigned char *propData) { int len; int type; @@ -196,7 +197,8 @@ EmitHeader(outFile, fontHeader, propInfo, propOffsets, propData) pointSize = ((fontHeader->font_ascent + fontHeader->font_descent) * 72) / yResolution; - fprintf(outFile, "SIZE %d %d %d\n", pointSize, xResolution, yResolution); + fprintf(outFile, "SIZE %lu %lu %lu\n", pointSize, xResolution, + yResolution); /* * FONTBOUNDINGBOX width height xoff yoff -- cgit v1.2.3