diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2010-12-30 15:43:42 +0000 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2010-12-30 15:43:42 +0000 |
commit | 559252258781ed2f0eecd34d16a7b84ec52c0e21 (patch) | |
tree | 3efbcada2f2e940f44f5212b595503d52e0e8fd4 /fitz | |
parent | 6e2a8f21f83b87bbf0530d92f809a3aea6aba724 (diff) | |
download | mupdf-559252258781ed2f0eecd34d16a7b84ec52c0e21.tar.xz |
Adhere to nil idiom.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/base_string.c | 4 | ||||
-rw-r--r-- | fitz/dev_draw.c | 22 | ||||
-rw-r--r-- | fitz/res_colorspace.c | 8 | ||||
-rw-r--r-- | fitz/res_font.c | 8 | ||||
-rw-r--r-- | fitz/res_pixmap.c | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/fitz/base_string.c b/fitz/base_string.c index 4b1553ad..30d544d5 100644 --- a/fitz/base_string.c +++ b/fitz/base_string.c @@ -11,8 +11,8 @@ char * fz_strsep(char **stringp, const char *delim) { char *ret = *stringp; - if (ret == NULL) return NULL; - if ((*stringp = strpbrk(*stringp, delim)) != NULL) + if (ret == nil) return nil; + if ((*stringp = strpbrk(*stringp, delim)) != nil) *((*stringp)++) = '\0'; return ret; } diff --git a/fitz/dev_draw.c b/fitz/dev_draw.c index 02930d8b..439c4115 100644 --- a/fitz/dev_draw.c +++ b/fitz/dev_draw.c @@ -544,8 +544,8 @@ fz_smoothtransformpixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, { /* Unrotated or X flip or Yflip or XYflip */ scaled = fz_smoothscalepixmap(image, ctm->e, ctm->f, ctm->a, ctm->d); - if (scaled == NULL) - return NULL; + if (scaled == nil) + return nil; ctm->a = scaled->w; ctm->d = scaled->h; ctm->e = scaled->x; @@ -556,8 +556,8 @@ fz_smoothtransformpixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, { /* Other orthogonal flip/rotation cases */ scaled = fz_smoothscalepixmap(image, ctm->f, ctm->e, ctm->b, ctm->c); - if (scaled == NULL) - return NULL; + if (scaled == nil) + return nil; ctm->b = scaled->w; ctm->c = scaled->h; ctm->f = scaled->x; @@ -570,7 +570,7 @@ fz_smoothtransformpixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, scaled = fz_smoothscalepixmap(image, 0, 0, (float)dx, (float)dy); return scaled; } - return NULL; + return nil; } static void @@ -604,7 +604,7 @@ fz_drawfillimage(void *user, fz_pixmap *image, fz_matrix ctm, float alpha) if (dx < image->w && dy < image->h) { scaled = fz_smoothtransformpixmap(image, &ctm, dev->dest->x, dev->dest->y, dx, dy); - if (scaled == NULL) + if (scaled == nil) { if (dx < 1) dx = 1; @@ -612,7 +612,7 @@ fz_drawfillimage(void *user, fz_pixmap *image, fz_matrix ctm, float alpha) dy = 1; scaled = fz_smoothscalepixmap(image, image->x, image->y, dx, dy); } - if (scaled != NULL) + if (scaled != nil) image = scaled; } #else @@ -652,7 +652,7 @@ fz_drawfillimagemask(void *user, fz_pixmap *image, fz_matrix ctm, if (dx < image->w && dy < image->h) { scaled = fz_smoothtransformpixmap(image, &ctm, dev->dest->x, dev->dest->y, dx, dy); - if (scaled == NULL) + if (scaled == nil) { if (dx < 1) dx = 1; @@ -660,7 +660,7 @@ fz_drawfillimagemask(void *user, fz_pixmap *image, fz_matrix ctm, dy = 1; scaled = fz_smoothscalepixmap(image, image->x, image->y, dx, dy); } - if (scaled != NULL) + if (scaled != nil) image = scaled; } #else @@ -723,7 +723,7 @@ fz_drawclipimagemask(void *user, fz_pixmap *image, fz_matrix ctm) if (dx < image->w && dy < image->h) { scaled = fz_smoothtransformpixmap(image, &ctm, dev->dest->x, dev->dest->y, dx, dy); - if (scaled == NULL) + if (scaled == nil) { if (dx < 1) dx = 1; @@ -731,7 +731,7 @@ fz_drawclipimagemask(void *user, fz_pixmap *image, fz_matrix ctm) dy = 1; scaled = fz_smoothscalepixmap(image, image->x, image->y, dx, dy); } - if (scaled != NULL) + if (scaled != nil) image = scaled; } #else diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c index 9d4d7bc6..ca3cdeb8 100644 --- a/fitz/res_colorspace.c +++ b/fitz/res_colorspace.c @@ -9,10 +9,10 @@ fz_newcolorspace(char *name, int n) cs->refs = 1; fz_strlcpy(cs->name, name, sizeof cs->name); cs->n = n; - cs->toxyz = NULL; - cs->fromxyz = NULL; - cs->freedata = NULL; - cs->data = NULL; + cs->toxyz = nil; + cs->fromxyz = nil; + cs->freedata = nil; + cs->data = nil; return cs; } diff --git a/fitz/res_font.c b/fitz/res_font.c index 26d7267f..eb5e4ef9 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -314,7 +314,7 @@ fz_renderftglyph(fz_font *font, int gid, fz_matrix trm) return nil; } - glyph = fz_newpixmap(NULL, + glyph = fz_newpixmap(nil, face->glyph->bitmap_left, face->glyph->bitmap_top - face->glyph->bitmap.rows, face->glyph->bitmap.width, @@ -404,7 +404,7 @@ fz_renderftstrokedglyph(fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz } bitmap = (FT_BitmapGlyph)glyph; - pix = fz_newpixmap(NULL, + pix = fz_newpixmap(nil, bitmap->left, bitmap->top - bitmap->bitmap.rows, bitmap->bitmap.width, @@ -461,11 +461,11 @@ fz_rendert3glyph(fz_font *font, int gid, fz_matrix trm) fz_pixmap *result; if (gid < 0 || gid > 255) - return NULL; + return nil; contents = font->t3procs[gid]; if (!contents) - return NULL; + return nil; ctm = fz_concat(font->t3matrix, trm); dev = fz_newbboxdevice(&bbox); diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 7455338a..8d207073 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -38,7 +38,7 @@ fz_newpixmapwithdata(fz_colorspace *colorspace, int x, int y, int w, int h, unsi fz_pixmap * fz_newpixmap(fz_colorspace *colorspace, int x, int y, int w, int h) { - return fz_newpixmapwithdata(colorspace, x, y, w, h, NULL); + return fz_newpixmapwithdata(colorspace, x, y, w, h, nil); } fz_pixmap * @@ -283,7 +283,7 @@ static void putchunk(char *tag, unsigned char *data, int size, FILE *fp) put32(size, fp); fwrite(tag, 1, 4, fp); fwrite(data, 1, size, fp); - sum = crc32(0, NULL, 0); + sum = crc32(0, nil, 0); sum = crc32(sum, (unsigned char*)tag, 4); sum = crc32(sum, data, size); put32(sum, fp); |