wdvi

network DVI viewer
Log | Files | Refs

commit 5ae2d85a7d48cba02d6aacaaccc2a24bf74a0bf7
parent 08dcdb3df139d7eb0758ea663900ad1953e01dfe
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Mon, 13 Sep 2021 22:19:36 +0000

spell Printf() correctly

Diffstat:
Mdvi-draw.c | 22+++++++++++-----------
Mdvi-init.c | 8++++----
Mevents.c | 4++--
Mfont-open.c | 18+++++++++---------
Mft.c | 8++++----
Mpk.c | 10+++++-----
Mspecial.c | 4++--
Mvf.c | 4++--
Mxdvi.c | 6++----
Mxdvi.h | 6------
10 files changed, 41 insertions(+), 49 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -119,7 +119,7 @@ put_bitmap(bitmap, x, y) int x, y; { if (debug & DBG_BITMAP) - Printf("X(%d,%d)\n", x - currwin.base_x, y - currwin.base_y); + printf("X(%d,%d)\n", x - currwin.base_x, y - currwin.base_y); if (x < max_x && x + (int) bitmap->w >= min_x && y < max_y && y + (int) bitmap->h >= min_y) { if (fg_active != fg_current) do_color_change(); @@ -257,7 +257,7 @@ print_bitmap(bitmap) if (ptr == NULL) errx(1, "print_bitmap called with null pointer."); - Printf("w = %d, h = %d, bytes wide = %d\n", + printf("w = %d, h = %d, bytes wide = %d\n", bitmap->w, bitmap->h, bitmap->bytes_wide); for (y = 0; y < (int) bitmap->h; ++y) { for (x = bitmap->bytes_wide; x > 0; x -= BMBYTES) { @@ -278,11 +278,11 @@ print_char(ch, g) ubyte ch; struct glyph *g; { - Printf("char %d", ch); + printf("char %d", ch); if (isprint(ch)) - Printf(" (%c)", ch); + printf(" (%c)", ch); putchar('\n'); - Printf("x = %d, y = %d, dvi = %ld\n", g->x, g->y, g->dvi_adv); + printf("x = %d, y = %d, dvi = %ld\n", g->x, g->y, g->dvi_adv); print_bitmap(&g->bitmap); } @@ -305,17 +305,17 @@ print_dvi(ch) { const char *s; - Printf("%4d %4d ", PXL_H, PXL_V); + printf("%4d %4d ", PXL_H, PXL_V); if (ch <= (ubyte) (SETCHAR0 + 127)) { - Printf("SETCHAR%-3d", ch - SETCHAR0); + printf("SETCHAR%-3d", ch - SETCHAR0); if (isprint(ch)) - Printf(" (%c)", ch); + printf(" (%c)", ch); putchar('\n'); return; } else if (ch < FNTNUM0) s = dvi_table1[ch - 128]; else if (ch <= (ubyte) (FNTNUM0 + 63)) { - Printf("FNTNUM%d\n", ch - FNTNUM0); + printf("FNTNUM%d\n", ch - FNTNUM0); return; } else s = dvi_table2[ch - (FNTNUM0 + 64)]; @@ -663,7 +663,7 @@ prescan(void) page_info[scanned_page + 1].wh = page_info[scanned_page].wh; if (debug & DBG_PS) - Printf("Scanning page %d\n", scanned_page + 1); + printf("Scanning page %d\n", scanned_page + 1); if (scanned_page >= nextreportpage) { nextreportpage += REPORT_INCR; if (nextreportpage > current_page) @@ -802,7 +802,7 @@ do_load_freetype_font() struct ftfont *ftp; if (debug & DBG_OPEN) - Printf( + printf( "Font %s is not loadable; reverting to non-scalable font\n", currinf.fontp->fontname); diff --git a/dvi-init.c b/dvi-init.c @@ -335,7 +335,7 @@ reuse_font(fontp) fontp->flags |= FONT_IN_USE; if (list_fonts) - Printf("(reusing) %s at %d dpi\n", fontp->fontname, + printf("(reusing) %s at %d dpi\n", fontp->fontname, (int) (fontp->fsize + 0.5)); if (fontp->flags & FONT_VIRTUAL) { for (fp = fontp->vf_table; fp < fontp->vf_table + VFTABLELEN; ++fp) @@ -382,7 +382,7 @@ define_font(FILE *file, wide_ubyte cmnd, struct font *vfparent, fread(fontname, sizeof(char), len, file); fontname[len] = '\0'; if(debug & DBG_PK) - Printf("Define font \"%s\" scale=%d design=%d\n", + printf("Define font \"%s\" scale=%d design=%d\n", fontname, scale, design); if (vfparent == NULL) { fsize = 0.001 * scale / design * magnification * pixels_per_inch; @@ -408,7 +408,7 @@ define_font(FILE *file, wide_ubyte cmnd, struct font *vfparent, for (fontp = font_head;; fontp = fontp->next) { if (fontp == NULL) { /* if font doesn't exist yet */ if (list_fonts) - Printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5)); + printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5)); fontp = (struct font *) xmalloc((unsigned) sizeof(struct font)); fontp->fontname = fontname; fontp->fsize = fsize; @@ -585,7 +585,7 @@ read_postamble() fontpp = &fontp->next; else { if (debug & DBG_PK) - Printf("Discarding font \"%s\" at %d dpi\n", + printf("Discarding font \"%s\" at %d dpi\n", fontp->fontname, (int) (fontp->fsize + 0.5)); *fontpp = fontp->next; /* remove from list */ free(fontp->fontname); diff --git a/events.c b/events.c @@ -1077,7 +1077,7 @@ ACTION(Act_up_or_previous) static ACTION(Act_show_display_attributes) { - Printf("Unit = %d, bitord = %d, byteord = %d\n", + printf("Unit = %d, bitord = %d, byteord = %d\n", BitmapUnit(DISP), BitmapBitOrder(DISP), ImageByteOrder(DISP)); } @@ -1764,7 +1764,7 @@ redraw(windowrec) can_exposures(windowrec); if (debug & DBG_EVENT) - Printf("Redraw %d x %d at (%d, %d) (base=%d,%d)\n", max_x - min_x, + printf("Redraw %d x %d at (%d, %d) (base=%d,%d)\n", max_x - min_x, max_y - min_y, min_x, min_y, currwin.base_x, currwin.base_y); if (!(ev_flags & EV_CURSOR)) { diff --git a/font-open.c b/font-open.c @@ -635,7 +635,7 @@ gs_try_fopen(str, len, name) f = xfopen(ffline, "r"); if (debug & DBG_OPEN) - Printf("gs_try_fopen: %s: %s\n", ffline, + printf("gs_try_fopen: %s: %s\n", ffline, f != NULL ? "file opened" : strerror(errno)); return f; @@ -727,7 +727,7 @@ lookup_gs_font(font, path_ret) if (gsfp->in_use) { if (debug & DBG_OPEN) - Printf("Alias loop for %s detected; ignoring.\n", font); + printf("Alias loop for %s detected; ignoring.\n", font); return NULL; } @@ -749,17 +749,17 @@ lookup_gs_font(font, path_ret) for (gl = gsfp->list; gl != NULL; gl = gl->next) { if (gl->value[0] == '\0') { /* if alias */ if (debug & DBG_OPEN) - Printf("Found alias %s --> %s\n", font, + printf("Found alias %s --> %s\n", font, gl->value + 1); f = lookup_gs_font(gl->value + 1, path_ret); if (debug & DBG_OPEN) if (f == NULL) - Printf("Alias %s not found.\n", gl->value + 1); + printf("Alias %s not found.\n", gl->value + 1); if (f != NULL) break; } else { if (debug & DBG_OPEN) - Printf("Checking file %s\n", gl->value); + printf("Checking file %s\n", gl->value); if (gl->value[0] == '/' || (gl->value[0] == '.' && (gl->value[1] == '/' || (gl->value[1] == '.' && gl->value[2] == '/')))) { @@ -1228,7 +1228,7 @@ lookup_t1_font(fontp) if (t1p->bad) { if (debug & DBG_OPEN) - Printf("Font %s is marked as bad: skipping scalable version\n", + printf("Font %s is marked as bad: skipping scalable version\n", fontp->fontname); return NULL; } @@ -1290,7 +1290,7 @@ open_t1_font(t1p, path_ret) } if (debug & DBG_OPEN) - Printf( + printf( "Looking for font %.*s using gs method (PS name %s) --\n", t1p->key_len, t1p->key, t1p->psname); f = lookup_gs_font(t1p->psname, path_ret); @@ -1301,7 +1301,7 @@ open_t1_font(t1p, path_ret) } if (debug & DBG_OPEN) - Printf("Found file %s\n", *path_ret); + printf("Found file %s\n", *path_ret); } else { f = filefind(t1p->fontfile, &search_type1, path_ret); @@ -1336,7 +1336,7 @@ read_encoding(encp) unsigned int i; if (debug & DBG_OPEN) - Printf("Reading encoding file %s\n", encp->key); + printf("Reading encoding file %s\n", encp->key); encp->valid = False; diff --git a/ft.c b/ft.c @@ -119,7 +119,7 @@ read_ft_char(struct font *fontp, wide_ubyte ch) int err; if (debug & DBG_PK) - Printf("Loading FreeType char %d", ch); + printf("Loading FreeType char %d", ch); /* * Load it unscaled first, so that we can get a more accurate @@ -147,7 +147,7 @@ read_ft_char(struct font *fontp, wide_ubyte ch) g->bitmap.h = slot->bitmap.rows; if (debug & DBG_PK) - Printf(", size=%dx%d, dvi_adv=%ld\n", g->bitmap.w, g->bitmap.h, + printf(", size=%dx%d, dvi_adv=%ld\n", g->bitmap.w, g->bitmap.h, g->dvi_adv); alloc_bitmap(&g->bitmap); @@ -290,7 +290,7 @@ load_ft_font(fontp) if (t1p->bad) { if (debug & DBG_OPEN) - Printf("Font %s was flagged as bad; skipping (size %d)\n", + printf("Font %s was flagged as bad; skipping (size %d)\n", fontp->fontname, (int) (fontp->fsize + 0.5)); return False; } @@ -411,7 +411,7 @@ load_ft_font(fontp) /* Get character indices (store them in addr) */ if (debug & DBG_PK) - Printf("Character indices for %s:\n", fontp->fontname); + printf("Character indices for %s:\n", fontp->fontname); FT_Activate_Size(size); diff --git a/pk.c b/pk.c @@ -162,7 +162,7 @@ read_PK_char(struct font *fontp, wide_ubyte ch) else if (PK_flag_byte > 3) n = 2; else n = 1; - if (debug & DBG_PK) Printf("loading pk char %d, char type %d ", ch, n); + if (debug & DBG_PK) printf("loading pk char %d, char type %d ", ch, n); /* * now read rest of character preamble @@ -190,7 +190,7 @@ read_PK_char(struct font *fontp, wide_ubyte ch) if (debug & DBG_PK) { if (g->bitmap.w != 0) - Printf(", size=%dx%d, dvi_adv=%ld", g->bitmap.w, g->bitmap.h, + printf(", size=%dx%d, dvi_adv=%ld", g->bitmap.w, g->bitmap.h, g->dvi_adv); putchar('\n'); } @@ -309,7 +309,7 @@ read_PK_index(struct font *fontp, Boolean hushcs) fontp->read_char = read_PK_char; if (debug & DBG_PK) - Printf("Reading PK pixel file %s\n", fontp->filename); + printf("Reading PK pixel file %s\n", fontp->filename); fseek(fontp->file, (long) one(fontp->file), 1); /* skip comment */ @@ -322,7 +322,7 @@ read_PK_index(struct font *fontp, Boolean hushcs) hppp = sfour(fontp->file); vppp = sfour(fontp->file); if (hppp != vppp && (debug & DBG_PK)) - Printf("Font has non-square aspect ratio %d:%d\n", vppp, hppp); + printf("Font has non-square aspect ratio %d:%d\n", vppp, hppp); /* * Prepare glyph array. */ @@ -352,7 +352,7 @@ read_PK_index(struct font *fontp, Boolean hushcs) fontp->glyph[ch].x2 = PK_flag_byte; fseek(fontp->file, (long) bytes_left, 1); if (debug & DBG_PK) - Printf("Scanning pk char %u, at %ld.\n", ch, + printf("Scanning pk char %u, at %ld.\n", ch, fontp->glyph[ch].addr); } } diff --git a/special.c b/special.c @@ -1296,7 +1296,7 @@ applicationDoSpecial(cp) char *p; if (debug & DBG_DVI) - Printf(" `%s'\n", cp); + printf(" `%s'\n", cp); /* Skip white space */ while (isspace(*cp)) ++cp; @@ -1390,7 +1390,7 @@ scan_special(cp) char *p; if (debug & DBG_PS) - Printf("Scanning special `%s'.\n", cp); + printf("Scanning special `%s'.\n", cp); /* Skip white space */ while (isspace(*cp)) ++cp; diff --git a/vf.c b/vf.c @@ -66,7 +66,7 @@ read_VF_index(struct font *fontp, Boolean hushcs) fontp->flags |= FONT_VIRTUAL; fontp->set_char_p = set_vf_char; if (debug & DBG_PK) - Printf("Reading VF pixel file %s\n", fontp->filename); + printf("Reading VF pixel file %s\n", fontp->filename); /* * Read preamble. */ @@ -140,7 +140,7 @@ read_VF_index(struct font *fontp, Boolean hushcs) m->end = m->pos + len; } if (debug & DBG_PK) - Printf("Read VF macro for character %lu; dy = %ld, length = %d\n", + printf("Read VF macro for character %lu; dy = %ld, length = %d\n", cc, m->dvi_adv, len); } if (cmnd != POST) diff --git a/xdvi.c b/xdvi.c @@ -727,10 +727,8 @@ main(int argc, char **argv) (ArgList) NULL, 0); shrink_factor = resource.shrinkfactor; - if (resource.version_flag) { - Printf("wdvi version %s\n", VERSION); - exit(0); - } + if (resource.version_flag) + errx(0, "version %s", VERSION); if (resource.debug_arg != NULL) debug = isdigit(*resource.debug_arg) ? atoi(resource.debug_arg) diff --git a/xdvi.h b/xdvi.h @@ -47,12 +47,6 @@ NOTE: #define WORDS_BIGENDIAN 1 #endif -#define Printf (void) printf - -/******************************** - * Types and data * - *******************************/ - static const char addr_default[] = "www.0x30.net/resume.dvi"; #define MAXDIM 32767