diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2008-04-20 12:20:52 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2008-04-20 12:20:52 +0200 |
commit | d96fc32d1dcae224b320918c96153574fbd5ed5e (patch) | |
tree | d9d972a39fc66f998059b585240ed43d395e07ef /stream | |
parent | 704339802c88bc470187bd77c4680d19108dab0b (diff) | |
download | mupdf-d96fc32d1dcae224b320918c96153574fbd5ed5e.tar.xz |
Adhere to common idiom when not encoundering error.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/filt_rle.c | 12 | ||||
-rw-r--r-- | stream/obj_dict.c | 4 | ||||
-rw-r--r-- | stream/obj_parse.c | 6 | ||||
-rw-r--r-- | stream/stm_open.c | 2 | ||||
-rw-r--r-- | stream/stm_read.c | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/stream/filt_rle.c b/stream/filt_rle.c index 458bf3ba..021c3ecf 100644 --- a/stream/filt_rle.c +++ b/stream/filt_rle.c @@ -63,7 +63,7 @@ fprintf(stderr, "one '%c'\n", enc->buf[0]); *out->wp++ = 0; *out->wp++ = enc->buf[0]; - return nil; + return fz_okay; } static fz_error * @@ -78,7 +78,7 @@ fprintf(stderr, "same %d x '%c'\n", enc->run, enc->buf[0]); *out->wp++ = 257 - enc->run; *out->wp++ = enc->buf[0]; - return nil; + return fz_okay; } static fz_error * @@ -95,7 +95,7 @@ fprintf(stderr, "diff %d\n", enc->run); *out->wp++ = enc->run - 1; for (i = 0; i < enc->run; i++) *out->wp++ = enc->buf[i]; - return nil; + return fz_okay; } static fz_error * @@ -109,7 +109,7 @@ fprintf(stderr, "eod\n"); #endif *out->wp++ = 128; - return nil; + return fz_okay; } static fz_error * @@ -117,12 +117,12 @@ savebuf(fz_rle *enc, fz_buffer *in, fz_buffer *out) { switch (enc->state) { - case ZERO: return nil; + case ZERO: return fz_okay; case ONE: return putone(enc, in, out); case SAME: return putsame(enc, in, out); case DIFF: return putdiff(enc, in, out); case END: return puteod(enc, in, out); - default: assert(!"invalid state in rle"); return nil; + default: assert(!"invalid state in rle"); return fz_okay; } } diff --git a/stream/obj_dict.c b/stream/obj_dict.c index a3366170..236c8a1a 100644 --- a/stream/obj_dict.c +++ b/stream/obj_dict.c @@ -53,7 +53,7 @@ fz_newdict(fz_obj **op, int initialcap) obj->u.d.items[i].v = nil; } - return nil; + return fz_okay; } fz_error * @@ -331,7 +331,7 @@ fz_dictputs(fz_obj *obj, char *key, fz_obj *val) fz_dropobj(keyobj); if (error) return fz_rethrow(error, "cannot insert dict entry"); - return nil; + return fz_okay; } fz_error * diff --git a/stream/obj_parse.c b/stream/obj_parse.c index 8f43a064..48d59538 100644 --- a/stream/obj_parse.c +++ b/stream/obj_parse.c @@ -108,7 +108,7 @@ static fz_error *parsenumber(fz_obj **obj, char **sp) static fz_error *parsedict(fz_obj **obj, char **sp, struct vap *v) { - fz_error *error = nil; + fz_error *error = fz_okay; fz_obj *dict = nil; fz_obj *key = nil; fz_obj *val = nil; @@ -349,7 +349,7 @@ static fz_error *parseobj(fz_obj **obj, char **sp, struct vap *v) skipwhite(&s); - error = nil; + error = fz_okay; if (v != nil && *s == '%') { @@ -481,7 +481,7 @@ fz_packobj(fz_obj **op, char *fmt, ...) if (error) return fz_rethrow(error, "cannot parse object"); - return nil; + return fz_okay; } fz_error * diff --git a/stream/stm_open.c b/stream/stm_open.c index c10d1509..908b1a7b 100644 --- a/stream/stm_open.c +++ b/stream/stm_open.c @@ -18,7 +18,7 @@ newstm(int kind, int mode) stm->kind = kind; stm->mode = mode; stm->dead = 0; - stm->error = nil; + stm->error = fz_okay; stm->buffer = nil; stm->chain = nil; diff --git a/stream/stm_read.c b/stream/stm_read.c index 43bdb192..e0a6e8a1 100644 --- a/stream/stm_read.c +++ b/stream/stm_read.c @@ -269,7 +269,7 @@ fz_readerror(fz_stream *stm) if (stm->error) { error = stm->error; - stm->error = nil; + stm->error = fz_okay; return fz_rethrow(error, "delayed read error"); } return fz_okay; |