wdvi

network DVI viewer
Log | Files | Refs

commit c51aa30b9e96e3817c95d0e0938de7a7b2cb5b33
parent 1b7b2c8a2aaef4fe245d1fb467668c5cb90fbb02
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu,  9 Mar 2023 01:28:29 +0000

cleanup in print_dvi()

- ansi function signature
- statement bodies on new line

Diffstat:
Mdvi-draw.c | 29++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -293,28 +293,31 @@ static const char *dvi_table2[] = { "SREFL", "EREFL", NULL, NULL, NULL, NULL}; static void -print_dvi(ch) - ubyte ch; +print_dvi(ubyte ch) { const char *s; printf("%4d %4d ", PXL_H, PXL_V); if (ch <= (ubyte) (SETCHAR0 + 127)) { - printf("SETCHAR%-3d", ch - SETCHAR0); - if (isprint(ch)) - printf(" (%c)", ch); - putchar('\n'); - return; + printf("SETCHAR%-3d", ch - SETCHAR0); + if (isprint(ch)) + printf(" (%c)", ch); + putchar('\n'); + return; } - else if (ch < FNTNUM0) s = dvi_table1[ch - 128]; + else if (ch < FNTNUM0) + s = dvi_table1[ch - 128]; else if (ch <= (ubyte) (FNTNUM0 + 63)) { - printf("FNTNUM%d\n", ch - FNTNUM0); - return; + printf("FNTNUM%d\n", ch - FNTNUM0); + return; } - else s = dvi_table2[ch - (FNTNUM0 + 64)]; - if (s) puts(s); else - tell_oops("unknown op-code %d", ch); + s = dvi_table2[ch - (FNTNUM0 + 64)]; + + if (s) + puts(s); + else + tell_oops("unknown op-code %d", ch); }