diff options
author | Tor Andersson <tor@ghostscript.com> | 2009-11-29 16:54:23 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2009-11-29 16:54:23 +0100 |
commit | 12ddfc8eca5323feb758a7966ca51a3b52279316 (patch) | |
tree | 25f6e8a18625c0874b350b915f2ce5c0d738b7f3 | |
parent | 12f9f21bbcb99a397d06ceff6d83bbc94397580e (diff) | |
download | mupdf-12ddfc8eca5323feb758a7966ca51a3b52279316.tar.xz |
Add some braces and fix up double-indentation on multi-line if/while expressions.
-rw-r--r-- | apps/pdfinfo.c | 16 | ||||
-rw-r--r-- | apps/unix/x11pdf.c | 6 | ||||
-rw-r--r-- | apps/unix/ximage.c | 2 | ||||
-rw-r--r-- | apps/windows/winmain.c | 24 | ||||
-rw-r--r-- | fitz/base_hash.c | 4 | ||||
-rw-r--r-- | fitz/filt_predict.c | 6 | ||||
-rw-r--r-- | fitz/obj_print.c | 2 | ||||
-rw-r--r-- | fitz/util_getopt.c | 9 | ||||
-rw-r--r-- | fitzdraw/imagescale.c | 17 | ||||
-rw-r--r-- | fitzdraw/pixmap.c | 5 | ||||
-rw-r--r-- | mupdf/pdf_build.c | 12 | ||||
-rw-r--r-- | mupdf/pdf_function.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_open.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_parse.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_repair.c | 6 |
15 files changed, 63 insertions, 52 deletions
diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c index b2938027..73ed6148 100644 --- a/apps/pdfinfo.c +++ b/apps/pdfinfo.c @@ -286,7 +286,7 @@ gatherfonts(int page, fz_obj *pageobj, fz_obj *dict) for (k = 0; k < fonts; k++) if (fz_tonum(font[k]->ref) == fz_tonum(ref) && - fz_togen(font[k]->ref) == fz_togen(ref)) + fz_togen(font[k]->ref) == fz_togen(ref)) break; if (k < fonts) @@ -388,7 +388,7 @@ gatherimages(int page, fz_obj *pageobj, fz_obj *dict) for (k = 0; k < images; k++) if (fz_tonum(image[k]->ref) == fz_tonum(ref) && - fz_togen(image[k]->ref) == fz_togen(ref)) + fz_togen(image[k]->ref) == fz_togen(ref)) break; if (k < images) @@ -459,7 +459,7 @@ gatherforms(int page, fz_obj *pageobj, fz_obj *dict) for (k = 0; k < forms; k++) if (fz_tonum(form[k]->ref) == fz_tonum(ref) && - fz_togen(form[k]->ref) == fz_togen(ref)) + fz_togen(form[k]->ref) == fz_togen(ref)) break; if (k < forms) @@ -512,12 +512,12 @@ gatherpsobjs(int page, fz_obj *pageobj, fz_obj *dict) if (subtype && !fz_isname(subtype)) return fz_throw("not a xobject subtype (%d %d R)", fz_tonum(ref), fz_togen(ref)); if (strcmp(fz_toname(type), "PS") && - (strcmp(fz_toname(type), "Form") || strcmp(fz_toname(subtype), "PS"))) + (strcmp(fz_toname(type), "Form") || strcmp(fz_toname(subtype), "PS"))) continue; for (k = 0; k < psobjs; k++) if (fz_tonum(psobj[k]->ref) == fz_tonum(ref) && - fz_togen(psobj[k]->ref) == fz_togen(ref)) + fz_togen(psobj[k]->ref) == fz_togen(ref)) break; if (k < psobjs) @@ -566,7 +566,7 @@ gathershadings(int page, fz_obj *pageobj, fz_obj *dict) for (k = 0; k < shadings; k++) if (fz_tonum(shading[k]->ref) == fz_tonum(ref) && - fz_togen(shading[k]->ref) == fz_togen(ref)) + fz_togen(shading[k]->ref) == fz_togen(ref)) break; if (k < shadings) @@ -635,7 +635,7 @@ gatherpatterns(int page, fz_obj *pageobj, fz_obj *dict) for (k = 0; k < patterns; k++) if (fz_tonum(pattern[k]->ref) == fz_tonum(ref) && - fz_togen(pattern[k]->ref) == fz_togen(ref)) + fz_togen(pattern[k]->ref) == fz_togen(ref)) break; if (k < patterns) @@ -771,6 +771,7 @@ printinfo(char *filename, int show, int page) printf("MediaBox: "); printf("\n"); for (i = 0; i < dims; i++) + { printf(PAGE_FMT "[ %g %g %g %g ]\n", dim[i]->page, fz_tonum(dim[i]->pageobj), fz_togen(dim[i]->pageobj), @@ -778,6 +779,7 @@ printinfo(char *filename, int show, int page) dim[i]->u.dim.bbox->y0, dim[i]->u.dim.bbox->x1, dim[i]->u.dim.bbox->y1); + } printf("\n"); for (i = 0; i < dims; i++) diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c index ac4fe6d6..68c93ac1 100644 --- a/apps/unix/x11pdf.c +++ b/apps/unix/x11pdf.c @@ -472,7 +472,7 @@ static void usage(void) static void winawaitevent(struct timeval *tmo, struct timeval *tmo_at) { if (tmo_at->tv_sec == 0 && tmo_at->tv_usec == 0 && - tmo->tv_sec == 0 && tmo->tv_usec == 0) + tmo->tv_sec == 0 && tmo->tv_usec == 0) XNextEvent(xdpy, &xevt); else { @@ -568,7 +568,7 @@ int main(int argc, char **argv) winawaitevent(&tmo, &tmo_at); if (tmo_at.tv_sec != 0 && tmo_at.tv_usec != 0 && - tmo.tv_sec == 0 && tmo.tv_usec == 0) + tmo.tv_sec == 0 && tmo.tv_usec == 0) { /* redraw page */ winblit(&gapp); @@ -587,7 +587,7 @@ int main(int argc, char **argv) if (gapp.image) { if (xevt.xconfigure.width != reqw || - xevt.xconfigure.height != reqh) + xevt.xconfigure.height != reqh) gapp.shrinkwrap = 0; } pdfapp_onresize(&gapp, diff --git a/apps/unix/ximage.c b/apps/unix/ximage.c index 5b03f559..90116026 100644 --- a/apps/unix/ximage.c +++ b/apps/unix/ximage.c @@ -364,7 +364,7 @@ ximage_init(Display *display, int screen, Visual *visual) /* identify code for MIT-SHM extension */ if (XQueryExtension(display, "MIT-SHM", &major, &event, &error) && - XShmQueryExtension(display)) + XShmQueryExtension(display)) info.shmcode = major; /* intercept errors looking for SHM code */ diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c index cd515418..a3ecd6ca 100644 --- a/apps/windows/winmain.c +++ b/apps/windows/winmain.c @@ -40,8 +40,8 @@ void associate(char *argv0) /* HKEY_CLASSES_ROOT\.pdf */ if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - ".pdf", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &key, &disp)) + ".pdf", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &key, &disp)) return; if (RegSetValueEx(key, "", 0, REG_SZ, "MuPDF", strlen("MuPDF")+1)) @@ -52,8 +52,8 @@ void associate(char *argv0) /* HKEY_CLASSES_ROOT\MuPDF */ if (RegCreateKeyEx(HKEY_CLASSES_ROOT, - "MuPDF", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &key, &disp)) + "MuPDF", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &key, &disp)) return; if (RegSetValueEx(key, "", 0, REG_SZ, name, strlen(name)+1)) @@ -62,8 +62,8 @@ void associate(char *argv0) /* HKEY_CLASSES_ROOT\MuPDF\DefaultIcon */ if (RegCreateKeyEx(key, - "DefaultIcon", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &kicon, &disp)) + "DefaultIcon", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &kicon, &disp)) return; sprintf(tmp, "%s,1", argv0); @@ -75,16 +75,16 @@ void associate(char *argv0) /* HKEY_CLASSES_ROOT\MuPDF\Shell\Open\Command */ if (RegCreateKeyEx(key, - "shell", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &kshell, &disp)) + "shell", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &kshell, &disp)) return; if (RegCreateKeyEx(kshell, - "open", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &kopen, &disp)) + "open", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &kopen, &disp)) return; if (RegCreateKeyEx(kopen, - "command", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &kcmd, &disp)) + "command", 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &kcmd, &disp)) return; sprintf(tmp, "\"%s\" \"%%1\"", argv0); diff --git a/fitz/base_hash.c b/fitz/base_hash.c index 927cc104..cd866041 100644 --- a/fitz/base_hash.c +++ b/fitz/base_hash.c @@ -203,8 +203,8 @@ fz_hashremove(fz_hashtable *table, void *key) { code = hash(ents[look].key, table->keylen) % size; if ((code <= hole && hole < look) || - (look < code && code <= hole) || - (hole < look && look < code)) + (look < code && code <= hole) || + (hole < look && look < code)) { ents[hole] = ents[look]; ents[look].val = nil; diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c index a3067bdb..a9958c63 100644 --- a/fitz/filt_predict.c +++ b/fitz/filt_predict.c @@ -38,9 +38,9 @@ fz_newpredictd(fz_obj *params) p->predictor = fz_toint(obj); if (p->predictor != 1 && p->predictor != 2 && - p->predictor != 10 && p->predictor != 11 && - p->predictor != 12 && p->predictor != 13 && - p->predictor != 14 && p->predictor != 15) + p->predictor != 10 && p->predictor != 11 && + p->predictor != 12 && p->predictor != 13 && + p->predictor != 14 && p->predictor != 15) { fz_warn("invalid predictor: %d", p->predictor); p->predictor = 1; diff --git a/fitz/obj_print.c b/fitz/obj_print.c index a26f8f3d..1c2cd62d 100644 --- a/fitz/obj_print.c +++ b/fitz/obj_print.c @@ -139,7 +139,7 @@ static void fmtname(struct fmt *fmt, fz_obj *obj) for (i = 0; s[i]; i++) { if (isdelim(s[i]) || iswhite(s[i]) || - s[i] == '#' || s[i] < 32 || s[i] > 127) + s[i] == '#' || s[i] < 32 || s[i] > 127) { fmtputc(fmt, '#'); c = (s[i] >> 4) & 0xf; diff --git a/fitz/util_getopt.c b/fitz/util_getopt.c index 22ac8148..b2cf1b71 100644 --- a/fitz/util_getopt.c +++ b/fitz/util_getopt.c @@ -47,7 +47,7 @@ static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91"; /* * get option letter from argument vector */ -int opterr = 1, /* if error message should be printed */ +int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ optopt; /* character checked for validity */ char *optarg; /* argument associated with option */ @@ -87,8 +87,7 @@ int fz_getopt(int nargc, char * const * nargv, const char *ostr) p = *nargv; else ++p; - (void)fprintf(stderr, "%s: illegal option -- %c\n", - p, optopt); + (void)fprintf(stderr, "%s: illegal option -- %c\n", p, optopt); } return(BADCH); } @@ -107,9 +106,7 @@ int fz_getopt(int nargc, char * const * nargv, const char *ostr) else ++p; if (opterr) - (void)fprintf(stderr, - "%s: option requires an argument -- %c\n", - p, optopt); + (void)fprintf(stderr, "%s: option requires an argument -- %c\n", p, optopt); return(BADCH); } else /* white space */ diff --git a/fitzdraw/imagescale.c b/fitzdraw/imagescale.c index 147e31af..ad73ece1 100644 --- a/fitzdraw/imagescale.c +++ b/fitzdraw/imagescale.c @@ -228,9 +228,11 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde for (y = 0, oy = 0; y < (src->h / ydenom) * ydenom; y += ydenom, oy++) { for (iy = 0; iy < ydenom; iy++) + { srowx(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom); + } scolx(buf, dstsamples + oy * dst->w * n, ow, ydenom); } @@ -238,9 +240,11 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde if (remaining) { for (iy = 0; iy < remaining; iy++) + { srowx(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom); + } scolx(buf, dstsamples + oy * dst->w * n, ow, remaining); } } @@ -250,9 +254,11 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde for (y = 0, oy = 0; y < (src->h / ydenom) * ydenom; y += ydenom, oy++) { for (iy = 0; iy < ydenom; iy++) + { fz_srown(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom, n); + } fz_scoln(buf, dstsamples + oy * dst->w * n, ow, ydenom, n); } @@ -260,10 +266,11 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde if (remaining) { for (iy = 0; iy < remaining; iy++) + { fz_srown(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom, n); - + } fz_scoln(buf, dstsamples + oy * dst->w * n, ow, remaining, n); } } @@ -313,9 +320,11 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) for (y = 0, oy = 0; y < (src->h / ydenom) * ydenom; y += ydenom, oy++) { for (iy = 0; iy < ydenom; iy++) + { srowx(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom); + } scolx(buf, dst->samples + oy * dst->w * n, dst->w, ydenom); } @@ -323,9 +332,11 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) if (remaining) { for (iy = 0; iy < remaining; iy++) + { srowx(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom); + } scolx(buf, dst->samples + oy * dst->w * n, dst->w, remaining); } } @@ -335,9 +346,11 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) for (y = 0, oy = 0; y < (src->h / ydenom) * ydenom; y += ydenom, oy++) { for (iy = 0; iy < ydenom; iy++) + { fz_srown(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom, n); + } fz_scoln(buf, dst->samples + oy * dst->w * n, dst->w, ydenom, n); } @@ -345,9 +358,11 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom) if (remaining) { for (iy = 0; iy < remaining; iy++) + { fz_srown(src->samples + (y + iy) * src->w * n, buf + iy * ow * n, src->w, xdenom, n); + } fz_scoln(buf, dst->samples + oy * dst->w * n, dst->w, remaining, n); } } diff --git a/fitzdraw/pixmap.c b/fitzdraw/pixmap.c index 78c8dc2f..592eaf44 100644 --- a/fitzdraw/pixmap.c +++ b/fitzdraw/pixmap.c @@ -29,10 +29,7 @@ fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n) fz_error fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n) { - return fz_newpixmap(pixp, - r.x0, r.y0, - r.x1 - r.x0, - r.y1 - r.y0, n); + return fz_newpixmap(pixp, r.x0, r.y0, r.x1 - r.x0, r.y1 - r.y0, n); } fz_error diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c index c235e4ee..0e773796 100644 --- a/mupdf/pdf_build.c +++ b/mupdf/pdf_build.c @@ -889,12 +889,12 @@ showglyph(pdf_csi *csi, int cid) /* flush buffered text if face or matrix or rendermode has changed */ if (!csi->text || - (fontdesc->font) != csi->text->font || - fabs(trm.a - csi->text->trm.a) > FLT_EPSILON || - fabs(trm.b - csi->text->trm.b) > FLT_EPSILON || - fabs(trm.c - csi->text->trm.c) > FLT_EPSILON || - fabs(trm.d - csi->text->trm.d) > FLT_EPSILON || - gstate->render != csi->textmode) + (fontdesc->font) != csi->text->font || + fabs(trm.a - csi->text->trm.a) > FLT_EPSILON || + fabs(trm.b - csi->text->trm.b) > FLT_EPSILON || + fabs(trm.c - csi->text->trm.c) > FLT_EPSILON || + fabs(trm.d - csi->text->trm.d) > FLT_EPSILON || + gstate->render != csi->textmode) { error = pdf_flushtext(csi); if (error) diff --git a/mupdf/pdf_function.c b/mupdf/pdf_function.c index f563b402..9051acc9 100644 --- a/mupdf/pdf_function.c +++ b/mupdf/pdf_function.c @@ -1271,7 +1271,7 @@ loadstitchingfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict) } if (k != 1 && (func->domain[0][0] > func->u.st.bounds[0] || - func->domain[0][1] < func->u.st.bounds[k-2])) + func->domain[0][1] < func->u.st.bounds[k-2])) fz_warn("malformed shading function bounds (domain mismatch), proceeding anyway."); } diff --git a/mupdf/pdf_open.c b/mupdf/pdf_open.c index 6374f3e2..691baba3 100644 --- a/mupdf/pdf_open.c +++ b/mupdf/pdf_open.c @@ -736,7 +736,7 @@ pdf_loadxref(pdf_xref *xref, char *filename) but still exits */ for (i = 0; i < xref->len; i++) if (xref->table[i].type == 'n' && xref->table[i].ofs == 0 && - xref->table[i].gen == 0 && xref->table[i].obj == nil) + xref->table[i].gen == 0 && xref->table[i].obj == nil) { fz_warn("object (%d %d R) has invalid offset, assumed missing", i, xref->table[i].gen); xref->table[i].type = 'f'; diff --git a/mupdf/pdf_parse.c b/mupdf/pdf_parse.c index 75eaa1b5..7f8b2614 100644 --- a/mupdf/pdf_parse.c +++ b/mupdf/pdf_parse.c @@ -321,7 +321,7 @@ skip: return fz_rethrow(error, "cannot parse dict"); } if (tok == PDF_TCDICT || tok == PDF_TNAME || - (tok == PDF_TKEYWORD && !strcmp(buf, "ID"))) + (tok == PDF_TKEYWORD && !strcmp(buf, "ID"))) { val = fz_newint(a); fz_dictput(dict, key, val); diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c index f3d7999e..5ef21493 100644 --- a/mupdf/pdf_repair.c +++ b/mupdf/pdf_repair.c @@ -65,9 +65,9 @@ fz_repairobj(fz_stream *file, char *buf, int cap, } while ( tok != PDF_TSTREAM && - tok != PDF_TENDOBJ && - tok != PDF_TERROR && - tok != PDF_TEOF ) + tok != PDF_TENDOBJ && + tok != PDF_TERROR && + tok != PDF_TEOF ) { error = pdf_lex(&tok, file, buf, cap, &len); if (error) |