summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-02-02 12:01:57 +0000
committerTor Andersson <tor@ghostscript.com>2011-02-02 12:01:57 +0000
commitc2da983137c7b0d9eadfab5705e7cc1bc90f7ca1 (patch)
tree25db39bc1f81a839794400f47ad587540247b9e6
parent77004fc96a2b2c429853d8be91aa8ac3e71e156f (diff)
downloadmupdf-c2da983137c7b0d9eadfab5705e7cc1bc90f7ca1.tar.xz
Remove pdf_token_e typedef since the list of tokens is extended by individual parsers, resulting in compiler warnings.
-rw-r--r--fitz/filt_faxd.c6
-rw-r--r--mupdf/mupdf.h12
-rw-r--r--mupdf/pdf_cmap_parse.c22
-rw-r--r--mupdf/pdf_function.c4
-rw-r--r--mupdf/pdf_interpret.c2
-rw-r--r--mupdf/pdf_lex.c6
-rw-r--r--mupdf/pdf_parse.c8
-rw-r--r--mupdf/pdf_repair.c6
-rw-r--r--mupdf/pdf_xref.c6
9 files changed, 36 insertions, 36 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index b1cd3b30..5da826ae 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -276,14 +276,14 @@ setbits(unsigned char *line, int x0, int x1)
typedef struct fz_faxd_s fz_faxd;
-typedef enum fax_stage_e
+enum
{
SNORMAL, /* neutral state, waiting for any code */
SMAKEUP, /* got a 1d makeup code, waiting for terminating code */
SEOL, /* at eol, needs output buffer space */
SH1, SH2, /* in H part 1 and 2 (both makeup and terminating codes) */
SDONE /* all done */
-} fax_stage_e;
+};
struct fz_faxd_s
{
@@ -303,7 +303,7 @@ struct fz_faxd_s
int bidx;
unsigned int word;
- fax_stage_e stage;
+ int stage;
int a, c, dim, eolc;
unsigned char *ref;
diff --git a/mupdf/mupdf.h b/mupdf/mupdf.h
index 5edd40c0..9b8c6111 100644
--- a/mupdf/mupdf.h
+++ b/mupdf/mupdf.h
@@ -18,7 +18,7 @@ void pdf_logpage(char *fmt, ...);
* tokenizer and low-level object parser
*/
-typedef enum pdf_token_e
+enum
{
PDF_TERROR, PDF_TEOF,
PDF_TOARRAY, PDF_TCARRAY,
@@ -30,10 +30,10 @@ typedef enum pdf_token_e
PDF_TSTREAM, PDF_TENDSTREAM,
PDF_TXREF, PDF_TTRAILER, PDF_TSTARTXREF,
PDF_NTOKENS
-} pdf_token_e;
+};
/* lex.c */
-fz_error pdf_lex(pdf_token_e *tok, fz_stream *f, char *buf, int n, int *len);
+fz_error pdf_lex(int *tok, fz_stream *f, char *buf, int n, int *len);
/* parse.c */
fz_error pdf_parsearray(fz_obj **op, pdf_xref *xref, fz_stream *f, char *buf, int cap);
@@ -65,17 +65,17 @@ fz_obj *pdf_toutf8name(fz_obj *src);
typedef struct pdf_crypt_s pdf_crypt;
typedef struct pdf_cryptfilter_s pdf_cryptfilter;
-typedef enum pdf_cryptmethod_e
+enum
{
PDF_CRYPT_NONE,
PDF_CRYPT_RC4,
PDF_CRYPT_AESV2,
PDF_CRYPT_UNKNOWN,
-} pdf_cryptmethod;
+};
struct pdf_cryptfilter_s
{
- pdf_cryptmethod method;
+ int method;
int length;
unsigned char key[16];
};
diff --git a/mupdf/pdf_cmap_parse.c b/mupdf/pdf_cmap_parse.c
index 5c2b9007..d899af0e 100644
--- a/mupdf/pdf_cmap_parse.c
+++ b/mupdf/pdf_cmap_parse.c
@@ -21,7 +21,7 @@ enum
TENDCMAP
};
-static pdf_token_e
+static int
pdf_cmaptokenfromkeyword(char *key)
{
if (!strcmp(key, "usecmap")) return TUSECMAP;
@@ -49,7 +49,7 @@ pdf_codefromstring(char *buf, int len)
}
static fz_error
-pdf_lexcmap(pdf_token_e *tok, fz_stream *file, char *buf, int n, int *sl)
+pdf_lexcmap(int *tok, fz_stream *file, char *buf, int n, int *sl)
{
fz_error error;
@@ -68,7 +68,7 @@ pdf_parsecmapname(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
error = pdf_lexcmap(&tok, file, buf, sizeof buf, &len);
@@ -88,7 +88,7 @@ pdf_parsewmode(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
error = pdf_lexcmap(&tok, file, buf, sizeof buf, &len);
@@ -108,7 +108,7 @@ pdf_parsecodespacerange(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int lo, hi;
@@ -146,7 +146,7 @@ pdf_parsecidrange(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int lo, hi, dst;
@@ -189,7 +189,7 @@ pdf_parsecidchar(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int src, dst;
@@ -224,7 +224,7 @@ pdf_parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int hi)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int dst[256];
int i;
@@ -259,7 +259,7 @@ pdf_parsebfrange(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int lo, hi, dst;
@@ -335,7 +335,7 @@ pdf_parsebfchar(pdf_cmap *cmap, fz_stream *file)
{
fz_error error;
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
int dst[256];
int src;
@@ -378,7 +378,7 @@ pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file)
pdf_cmap *cmap;
char key[64];
char buf[256];
- pdf_token_e tok;
+ int tok;
int len;
cmap = pdf_newcmap();
diff --git a/mupdf/pdf_function.c b/mupdf/pdf_function.c
index df28b3c5..4aa4f23b 100644
--- a/mupdf/pdf_function.c
+++ b/mupdf/pdf_function.c
@@ -359,7 +359,7 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr)
fz_error error;
char buf[64];
int len;
- pdf_token_e tok;
+ int tok;
int opptr, elseptr, ifptr;
int a, b, mid, cmp;
@@ -502,7 +502,7 @@ loadpostscriptfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict, int num, in
fz_stream *stream;
int codeptr;
char buf[64];
- pdf_token_e tok;
+ int tok;
int len;
pdf_logrsrc("load postscript function (%d %d R)\n", num, gen);
diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c
index 1d62bba1..3d1fdd9f 100644
--- a/mupdf/pdf_interpret.c
+++ b/mupdf/pdf_interpret.c
@@ -1350,7 +1350,7 @@ static fz_error
pdf_runcsifile(pdf_csi *csi, fz_obj *rdb, fz_stream *file, char *buf, int buflen)
{
fz_error error;
- pdf_token_e tok;
+ int tok;
int len;
fz_obj *obj;
diff --git a/mupdf/pdf_lex.c b/mupdf/pdf_lex.c
index 16e12a13..6b2f26e4 100644
--- a/mupdf/pdf_lex.c
+++ b/mupdf/pdf_lex.c
@@ -72,7 +72,7 @@ lexcomment(fz_stream *f)
}
static int
-lexnumber(fz_stream *f, char *s, int n, pdf_token_e *tok)
+lexnumber(fz_stream *f, char *s, int n, int *tok)
{
char *buf = s;
*tok = PDF_TINT;
@@ -347,7 +347,7 @@ end:
return s - buf;
}
-static pdf_token_e
+static int
pdf_tokenfromkeyword(char *key)
{
switch (*key)
@@ -387,7 +387,7 @@ pdf_tokenfromkeyword(char *key)
}
fz_error
-pdf_lex(pdf_token_e *tok, fz_stream *f, char *buf, int n, int *sl)
+pdf_lex(int *tok, fz_stream *f, char *buf, int n, int *sl)
{
while (1)
{
diff --git a/mupdf/pdf_parse.c b/mupdf/pdf_parse.c
index 8f47fe8e..f4a6e097 100644
--- a/mupdf/pdf_parse.c
+++ b/mupdf/pdf_parse.c
@@ -114,7 +114,7 @@ pdf_parsearray(fz_obj **op, pdf_xref *xref, fz_stream *file, char *buf, int cap)
fz_obj *ary = nil;
fz_obj *obj = nil;
int a = 0, b = 0, n = 0;
- pdf_token_e tok;
+ int tok;
int len;
ary = fz_newarray(4);
@@ -247,7 +247,7 @@ pdf_parsedict(fz_obj **op, pdf_xref *xref, fz_stream *file, char *buf, int cap)
fz_obj *dict = nil;
fz_obj *key = nil;
fz_obj *val = nil;
- pdf_token_e tok;
+ int tok;
int len;
int a, b;
@@ -373,7 +373,7 @@ fz_error
pdf_parsestmobj(fz_obj **op, pdf_xref *xref, fz_stream *file, char *buf, int cap)
{
fz_error error;
- pdf_token_e tok;
+ int tok;
int len;
error = pdf_lex(&tok, file, buf, cap, &len);
@@ -413,7 +413,7 @@ pdf_parseindobj(fz_obj **op, pdf_xref *xref,
fz_error error = fz_okay;
fz_obj *obj = nil;
int num = 0, gen = 0, stmofs;
- pdf_token_e tok;
+ int tok;
int len;
int a, b;
diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c
index 4705c350..b20846ff 100644
--- a/mupdf/pdf_repair.c
+++ b/mupdf/pdf_repair.c
@@ -16,7 +16,7 @@ static fz_error
fz_repairobj(fz_stream *file, char *buf, int cap, int *stmofsp, int *stmlenp, fz_obj **encrypt, fz_obj **id)
{
fz_error error;
- pdf_token_e tok;
+ int tok;
int stmlen;
int len;
int n;
@@ -131,7 +131,7 @@ pdf_repairobjstm(pdf_xref *xref, int num, int gen)
fz_error error;
fz_obj *obj;
fz_stream *stm;
- pdf_token_e tok;
+ int tok;
int i, n, count;
char buf[256];
@@ -197,7 +197,7 @@ pdf_repairxref(pdf_xref *xref, char *buf, int bufsize)
int gen = 0;
int tmpofs, numofs = 0, genofs = 0;
int stmlen, stmofs = 0;
- pdf_token_e tok;
+ int tok;
int next;
int i, n;
diff --git a/mupdf/pdf_xref.c b/mupdf/pdf_xref.c
index 940963a5..ca675f1a 100644
--- a/mupdf/pdf_xref.c
+++ b/mupdf/pdf_xref.c
@@ -75,7 +75,7 @@ pdf_readoldtrailer(pdf_xref *xref, char *buf, int cap)
char *s;
int n;
int t;
- pdf_token_e tok;
+ int tok;
int c;
pdf_logxref("load old xref format trailer\n");
@@ -199,7 +199,7 @@ pdf_readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap)
int ofs, len;
char *s;
int n;
- pdf_token_e tok;
+ int tok;
int i;
int c;
@@ -704,7 +704,7 @@ pdf_loadobjstm(pdf_xref *xref, int num, int gen, char *buf, int cap)
int first;
int count;
int i, n;
- pdf_token_e tok;
+ int tok;
pdf_logxref("loadobjstm (%d %d R)\n", num, gen);