diff options
-rw-r--r-- | base/hash.c | 24 | ||||
-rw-r--r-- | include/fitz/crypt.h | 6 | ||||
-rw-r--r-- | include/fitz/filter.h | 24 | ||||
-rw-r--r-- | include/fitz/render.h | 16 | ||||
-rw-r--r-- | mupdf/cmap.c | 22 | ||||
-rw-r--r-- | mupdf/font.c | 12 | ||||
-rw-r--r-- | mupdf/fontfile.c | 44 | ||||
-rw-r--r-- | mupdf/fontfilefc.c | 56 | ||||
-rw-r--r-- | mupdf/fontfilems.c | 84 | ||||
-rw-r--r-- | mupdf/function.c | 14 | ||||
-rw-r--r-- | mupdf/type3.c | 22 | ||||
-rw-r--r-- | mupdf/xref.c | 12 | ||||
-rw-r--r-- | object/dict.c | 12 | ||||
-rw-r--r-- | object/print.c | 12 | ||||
-rw-r--r-- | render/edgelist.c | 8 | ||||
-rw-r--r-- | render/scale.c | 2 | ||||
-rw-r--r-- | test/x11pdf.c | 114 | ||||
-rw-r--r-- | test/ximage.c | 13 | ||||
-rw-r--r-- | tree/font.c | 8 |
19 files changed, 252 insertions, 253 deletions
diff --git a/base/hash.c b/base/hash.c index c6d811c2..e54ac7ea 100644 --- a/base/hash.c +++ b/base/hash.c @@ -31,18 +31,18 @@ struct fz_hashtable_s static unsigned hash(unsigned char *s, int len) { - unsigned hash = 0; - int i; - for (i = 0; i < len; i++) - { - hash += s[i]; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - hash += (hash << 15); - return hash; + unsigned hash = 0; + int i; + for (i = 0; i < len; i++) + { + hash += s[i]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; } fz_error * diff --git a/include/fitz/crypt.h b/include/fitz/crypt.h index f6365c4e..647a1eda 100644 --- a/include/fitz/crypt.h +++ b/include/fitz/crypt.h @@ -4,9 +4,9 @@ typedef struct fz_md5_s fz_md5; struct fz_md5_s { - unsigned long state[4]; - unsigned long count[2]; - unsigned char buffer[64]; + unsigned long state[4]; + unsigned long count[2]; + unsigned char buffer[64]; }; void fz_md5init(fz_md5 *state); diff --git a/include/fitz/filter.h b/include/fitz/filter.h index 03cb5f1f..bb33b8eb 100644 --- a/include/fitz/filter.h +++ b/include/fitz/filter.h @@ -12,18 +12,18 @@ extern fz_error fz_kioneedout; extern fz_error fz_kiodone; #define FZ_NEWFILTER(TYPE,VAR,NAME) \ - fz_error * fz_process ## NAME (fz_filter*,fz_buffer*,fz_buffer*); \ - void fz_drop ## NAME (fz_filter*); \ - TYPE *VAR; \ - *fp = fz_malloc(sizeof(TYPE)); \ - if (!*fp) return fz_outofmem; \ - (*fp)->refs = 1; \ - (*fp)->process = fz_process ## NAME ; \ - (*fp)->drop = fz_drop ## NAME ; \ - (*fp)->consumed = 0; \ - (*fp)->produced = 0; \ - (*fp)->count = 0; \ - VAR = (TYPE*) *fp + fz_error * fz_process ## NAME (fz_filter*,fz_buffer*,fz_buffer*); \ + void fz_drop ## NAME (fz_filter*); \ + TYPE *VAR; \ + *fp = fz_malloc(sizeof(TYPE)); \ + if (!*fp) return fz_outofmem; \ + (*fp)->refs = 1; \ + (*fp)->process = fz_process ## NAME ; \ + (*fp)->drop = fz_drop ## NAME ; \ + (*fp)->consumed = 0; \ + (*fp)->produced = 0; \ + (*fp)->count = 0; \ + VAR = (TYPE*) *fp struct fz_filter_s { diff --git a/include/fitz/render.h b/include/fitz/render.h index 05b7daaf..bb0a43d5 100644 --- a/include/fitz/render.h +++ b/include/fitz/render.h @@ -2,14 +2,14 @@ typedef struct fz_renderer_s fz_renderer; struct fz_renderer_s { - fz_colorspace *model; - fz_glyphcache *cache; - fz_gel *gel; - fz_ael *ael; - fz_irect clip; - fz_pixmap *tmp; - fz_pixmap *acc; - unsigned char r, g, b; + fz_colorspace *model; + fz_glyphcache *cache; + fz_gel *gel; + fz_ael *ael; + fz_irect clip; + fz_pixmap *tmp; + fz_pixmap *acc; + unsigned char r, g, b; }; fz_error *fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int gcmem); diff --git a/mupdf/cmap.c b/mupdf/cmap.c index dff96b43..33c3a4ab 100644 --- a/mupdf/cmap.c +++ b/mupdf/cmap.c @@ -18,17 +18,17 @@ enum static int tokenfromkeyword(char *key) { - if (!strcmp(key, "usecmap")) return TUSECMAP; - if (!strcmp(key, "begincodespacerange")) return TBEGINCODESPACERANGE; - if (!strcmp(key, "endcodespacerange")) return TENDCODESPACERANGE; - if (!strcmp(key, "beginbfchar")) return TBEGINBFCHAR; - if (!strcmp(key, "endbfchar")) return TENDBFCHAR; - if (!strcmp(key, "beginbfrange")) return TBEGINBFRANGE; - if (!strcmp(key, "endbfrange")) return TENDBFRANGE; - if (!strcmp(key, "begincidchar")) return TBEGINCIDCHAR; - if (!strcmp(key, "endcidchar")) return TENDCIDCHAR; - if (!strcmp(key, "begincidrange")) return TBEGINCIDRANGE; - if (!strcmp(key, "endcidrange")) return TENDCIDRANGE; + if (!strcmp(key, "usecmap")) return TUSECMAP; + if (!strcmp(key, "begincodespacerange")) return TBEGINCODESPACERANGE; + if (!strcmp(key, "endcodespacerange")) return TENDCODESPACERANGE; + if (!strcmp(key, "beginbfchar")) return TBEGINBFCHAR; + if (!strcmp(key, "endbfchar")) return TENDBFCHAR; + if (!strcmp(key, "beginbfrange")) return TBEGINBFRANGE; + if (!strcmp(key, "endbfrange")) return TENDBFRANGE; + if (!strcmp(key, "begincidchar")) return TBEGINCIDCHAR; + if (!strcmp(key, "endcidchar")) return TENDCIDCHAR; + if (!strcmp(key, "begincidrange")) return TBEGINCIDRANGE; + if (!strcmp(key, "endcidrange")) return TENDCIDRANGE; return PDF_TKEYWORD; } diff --git a/mupdf/font.c b/mupdf/font.c index 5f4f5046..b9930f22 100644 --- a/mupdf/font.c +++ b/mupdf/font.c @@ -203,10 +203,10 @@ pdf_newfont(char *name) font->flags = 0; font->italicangle = 0; font->ascent = 0; - font->descent = 0; - font->capheight = 0; - font->xheight = 0; - font->missingwidth = 0; + font->descent = 0; + font->capheight = 0; + font->xheight = 0; + font->missingwidth = 0; font->encoding = nil; font->ncidtogid = 0; @@ -648,8 +648,8 @@ printf(" cidtogidmap %d\n", len / 2); /* TODO: if truetype font is external, cidtogidmap should not be identity */ /* we should map the cid to another encoding represented by a 'cmap' table */ /* cids: Adobe-CNS1 Adobe-GB1 Adobe-Japan1 Adobe-Japan2 Adobe-Korea1 */ - /* cmap: Big5 Johab PRC ShiftJIS Unicode Wansung */ - /* win: 3,4 3,6 3,3 3,2 3,1 3,5 */ + /* cmap: Big5 Johab PRC ShiftJIS Unicode Wansung */ + /* win: 3,4 3,6 3,3 3,2 3,1 3,5 */ } error = pdf_loadtounicode(font, xref, nil, collection, tounicode); diff --git a/mupdf/fontfile.c b/mupdf/fontfile.c index 6c525b74..ff46c8f1 100644 --- a/mupdf/fontfile.c +++ b/mupdf/fontfile.c @@ -10,33 +10,33 @@ static FT_Library ftlib = nil; enum { - FD_FIXED = 1 << 0, - FD_SERIF = 1 << 1, - FD_SYMBOLIC = 1 << 2, - FD_SCRIPT = 1 << 3, - FD_NONSYMBOLIC = 1 << 5, - FD_ITALIC = 1 << 6, - FD_ALLCAP = 1 << 16, - FD_SMALLCAP = 1 << 17, + FD_FIXED = 1 << 0, + FD_SERIF = 1 << 1, + FD_SYMBOLIC = 1 << 2, + FD_SCRIPT = 1 << 3, + FD_NONSYMBOLIC = 1 << 5, + FD_ITALIC = 1 << 6, + FD_ALLCAP = 1 << 16, + FD_SMALLCAP = 1 << 17, FD_FORCEBOLD = 1 << 18 }; static char *basenames[15] = { - "Courier", - "Courier-Bold", - "Courier-Oblique", - "Courier-BoldOblique", - "Helvetica", - "Helvetica-Bold", - "Helvetica-Oblique", - "Helvetica-BoldOblique", - "Times-Roman", - "Times-Bold", - "Times-Italic", - "Times-BoldItalic", - "Symbol", - "ZapfDingbats", + "Courier", + "Courier-Bold", + "Courier-Oblique", + "Courier-BoldOblique", + "Helvetica", + "Helvetica-Bold", + "Helvetica-Oblique", + "Helvetica-BoldOblique", + "Times-Roman", + "Times-Bold", + "Times-Italic", + "Times-BoldItalic", + "Symbol", + "ZapfDingbats", "Chancery" }; diff --git a/mupdf/fontfilefc.c b/mupdf/fontfilefc.c index 481d609d..f5b8525f 100644 --- a/mupdf/fontfilefc.c +++ b/mupdf/fontfilefc.c @@ -26,38 +26,38 @@ enum static char *basenames[14] = { - "Courier", - "Courier-Bold", - "Courier-Oblique", - "Courier-BoldOblique", - "Helvetica", - "Helvetica-Bold", - "Helvetica-Oblique", - "Helvetica-BoldOblique", - "Times-Roman", - "Times-Bold", - "Times-Italic", - "Times-BoldItalic", - "Symbol", - "ZapfDingbats" + "Courier", + "Courier-Bold", + "Courier-Oblique", + "Courier-BoldOblique", + "Helvetica", + "Helvetica-Bold", + "Helvetica-Oblique", + "Helvetica-BoldOblique", + "Times-Roman", + "Times-Bold", + "Times-Italic", + "Times-BoldItalic", + "Symbol", + "ZapfDingbats" }; static char *basepatterns[14] = { - "Nimbus Mono L,Courier,Courier New:style=Regular,Roman", - "Nimbus Mono L,Courier,Courier New:style=Bold", - "Nimbus Mono L,Courier,Courier New:style=Oblique,Italic", - "Nimbus Mono L,Courier,Courier New:style=BoldOblique,BoldItalic", - "Nimbus Sans L,Helvetica,Arial:style=Regular,Roman", - "Nimbus Sans L,Helvetica,Arial:style=Bold", - "Nimbus Sans L,Helvetica,Arial:style=Oblique,Italic", - "Nimbus Sans L,Helvetica,Arial:style=BoldOblique,BoldItalic", - "Nimbus Roman No9 L,Times,Times New Roman:style=Regular,Roman", - "Nimbus Roman No9 L,Times,Times New Roman:style=Bold,Medium", - "Nimbus Roman No9 L,Times,Times New Roman:style=Italic,Regular Italic", - "Nimbus Roman No9 L,Times,Times New Roman:style=BoldItalic,Medium Italic", - "Standard Symbols L,Symbol", - "Zapf Dingbats,Dingbats" + "Nimbus Mono L,Courier,Courier New:style=Regular,Roman", + "Nimbus Mono L,Courier,Courier New:style=Bold", + "Nimbus Mono L,Courier,Courier New:style=Oblique,Italic", + "Nimbus Mono L,Courier,Courier New:style=BoldOblique,BoldItalic", + "Nimbus Sans L,Helvetica,Arial:style=Regular,Roman", + "Nimbus Sans L,Helvetica,Arial:style=Bold", + "Nimbus Sans L,Helvetica,Arial:style=Oblique,Italic", + "Nimbus Sans L,Helvetica,Arial:style=BoldOblique,BoldItalic", + "Nimbus Roman No9 L,Times,Times New Roman:style=Regular,Roman", + "Nimbus Roman No9 L,Times,Times New Roman:style=Bold,Medium", + "Nimbus Roman No9 L,Times,Times New Roman:style=Italic,Regular Italic", + "Nimbus Roman No9 L,Times,Times New Roman:style=BoldItalic,Medium Italic", + "Standard Symbols L,Symbol", + "Zapf Dingbats,Dingbats" }; static fz_error *initfontlibs(void) diff --git a/mupdf/fontfilems.c b/mupdf/fontfilems.c index 3bfc07cf..a5431bfb 100644 --- a/mupdf/fontfilems.c +++ b/mupdf/fontfilems.c @@ -107,19 +107,19 @@ typedef struct _tagFONT_COLLECTION static char *basenames[13] = { - "Courier", - "Courier-Bold", - "Courier-Oblique", - "Courier-BoldOblique", - "Helvetica", - "Helvetica-Bold", - "Helvetica-Oblique", - "Helvetica-BoldOblique", - "Times-Roman", - "Times-Bold", - "Times-Italic", - "Times-BoldItalic", - "Symbol", + "Courier", + "Courier-Bold", + "Courier-Oblique", + "Courier-BoldOblique", + "Helvetica", + "Helvetica-Bold", + "Helvetica-Oblique", + "Helvetica-BoldOblique", + "Times-Roman", + "Times-Bold", + "Times-Italic", + "Times-BoldItalic", + "Symbol", }; static char *basepatterns[13] = @@ -181,7 +181,7 @@ localbsearch (const void *key, const void *base, size_t num, hi = mid - width; num = num & 1 ? half : half-1; } - else { + else { lo = mid + width; num = half; } @@ -191,7 +191,7 @@ localbsearch (const void *key, const void *base, size_t num, else break; - return(0); + return(0); } static void @@ -551,11 +551,11 @@ fz_error* pdf_createfontlistMS() { char szFontDir[MAX_PATH*2]; - char szSearch[MAX_PATH*2]; + char szSearch[MAX_PATH*2]; char szFile[MAX_PATH*2]; - BOOL fFinished; - HANDLE hList; - WIN32_FIND_DATA FileData; + BOOL fFinished; + HANDLE hList; + WIN32_FIND_DATA FileData; fz_error *err; if(fontlistMS.len != 0) @@ -563,25 +563,25 @@ pdf_createfontlistMS() GetWindowsDirectory(szFontDir, sizeof(szFontDir)); - // Get the proper directory path + // Get the proper directory path strcat(szFontDir,"\\Fonts\\"); sprintf(szSearch,"%s*.tt?",szFontDir); - // Get the first file - hList = FindFirstFile(szSearch, &FileData); - if (hList == INVALID_HANDLE_VALUE) - { + // Get the first file + hList = FindFirstFile(szSearch, &FileData); + if (hList == INVALID_HANDLE_VALUE) + { /* Don't complain about missing directories */ if (errno == ENOENT) return fz_throw("fonterror : can't find system fonts dir"); return fz_throw("ioerror"); - } - // Traverse through the directory structure - fFinished = FALSE; - while (!fFinished) - { - if(!(FileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) - { - // Get the full path for sub directory + } + // Traverse through the directory structure + fFinished = FALSE; + while (!fFinished) + { + if(!(FileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) + { + // Get the full path for sub directory sprintf(szFile,"%s%s",szFontDir,FileData.cFileName); if( szFile[strlen(szFile)-1] == 'c'|| szFile[strlen(szFile)-1] == 'C' ) @@ -597,16 +597,16 @@ pdf_createfontlistMS() if(err) goto cleanup; } - } - - if (!FindNextFile(hList, &FileData)) - { - if (GetLastError() == ERROR_NO_MORE_FILES) - { - fFinished = TRUE; - } - } - } + } + + if (!FindNextFile(hList, &FileData)) + { + if (GetLastError() == ERROR_NO_MORE_FILES) + { + fFinished = TRUE; + } + } + } removeredundancy(&fontlistMS); diff --git a/mupdf/function.c b/mupdf/function.c index 643d2fef..49420f6f 100644 --- a/mupdf/function.c +++ b/mupdf/function.c @@ -1374,13 +1374,13 @@ evalpostscriptfunc(pdf_function *func, psstack *st, int codeptr) break; case psOpReturn: return nil; - } - break; - default: - return fz_throw("syntaxerror : "); - break; - } - } + } + break; + default: + return fz_throw("syntaxerror : "); + break; + } + } cleanup: return err; diff --git a/mupdf/type3.c b/mupdf/type3.c index 81f22086..946f8145 100644 --- a/mupdf/type3.c +++ b/mupdf/type3.c @@ -9,9 +9,9 @@ static void t3dropfont(fz_font *font) { int i; - pdf_font *pfont = (pdf_font*)font; - if (pfont->encoding) - fz_dropcmap(pfont->encoding); + pdf_font *pfont = (pdf_font*)font; + if (pfont->encoding) + fz_dropcmap(pfont->encoding); for (i = 0; i < 256; i++) if (pfont->charprocs[i]) fz_droptree(pfont->charprocs[i]); @@ -20,7 +20,7 @@ t3dropfont(fz_font *font) static fz_error * t3render(fz_glyph *glyph, fz_font *fzfont, int cid, fz_matrix trm) { - pdf_font *font = (pdf_font*)fzfont; + pdf_font *font = (pdf_font*)fzfont; fz_error *error; fz_renderer *gc; fz_tree *tree; @@ -125,8 +125,8 @@ printf("loading type3 font %s\n", buf); if (!font) return fz_outofmem; - font->super.render = t3render; - font->super.drop = (void(*)(fz_font*)) t3dropfont; + font->super.render = t3render; + font->super.drop = (void(*)(fz_font*)) t3dropfont; obj = fz_dictgets(dict, "FontMatrix"); font->matrix.a = fz_toreal(fz_arrayget(obj, 0)); @@ -197,14 +197,14 @@ printf(" matrix [%g %g %g %g %g %g]\n", fz_dropobj(encoding); - error = pdf_makeidentitycmap(&font->encoding, 0, 1); - if (error) - goto cleanup; + error = pdf_makeidentitycmap(&font->encoding, 0, 1); + if (error) + goto cleanup; error = pdf_loadtounicode(font, xref, estrings, nil, fz_dictgets(dict, "ToUnicode")); - if (error) - goto cleanup; + if (error) + goto cleanup; /* * Widths diff --git a/mupdf/xref.c b/mupdf/xref.c index fa75b955..421eeb70 100644 --- a/mupdf/xref.c +++ b/mupdf/xref.c @@ -30,12 +30,12 @@ pdf_newpdf(pdf_xref **xrefp) } xref->table[0].type = 'f'; - xref->table[0].mark = 0; - xref->table[0].ofs = 0; - xref->table[0].gen = 65535; - xref->table[0].stmbuf = nil; - xref->table[0].stmofs = 0; - xref->table[0].obj = nil; + xref->table[0].mark = 0; + xref->table[0].ofs = 0; + xref->table[0].gen = 65535; + xref->table[0].stmbuf = nil; + xref->table[0].stmofs = 0; + xref->table[0].obj = nil; *xrefp = xref; return nil; diff --git a/object/dict.c b/object/dict.c index 32d066b9..c41dbab1 100644 --- a/object/dict.c +++ b/object/dict.c @@ -128,10 +128,10 @@ fz_obj * fz_dictgetkey(fz_obj *obj, int i) { if (!fz_isdict(obj)) - return nil; + return nil; - if (i < 0 || i >= obj->u.d.len) - return nil; + if (i < 0 || i >= obj->u.d.len) + return nil; return obj->u.d.items[i].k; } @@ -140,10 +140,10 @@ fz_obj * fz_dictgetval(fz_obj *obj, int i) { if (!fz_isdict(obj)) - return nil; + return nil; - if (i < 0 || i >= obj->u.d.len) - return nil; + if (i < 0 || i >= obj->u.d.len) + return nil; return obj->u.d.items[i].v; } diff --git a/object/print.c b/object/print.c index 8c756f30..7ada9845 100644 --- a/object/print.c +++ b/object/print.c @@ -16,12 +16,12 @@ static void fmtobj(struct fmt *fmt, fz_obj *obj); static inline int isdelim(int ch) { - return ch == '(' || ch == ')' || - ch == '<' || ch == '>' || - ch == '[' || ch == ']' || - ch == '{' || ch == '}' || - ch == '/' || - ch == '%'; + return ch == '(' || ch == ')' || + ch == '<' || ch == '>' || + ch == '[' || ch == ']' || + ch == '{' || ch == '}' || + ch == '/' || + ch == '%'; } static inline void fmtputc(struct fmt *fmt, int c) diff --git a/render/edgelist.c b/render/edgelist.c index 7b39ae70..9eaaf7a7 100644 --- a/render/edgelist.c +++ b/render/edgelist.c @@ -56,10 +56,10 @@ fz_irect fz_boundgel(fz_gel *gel) { fz_irect bbox; - bbox.min.x = fz_idiv(gel->xmin, gel->hs); - bbox.min.y = fz_idiv(gel->ymin, gel->vs); - bbox.max.x = fz_idiv(gel->xmax, gel->hs) + 1; - bbox.max.y = fz_idiv(gel->ymax, gel->vs) + 1; + bbox.min.x = fz_idiv(gel->xmin, gel->hs); + bbox.min.y = fz_idiv(gel->ymin, gel->vs); + bbox.max.x = fz_idiv(gel->xmax, gel->hs) + 1; + bbox.max.y = fz_idiv(gel->ymax, gel->vs) + 1; return bbox; } diff --git a/render/scale.c b/render/scale.c index 47345387..a07d52a7 100644 --- a/render/scale.c +++ b/render/scale.c @@ -13,7 +13,7 @@ scalerow(unsigned char *src, unsigned char *dst, int w, int ncomp, int denom) for (x = 0; x < w; x++) { for (k = 0; k < ncomp; k++) - sum[k] += src[x * ncomp + k]; + sum[k] += src[x * ncomp + k]; if (++left == denom) { left = 0; diff --git a/test/x11pdf.c b/test/x11pdf.c index 3d424b1c..07e1150c 100644 --- a/test/x11pdf.c +++ b/test/x11pdf.c @@ -57,32 +57,32 @@ void usage() static void xopen(void) { xdpy = XOpenDisplay(nil); - assert(xdpy != nil); + assert(xdpy != nil); - xscr = DefaultScreen(xdpy); + xscr = DefaultScreen(xdpy); - ximage_init(xdpy, xscr, DefaultVisual(xdpy, xscr)); + ximage_init(xdpy, xscr, DefaultVisual(xdpy, xscr)); - xcarrow = XCreateFontCursor(xdpy, XC_left_ptr); - xchand = XCreateFontCursor(xdpy, XC_hand2); - xcwait = XCreateFontCursor(xdpy, XC_watch); + xcarrow = XCreateFontCursor(xdpy, XC_left_ptr); + xchand = XCreateFontCursor(xdpy, XC_hand2); + xcwait = XCreateFontCursor(xdpy, XC_watch); - xwin = XCreateWindow(xdpy, DefaultRootWindow(xdpy), - 10, 10, 200, 100, 1, - ximage_get_depth(), - InputOutput, - ximage_get_visual(), - 0, - nil); + xwin = XCreateWindow(xdpy, DefaultRootWindow(xdpy), + 10, 10, 200, 100, 1, + ximage_get_depth(), + InputOutput, + ximage_get_visual(), + 0, + nil); - XSetWindowColormap(xdpy, xwin, ximage_get_colormap()); - XSelectInput(xdpy, xwin, - StructureNotifyMask | ExposureMask | KeyPressMask | - PointerMotionMask | ButtonPressMask); + XSetWindowColormap(xdpy, xwin, ximage_get_colormap()); + XSelectInput(xdpy, xwin, + StructureNotifyMask | ExposureMask | KeyPressMask | + PointerMotionMask | ButtonPressMask); - mapped = 0; + mapped = 0; - xgc = XCreateGC(xdpy, xwin, 0, nil); + xgc = XCreateGC(xdpy, xwin, 0, nil); } static void xresize(void) @@ -230,88 +230,88 @@ static void dumptext() static void handlekey(int c) { - int oldpage = pageno; - float oldzoom = zoom; - int oldrotate = rotate; + int oldpage = pageno; + float oldzoom = zoom; + int oldrotate = rotate; - if (c >= '0' && c <= '9') + if (c >= '0' && c <= '9') pagebuf[pagebufidx++] = c; - else + else if (c != 'g' && c != 'G') - pagebufidx = 0; + pagebufidx = 0; - switch (c) - { + switch (c) + { case 'd': fz_debugglyphcache(rast->cache); break; case 'a': rotate -= 5; break; case 's': rotate += 5; break; case 'x': dumptext(); break; - case 'b': + case 'b': pageno--; if (pageno < 1) - pageno = 1; + pageno = 1; break; - case 'B': + case 'B': pageno -= 10; if (pageno < 1) - pageno = 1; + pageno = 1; break; - case ' ': - case 'f': + case ' ': + case 'f': pageno++; if (pageno > count) - pageno = count; + pageno = count; break; - case 'F': + case 'F': pageno += 10; if (pageno > count) - pageno = count; + pageno = count; break; - case 't': - case 'T': + case 't': + case 'T': if (histlen > 0) - pageno = hist[--histlen]; + pageno = hist[--histlen]; break; - case '-': + case '-': zoom -= 0.1; if (zoom < 0.1) - zoom = 0.1; + zoom = 0.1; break; - case '+': + case '+': zoom += 0.1; if (zoom > 3.0) - zoom = 3.0; + zoom = 3.0; break; - case '<': + case '<': rotate -= 90; break; - case '>': + case '>': rotate += 90; break; - case 'q': + case 'q': exit(0); - case 'g': - case 'G': + case 'g': + case 'G': if (pagebufidx > 0) { - pagebuf[pagebufidx] = '\0'; - pageno = atoi(pagebuf); - pagebufidx = 0; - if (pageno < 1) + pagebuf[pagebufidx] = '\0'; + pageno = atoi(pagebuf); + pagebufidx = 0; + if (pageno < 1) pageno = 1; - if (pageno > count) + if (pageno > count) pageno = count; } else { - if (c == 'G') - { + if (c == 'G') + { pageno = count; - } + } } break; - } + } if (pageno != oldpage || zoom != oldzoom || rotate != oldrotate) showpage(); diff --git a/test/ximage.c b/test/ximage.c index abf52ac1..9c368360 100644 --- a/test/ximage.c +++ b/test/ximage.c @@ -79,8 +79,7 @@ static struct } info; static XImage * -createximage(Display *dpy, Visual *vis, XShmSegmentInfo *xsi, - int depth, int w, int h) +createximage(Display *dpy, Visual *vis, XShmSegmentInfo *xsi, int depth, int w, int h) { XImage *img; Status status; @@ -95,8 +94,8 @@ createximage(Display *dpy, Visual *vis, XShmSegmentInfo *xsi, } xsi->shmid = shmget(IPC_PRIVATE, - img->bytes_per_line * img->height, - IPC_CREAT | 0777); + img->bytes_per_line * img->height, + IPC_CREAT | 0777); if (xsi->shmid < 0) { XDestroyImage(img); @@ -127,7 +126,7 @@ createximage(Display *dpy, Visual *vis, XShmSegmentInfo *xsi, shmctl(xsi->shmid, IPC_RMID, 0); printf("make xshm w=%d h=%d id=%d data=%p\n", - w, h, xsi->shmid, xsi->shmaddr); + w, h, xsi->shmid, xsi->shmaddr); return img; @@ -266,7 +265,7 @@ create_pool(void) for (i = 0; i < POOLSIZE; i++) { info.pool[i] = createximage(info.display, - info.visual.visual, &info.shminfo[i], info.visual.depth, + info.visual.visual, &info.shminfo[i], info.visual.depth, WIDTH, HEIGHT); if (info.pool[i] == nil) { return 0; @@ -402,7 +401,7 @@ ximage_blit(Drawable d, GC gc, } else { - XPutImage(info.display, d, gc, image, + XPutImage(info.display, d, gc, image, 0, 0, dstx + ax, dsty + ay, diff --git a/tree/font.c b/tree/font.c index 14c09981..0814efba 100644 --- a/tree/font.c +++ b/tree/font.c @@ -60,10 +60,10 @@ fz_setfontwmode(fz_font *font, int wmode) void fz_setfontbbox(fz_font *font, int xmin, int ymin, int xmax, int ymax) { - font->bbox.min.x = xmin; - font->bbox.min.y = ymin; - font->bbox.max.x = xmax; - font->bbox.max.y = ymax; + font->bbox.min.x = xmin; + font->bbox.min.y = ymin; + font->bbox.max.x = xmax; + font->bbox.max.y = ymax; } void |