wdvi

network DVI viewer
Log | Files | Refs

commit 5ec9cae7df76a48adf8f77a4d0f275c8b8501c26
parent 3f7715c50e6cd7688b92b5e521b174f418ecf749
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu, 26 Aug 2021 15:26:29 +0000

Remove strange function declaration macros

Diffstat:
Mdvi-draw.c | 16++++++++--------
Mevents.c | 19++++++++-----------
Mfont-open.c | 2+-
Mpopups.c | 44++++++++++++++++----------------------------
Mxdvi.c | 5++---
Mxdvi.h | 18------------------
6 files changed, 35 insertions(+), 69 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -851,10 +851,10 @@ prescan() #ifndef TEXXET long -set_char P1C(wide_ubyte, ch) +set_char(wide_ubyte ch) #else void -set_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +set_char(wide_ubyte cmd, wide_ubyte ch) #endif { struct glyph *g; @@ -918,10 +918,10 @@ set_char P2C(wide_ubyte, cmd, wide_ubyte, ch) /* ARGSUSED */ #ifndef TEXXET static long -set_empty_char P1C(wide_ubyte, ch) +set_empty_char(wide_ubyte ch) #else static void -set_empty_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +set_empty_char(wide_ubyte cmd, wide_ubyte ch) #endif { #ifndef TEXXET @@ -937,7 +937,7 @@ long load_n_set_char P1C(wide_ubyte, ch) #else void -load_n_set_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +load_n_set_char(wide_ubyte cmd, wide_ubyte ch) #endif { if (!load_font(currinf.fontp)) { /* if not found */ @@ -967,7 +967,7 @@ long set_vf_char P1C(wide_ubyte, ch) #else void -set_vf_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +set_vf_char(wide_ubyte cmd, wide_ubyte ch) #endif { struct macro *m; @@ -1086,7 +1086,7 @@ long set_ft_char P1C(wide_ubyte, ch) # else void -set_ft_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +set_ft_char(wide_ubyte cmd, wide_ubyte ch) # endif { do_load_freetype_font(); @@ -1106,7 +1106,7 @@ static long set_no_char P1C(wide_ubyte, ch) #else static void -set_no_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +set_no_char(wide_ubyte cmd, wide_ubyte ch) #endif { if (currinf.virtual) { diff --git a/events.c b/events.c @@ -95,16 +95,13 @@ static XColor bg_Color; void name(Widget, XEvent *, String *, Cardinal *) #define ACTION(name) \ - void \ - name P4C(Widget, w, \ - XEvent *, event, \ - String *, params, \ - Cardinal *, num_params) + void name(Widget w, XEvent *event, \ + String *params, Cardinal *num_params) /* ARGSUSED */ void -null_mouse P1C(XEvent *, event) +null_mouse(XEvent *event) { } @@ -921,7 +918,7 @@ home(wide_bool scrl) */ static void -home_bottom P1C(wide_bool, scrl) +home_bottom(wide_bool scrl) { XUnmapWindow(DISP, mane.win); get_xy(); @@ -1654,7 +1651,7 @@ ACTION(Act_magnifier) } static void -mag_motion P1C(XEvent *, event) +mag_motion(XEvent *event) { new_mag_x = event->xmotion.x + mag_conv_x; main_x = event->xmotion.x_root - new_mag_x; @@ -1669,7 +1666,7 @@ mag_motion P1C(XEvent *, event) /* ARGSUSED */ static void -mag_release P1C(XEvent *, event) +mag_release(XEvent *event) { if (alt.win != (Window) 0) { if (alt_stat) @@ -1755,7 +1752,7 @@ ACTION(Act_drag) static void -drag_motion P1C(XEvent *, event) +drag_motion(XEvent *event) { if (drag_flags & 2) { /* if horizontal motion */ @@ -1777,7 +1774,7 @@ drag_motion P1C(XEvent *, event) static void -drag_release P1C(XEvent *, event) +drag_release(XEvent *event) { drag_motion(event); mouse_motion = mouse_release = null_mouse; diff --git a/font-open.c b/font-open.c @@ -1009,7 +1009,7 @@ get_gs_token(gsfp, pos, pos_ret, file_type) static short gs_fontmap_number = 0; static void -process_gs_fontmap P1C(FILE *, f) +process_gs_fontmap(FILE *f) { struct gsfile gsf; unsigned char buffer[GS_BUF_SIZE]; diff --git a/popups.c b/popups.c @@ -1182,8 +1182,7 @@ cb_file_go(w, client_data, call_data) /* ARGSUSED */ static void -act_file_go P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_go(Widget w, XEvent *event, String *params, Cardinal *num_params) { cb_file_go(NULL, NULL, NULL); } @@ -1237,8 +1236,7 @@ select_file_entry(w) /* ARGSUSED */ static void -act_file_click P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_click(Widget w, XEvent *event, String *params, Cardinal *num_params) { select_file_entry(w); } @@ -1256,8 +1254,7 @@ select_by_seq(seq) /* ARGSUSED */ static void -act_file_arrow P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_arrow(Widget w, XEvent *event, String *params, Cardinal *num_params) { Dimension ch; /* height of clip widget */ Position fy; /* (minus) position of list in vport */ @@ -1327,8 +1324,7 @@ act_file_arrow P4C(Widget, w, XEvent *, event, String *, params, /* ARGSUSED */ static void -act_file_home P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_home(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (wl_num != 0) select_by_seq(0); @@ -1336,8 +1332,7 @@ act_file_home P4C(Widget, w, XEvent *, event, String *, params, /* ARGSUSED */ static void -act_file_end P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_end(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (wl_num != 0) select_by_seq(wl_num - 1); @@ -1351,8 +1346,7 @@ act_file_end P4C(Widget, w, XEvent *, event, String *, params, /* ARGSUSED */ static void -act_file_scroll P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_scroll(Widget w, XEvent *event, String *params, Cardinal *num_params) { Dimension ch, fh; /* clip and form (child) heights */ Position y; @@ -1466,8 +1460,7 @@ rebuild_suffixes(s) /* ARGSUSED */ static void -act_file_suffixes P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_file_suffixes(Widget w, XEvent *event, String *params, Cardinal *num_params) { char *s; @@ -1496,8 +1489,7 @@ right_justify_widget(w, form_width) /* ARGSUSED */ void -Act_open_dvi_file P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +Act_open_dvi_file(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (file_active) { XRaiseWindow(DISP, XtWindow(file_shell)); @@ -1977,16 +1969,14 @@ range_handle_key(widget, closure, ev, cont) /* ARGSUSED */ static void -print_act_go P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +print_act_go(Widget w, XEvent *event, String *params, Cardinal *num_params) { print_precheck(); } /* ARGSUSED */ void -Act_print P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +Act_print(Widget w, XEvent *event, String *params, Cardinal *num_params) { static Widget r7label3; static Widget r9cancel; @@ -3102,24 +3092,22 @@ cb_dvips_delete(w, client_data, call_data) /* ARGSUSED */ static void -printlog_act_close P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +printlog_act_close(Widget w, XEvent *event, String *params, Cardinal *num_params) { cb_dvips_close(NULL, NULL, NULL); } /* ARGSUSED */ static void -printlog_act_keep P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +printlog_act_keep(Widget w, XEvent *event, String *params, Cardinal *num_params) { XtVaSetValues(printlog_keep, XtNstate, True, NULL); } /* ARGSUSED */ static void -printlog_act_unkeep P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +printlog_act_unkeep(Widget w, XEvent *event, String *params, + Cardinal *num_params) { XtVaSetValues(printlog_keep, XtNstate, False, NULL); if (dvips_status == DVIPS_STAT_NONE) @@ -3128,8 +3116,8 @@ printlog_act_unkeep P4C(Widget, w, XEvent *, event, String *, params, /* ARGSUSED */ static void -printlog_act_cancel P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +printlog_act_cancel(Widget w, XEvent *event, String *params, + Cardinal *num_params) { cb_dvips_cancel(NULL, NULL, NULL); } diff --git a/xdvi.c b/xdvi.c @@ -837,7 +837,7 @@ XdviCvtStringToBool3(dpy, args, num_args, fromVal, toVal, closure_ret) * this routine and read by the displaying copy of xdvi. */ -static int XdviErrorHandler P2H(Display *, XErrorEvent *); +static int XdviErrorHandler(Display *, XErrorEvent *); static unsigned long xdvi_next_request = 0; static int xerrno; @@ -1423,8 +1423,7 @@ cb_addr_go(Widget w, XtPointer client_data, XtPointer call_data) } static void -act_addr_go P4C(Widget, w, XEvent *, event, String *, params, - Cardinal *, num_params) +act_addr_go(Widget w, XEvent *event, String *params, Cardinal *num_params) { cb_addr_go(w, NULL, NULL); } diff --git a/xdvi.h b/xdvi.h @@ -83,24 +83,6 @@ typedef char Bool3; /* Yes/No/Maybe */ # include <ft2build.h> # include FT_FREETYPE_H -#ifndef KPATHSEA - -/* These macros munge function declarations to make them work in both - cases. The P?H macros are used for declarations, the P?C for - definitions. See <ansidecl.h> from the GNU C library. P1H(void) - also works for definitions of routines which take no args. */ - -#define P1H(p1) (p1) -#define P2H(p1, p2) (p1, p2) - -#define P1C(t1,n1)(t1 n1) -#define P2C(t1,n1, t2,n2)(t1 n1, t2 n2) -#define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3) -#define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4) - -#endif /* not KPATHSEA */ - - #define NORETURN __attribute__((__noreturn__)) #define UNUSED __attribute__((__unused__))