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 /raster | |
parent | 704339802c88bc470187bd77c4680d19108dab0b (diff) | |
download | mupdf-d96fc32d1dcae224b320918c96153574fbd5ed5e.tar.xz |
Adhere to common idiom when not encoundering error.
Diffstat (limited to 'raster')
-rw-r--r-- | raster/glyphcache.c | 8 | ||||
-rw-r--r-- | raster/imagescale.c | 4 | ||||
-rw-r--r-- | raster/meshdraw.c | 2 | ||||
-rw-r--r-- | raster/pathfill.c | 2 | ||||
-rw-r--r-- | raster/pathscan.c | 18 | ||||
-rw-r--r-- | raster/pathstroke.c | 28 | ||||
-rw-r--r-- | raster/pixmap.c | 4 | ||||
-rw-r--r-- | raster/render.c | 30 |
8 files changed, 48 insertions, 48 deletions
diff --git a/raster/glyphcache.c b/raster/glyphcache.c index 41de3b73..e2d93bc9 100644 --- a/raster/glyphcache.c +++ b/raster/glyphcache.c @@ -91,7 +91,7 @@ fz_newglyphcache(fz_glyphcache **arenap, int slots, int size) arena->load = 0; arena->used = 0; - return nil; + return fz_okay; cleanup: fz_free(arena->hash); @@ -344,7 +344,7 @@ fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz ghits++; - return nil; + return fz_okay; } gmisses++; @@ -359,7 +359,7 @@ fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz size = glyph->w * glyph->h; if (size > arena->size / 6) - return nil; + return fz_okay; while (arena->load > arena->slots * 75 / 100) { @@ -388,6 +388,6 @@ fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz hashinsert(arena, &key, val); - return nil; + return fz_okay; } diff --git a/raster/imagescale.c b/raster/imagescale.c index 7010b691..f7eedeef 100644 --- a/raster/imagescale.c +++ b/raster/imagescale.c @@ -268,7 +268,7 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde } fz_free(buf); - return nil; + return fz_okay; } fz_error * @@ -353,6 +353,6 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) fz_free(buf); *dstp = dst; - return nil; + return fz_okay; } diff --git a/raster/meshdraw.c b/raster/meshdraw.c index 2c6d2c99..abdcaaa1 100644 --- a/raster/meshdraw.c +++ b/raster/meshdraw.c @@ -403,6 +403,6 @@ fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap fz_droppixmap(temp); } - return nil; + return fz_okay; } diff --git a/raster/pathfill.c b/raster/pathfill.c index e361b9a5..3040e6a3 100644 --- a/raster/pathfill.c +++ b/raster/pathfill.c @@ -129,6 +129,6 @@ fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness) return error; } - return nil; + return fz_okay; } diff --git a/raster/pathscan.c b/raster/pathscan.c index 62f60fa1..67ff0456 100644 --- a/raster/pathscan.c +++ b/raster/pathscan.c @@ -37,7 +37,7 @@ fz_newgel(fz_gel **gelp) gel->bbox.x0 = gel->bbox.y0 = INT_MAX; gel->bbox.x1 = gel->bbox.y1 = INT_MIN; - return nil; + return fz_okay; } void @@ -125,17 +125,17 @@ fz_insertgel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1) int y1 = fz_floor(fy1 * VSCALE); d = cliplerpy(gel->clip.y0, 0, x0, y0, x1, y1, &v); - if (d == OUTSIDE) return nil; + if (d == OUTSIDE) return fz_okay; if (d == LEAVE) { y1 = gel->clip.y0; x1 = v; } if (d == ENTER) { y0 = gel->clip.y0; x0 = v; } d = cliplerpy(gel->clip.y1, 1, x0, y0, x1, y1, &v); - if (d == OUTSIDE) return nil; + if (d == OUTSIDE) return fz_okay; if (d == LEAVE) { y1 = gel->clip.y1; x1 = v; } if (d == ENTER) { y0 = gel->clip.y1; x0 = v; } if (y0 == y1) - return nil; + return fz_okay; if (y0 > y1) { winding = -1; @@ -193,7 +193,7 @@ fz_insertgel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1) edge->adjup = width % dy; } - return nil; + return fz_okay; } void @@ -254,7 +254,7 @@ fz_newael(fz_ael **aelp) return fz_outofmem; } - return nil; + return fz_okay; } void @@ -316,7 +316,7 @@ insertael(fz_ael *ael, fz_gel *gel, int y, int *e) /* shell-sort the edges by increasing x */ sortael(ael->edges, ael->len); - return nil; + return fz_okay; } static void @@ -473,7 +473,7 @@ fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill, fz_irect clip, assert(clip.x1 <= xmax); if (gel->len == 0) - return nil; + return fz_okay; deltas = fz_malloc(xmax - xmin + 1); if (!deltas) @@ -526,6 +526,6 @@ fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill, fz_irect clip, } fz_free(deltas); - return nil; + return fz_okay; } diff --git a/raster/pathstroke.c b/raster/pathstroke.c index cafcd663..0143742c 100644 --- a/raster/pathstroke.c +++ b/raster/pathstroke.c @@ -82,7 +82,7 @@ arc(struct sctx *s, error = line(s, xc + ox, yc + oy, xc + x1, yc + y1); if (error) return error; - return nil; + return fz_okay; } static fz_error * @@ -102,7 +102,7 @@ linestroke(struct sctx *s, fz_point a, fz_point b) error = line(s, b.x + dlx, b.y + dly, a.x + dlx, a.y + dly); if (error) return error; - return nil; + return fz_okay; } static fz_error * @@ -128,9 +128,9 @@ linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c) dy1 = c.y - b.y; if (dx0 * dx0 + dy0 * dy0 < FLT_EPSILON) - return nil; + return fz_okay; if (dx1 * dx1 + dy1 * dy1 < FLT_EPSILON) - return nil; + return fz_okay; scale = linewidth / sqrt(dx0 * dx0 + dy0 * dy0); dlx0 = dy0 * scale; @@ -205,7 +205,7 @@ linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c) } } - return nil; + return fz_okay; } static fz_error * @@ -265,7 +265,7 @@ linecap(struct sctx *s, fz_point a, fz_point b) if (error) return error; } - return nil; + return fz_okay; } static fz_error * @@ -292,7 +292,7 @@ linedot(struct sctx *s, fz_point a) } error = line(s, ox, oy, a.x - linewidth, a.y); if (error) return error; - return nil; + return fz_okay; } static fz_error * @@ -315,7 +315,7 @@ strokeflush(struct sctx *s) s->dot = 0; - return nil; + return fz_okay; } static fz_error * @@ -331,7 +331,7 @@ strokemoveto(struct sctx *s, fz_point cur) s->sn = 1; s->bn = 1; - return nil; + return fz_okay; } static fz_error * @@ -345,7 +345,7 @@ strokelineto(struct sctx *s, fz_point cur) if (dx * dx + dy * dy < s->flatness * s->flatness * 0.25) { s->dot = 1; - return nil; + return fz_okay; } error = linestroke(s, s->seg[s->sn-1], cur); @@ -365,7 +365,7 @@ strokelineto(struct sctx *s, fz_point cur) if (s->bn == 1) s->beg[s->bn++] = cur; - return nil; + return fz_okay; } static fz_error * @@ -395,7 +395,7 @@ strokeclosepath(struct sctx *s) s->sn = 0; s->dot = 0; - return nil; + return fz_okay; } static fz_error * @@ -546,7 +546,7 @@ dashmoveto(struct sctx *s, fz_point a) if (s->toggle) return strokemoveto(s, a); - return nil; + return fz_okay; } static fz_error * @@ -592,7 +592,7 @@ dashlineto(struct sctx *s, fz_point b) if (s->toggle) return strokelineto(s, b); - return nil; + return fz_okay; } static fz_error * diff --git a/raster/pixmap.c b/raster/pixmap.c index 74e2f59a..cec36014 100644 --- a/raster/pixmap.c +++ b/raster/pixmap.c @@ -23,7 +23,7 @@ fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n) return fz_outofmem; } - return nil; + return fz_okay; } fz_error * @@ -43,7 +43,7 @@ fz_newpixmapcopy(fz_pixmap **pixp, fz_pixmap *old) if (error) return error; memcpy((*pixp)->samples, old->samples, old->w * old->h * old->n); - return nil; + return fz_okay; } void diff --git a/raster/render.c b/raster/render.c index 596bedab..a7c2e2f5 100644 --- a/raster/render.c +++ b/raster/render.c @@ -57,7 +57,7 @@ fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem) gc->flag = 0; *gcp = gc; - return nil; + return fz_okay; cleanup: if (gc->model) fz_dropcolorspace(gc->model); @@ -171,7 +171,7 @@ DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc } } - return nil; + return fz_okay; } /* @@ -218,7 +218,7 @@ renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm) clip = fz_intersectirects(gc->clip, gbox); if (fz_isemptyrect(clip)) - return nil; + return fz_okay; DEBUG("path %s;\n", path->paint == FZ_STROKE ? "stroke" : "fill"); @@ -321,7 +321,7 @@ text->font->name, text->len, text->trm.a, text->trm.b, text->trm.c, text->trm.d); if (fz_isemptyrect(clip)) - return nil; + return fz_okay; if (!(gc->flag & FOVER)) { @@ -354,7 +354,7 @@ text->trm.a, text->trm.b, text->trm.c, text->trm.d); drawglyph(gc, gc->over, &glyph, x, y); } - return nil; + return fz_okay; } /* @@ -405,7 +405,7 @@ DEBUG("image %dx%d %d+%d %s\n{\n", image->w, image->h, image->n, image->a, image clip = fz_intersectirects(gc->clip, bbox); if (fz_isemptyrect(clip)) - return nil; + return fz_okay; calcimagescale(ctm, image->w, image->h, &dx, &dy); @@ -543,7 +543,7 @@ DEBUG(" fover+rgb %d x %d\n", w, h); DEBUG("}\n"); fz_droppixmap(tile); - return nil; + return fz_okay; cleanup1: fz_droppixmap(temp); @@ -715,7 +715,7 @@ else DEBUG("over\n{\n"); DEBUG("}\n"); - return nil; + return fz_okay; } static fz_error * @@ -772,7 +772,7 @@ rendermask(fz_renderer *gc, fz_masknode *mask, fz_matrix ctm) clip = fz_intersectirects(bbox, clip); if (fz_isemptyrect(clip)) - return nil; + return fz_okay; DEBUG("mask [%d %d %d %d]\n{\n", clip.x0, clip.y0, clip.x1, clip.y1); @@ -830,7 +830,7 @@ DEBUG("}\n"); if (shapepix) fz_droppixmap(shapepix); if (colorpix) fz_droppixmap(colorpix); - return nil; + return fz_okay; cleanup: if (shapepix) fz_droppixmap(shapepix); @@ -846,7 +846,7 @@ static fz_error * rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm) { if (!node) - return nil; + return fz_okay; gc->flag = FNONE; if (gc->over) @@ -875,10 +875,10 @@ rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm) case FZ_NMETA: return rendernode(gc, node->first, ctm); case FZ_NBLEND: - return nil; + return fz_okay; } - return nil; + return fz_okay; } fz_error * @@ -923,7 +923,7 @@ DEBUG("}\n"); *outp = gc->over; gc->over = nil; - return nil; + return fz_okay; } fz_error * @@ -957,6 +957,6 @@ fz_rendertreeover(fz_renderer *gc, fz_pixmap *dest, fz_tree *tree, fz_matrix ctm gc->over = nil; - return nil; + return fz_okay; } |