X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/623f81b71eb7e64412adce7cbc1f0d0141f20f51..7d22c2e8c8e4104bcd39f35ebeaa5f81edd374cf:/unix/pterm.c?ds=sidebyside diff --git a/unix/pterm.c b/unix/pterm.c index b1b98c1e..358ba4f6 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -1352,7 +1352,7 @@ void beep(void *frontend, int mode) gdk_beep(); } -int CharWidth(Context ctx, int uc) +int char_width(Context ctx, int uc) { /* * Under X, any fixed-width font really _is_ fixed-width. @@ -1779,18 +1779,22 @@ int do_cmdline(int argc, char **argv, int do_everything) extern char **pty_argv; /* declared in pty.c */ /* - * Macros to make argument handling easier. + * Macros to make argument handling easier. Note that because + * they need to call `continue', they cannot be contained in + * the usual do {...} while (0) wrapper to make them + * syntactically single statements; hence it is not legal to + * use one of these macros as an unbraced statement between + * `if' and `else'. */ -#define EXPECTS_ARG do { \ +#define EXPECTS_ARG { \ if (--argc <= 0) { \ err = 1; \ fprintf(stderr, "pterm: %s expects an argument\n", p); \ + continue; \ } else \ val = *++argv; \ -} while (0) -#define SECOND_PASS_ONLY do { \ - if (!do_everything) continue; \ -} while (0) +} +#define SECOND_PASS_ONLY { if (!do_everything) continue; } /* * TODO: