diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-16 08:58:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-16 08:58:17 +0100 |
commit | 3b425b8bf0c58e25da576ed86496171ea19240f9 (patch) | |
tree | 37d6feb715dd929392fb16fdde6cf994dfbc1397 /object/print.c | |
parent | 49132f70ac40b2dc7b9a0e22b33a3964af687874 (diff) | |
download | mupdf-3b425b8bf0c58e25da576ed86496171ea19240f9.tar.xz |
removed c99-isms. improved bbox handling.
Diffstat (limited to 'object/print.c')
-rw-r--r-- | object/print.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/object/print.c b/object/print.c index 520e53b9..8c756f30 100644 --- a/object/print.c +++ b/object/print.c @@ -73,7 +73,7 @@ static void fmtstr(struct fmt *fmt, fz_obj *obj) fmtputc(fmt, '('); for (i = 0; i < obj->u.s.len; i++) { - c = obj->u.s.buf[i]; + c = (unsigned char) obj->u.s.buf[i]; if (c == '\n') fmtputs(fmt, "\\n"); else if (c == '\r') @@ -93,9 +93,6 @@ static void fmtstr(struct fmt *fmt, fz_obj *obj) fmtputc(fmt, '\\'); sprintf(buf, "%o", c); fmtputs(fmt, buf); - //fmtputc(fmt, ((c >> 6) & 7) + '0'); - //fmtputc(fmt, ((c >> 3) & 7) + '0'); - //fmtputc(fmt, ((c) & 7) + '0'); } else fmtputc(fmt, c); @@ -106,13 +103,15 @@ static void fmtstr(struct fmt *fmt, fz_obj *obj) static void fmthex(struct fmt *fmt, fz_obj *obj) { int i; + int b; int c; fmtputc(fmt, '<'); for (i = 0; i < obj->u.s.len; i++) { - c = (obj->u.s.buf[i] >> 4) & 0x0f; + b = (unsigned char) obj->u.s.buf[i]; + c = (b >> 4) & 0x0f; fmtputc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA); - c = (obj->u.s.buf[i]) & 0x0f; + c = (b) & 0x0f; fmtputc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA); } fmtputc(fmt, '>'); |