summaryrefslogtreecommitdiff
path: root/header.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
commit3e85e18c6e30520be07f9369866d8116ecb0fd87 (patch)
tree9824ebf56b6f54fa1c60ceb6113c7fcacd7cee5f /header.c
parent33b0317bc68027d8814f264a45eaf19c68270cd3 (diff)
merge XFree86 4.3.0.1 to -CURRENT
Diffstat (limited to 'header.c')
-rw-r--r--header.c50
1 files changed, 26 insertions, 24 deletions
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 <stdio.h>
-#include "FSlib.h"
+#include <X11/Xosdefs.h>
+#include <stdlib.h>
+#include <string.h>
+#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