From 559252258781ed2f0eecd34d16a7b84ec52c0e21 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 30 Dec 2010 15:43:42 +0000 Subject: Adhere to nil idiom. --- apps/pdfapp.c | 2 +- apps/pdfclean.c | 12 ++++++------ apps/pdfdraw.c | 6 +++--- apps/pdfextract.c | 4 ++-- apps/pdfshow.c | 4 ++-- apps/win_main.c | 2 +- apps/x11_main.c | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) (limited to 'apps') diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 1f451f33..20c27065 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -103,7 +103,7 @@ void pdfapp_open(pdfapp_t *app, char *filename, int fd) */ file = fz_openfile(fd); - error = pdf_openxrefwithstream(&app->xref, file, NULL); + error = pdf_openxrefwithstream(&app->xref, file, nil); if (error) pdfapp_error(app, fz_rethrow(error, "cannot open document '%s'", filename)); fz_close(file); diff --git a/apps/pdfclean.c b/apps/pdfclean.c index 430e1ac4..fbea8fd4 100644 --- a/apps/pdfclean.c +++ b/apps/pdfclean.c @@ -12,18 +12,18 @@ #include "fitz.h" #include "mupdf.h" -static FILE *out = NULL; +static FILE *out = nil; -static char *uselist = NULL; -static int *ofslist = NULL; -static int *genlist = NULL; -static int *renumbermap = NULL; +static char *uselist = nil; +static int *ofslist = nil; +static int *genlist = nil; +static int *renumbermap = nil; static int dogarbage = 0; static int doexpand = 0; static int doascii = 0; -static pdf_xref *xref = NULL; +static pdf_xref *xref = nil; void die(fz_error error) { diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c index e31fd016..9ce72cf0 100644 --- a/apps/pdfdraw.c +++ b/apps/pdfdraw.c @@ -11,7 +11,7 @@ #include #endif -char *output = NULL; +char *output = nil; float resolution = 72; float rotation = 0; @@ -66,10 +66,10 @@ static int gettime(void) struct timeval now; if (once) { - gettimeofday(&first, NULL); + gettimeofday(&first, nil); once = 0; } - gettimeofday(&now, NULL); + gettimeofday(&now, nil); return (now.tv_sec - first.tv_sec) * 1000 + (now.tv_usec - first.tv_usec) / 1000; } diff --git a/apps/pdfextract.c b/apps/pdfextract.c index fa515638..340a351d 100644 --- a/apps/pdfextract.c +++ b/apps/pdfextract.c @@ -5,7 +5,7 @@ #include "fitz.h" #include "mupdf.h" -static pdf_xref *xref = NULL; +static pdf_xref *xref = nil; static int dorgb = 0; void die(fz_error error) @@ -142,7 +142,7 @@ static void savefont(fz_obj *dict, int num) printf("extracting font %s\n", name); f = fopen(name, "wb"); - if (f == NULL) + if (f == nil) die(fz_throw("Error creating font file")); n = fwrite(buf->data, 1, buf->len, f); diff --git a/apps/pdfshow.c b/apps/pdfshow.c index 27bbd0e4..eda01e30 100644 --- a/apps/pdfshow.c +++ b/apps/pdfshow.c @@ -5,7 +5,7 @@ #include "fitz.h" #include "mupdf.h" -static pdf_xref *xref = NULL; +static pdf_xref *xref = nil; static int showbinary = 0; static int showdecode = 1; static int showcolumn; @@ -192,7 +192,7 @@ static void showgrep(char *filename) int main(int argc, char **argv) { - char *password = NULL; /* don't throw errors if encrypted */ + char *password = nil; /* don't throw errors if encrypted */ char *filename; fz_error error; int c; diff --git a/apps/win_main.c b/apps/win_main.c index 29f2b29e..07d1e932 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -130,7 +130,7 @@ char *winpassword(pdfapp_t *app, char *filename) win32error("cannot create password dialog"); if (pd_okay) return pd_password; - return NULL; + return nil; } INT CALLBACK diff --git a/apps/x11_main.c b/apps/x11_main.c index 395f9fd8..9ef08012 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -93,7 +93,7 @@ void winerror(pdfapp_t *app, fz_error error) char *winpassword(pdfapp_t *app, char *filename) { char *r = password; - password = NULL; + password = nil; return r; } @@ -289,7 +289,7 @@ static void winblit(pdfapp_t *app) { int i = gapp.image->w*gapp.image->h; unsigned char *color = malloc(i*4); - if (color != NULL) + if (color != nil) { unsigned char *s = gapp.image->samples; unsigned char *d = color; -- cgit v1.2.3