wdvi

network DVI viewer
Log | Files | Refs

commit 372c9f68e9b7a3f360fef8c6f358be26256ceca7
parent 4c268af062b5196a27eef1fca9b63ad0d3884009
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Mon, 16 Aug 2021 22:48:37 +0000

Unifdef INIT(x) =x

Remove another layer of indirection.

Diffstat:
Mdvi-draw.c | 2+-
Mxdvi.h | 70++++++++++++++++++++++++++++++++++------------------------------------
2 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -63,7 +63,7 @@ static struct frame *current_frame; /* Points to drawinf record containing current dvi file location (for update by geom_scan). */ -static struct drawinf *dvi_pointer_frame INIT(NULL); +static struct drawinf *dvi_pointer_frame = NULL; #ifndef TEXXET #define DIR 1 diff --git a/xdvi.h b/xdvi.h @@ -150,8 +150,6 @@ typedef char Bool3; /* Yes/No/Maybe */ * Types and data * *******************************/ -#define INIT(x) =x - #define MAXDIM 32767 typedef unsigned char ubyte; @@ -231,11 +229,11 @@ struct drawinf currinf; int current_page; int total_pages; -int pageno_correct INIT(1); +int pageno_correct = 1; long magnification; double dimconv; double tpic_conv; -int n_files_left INIT(32767); /* for LRU closing of fonts */ +int n_files_left = 32767; /* for LRU closing of fonts */ unsigned int page_w, page_h; #if defined(GS_PATH) && !defined(PS_GS) @@ -267,7 +265,7 @@ int scanned_page_reset; /* number to reset the above to */ * a window to associate the process to, so we have to prescan twice. */ #if PS_GS -Boolean gs_postpone_prescan INIT(False); +Boolean gs_postpone_prescan = False; #endif /* @@ -286,7 +284,7 @@ struct per_page *page_info; /* * Set if the -paper option overrides papersize specials. */ -Boolean ignore_papersize_specials INIT(False); +Boolean ignore_papersize_specials = False; /* * Mechanism for reducing repeated warning about specials, lost characters, etc. @@ -296,17 +294,17 @@ Boolean warn_spec_now; /* * If we're in the middle of a PSFIG special. */ -Boolean psfig_begun INIT(False); +Boolean psfig_begun = False; /* * Page on which to draw box from forward source special searching. */ -int source_fwd_box_page INIT(-1); /* -1 means no box */ +int source_fwd_box_page = -1; /* -1 means no box */ /* * Information on deferred source operation. See do_pages() for meaning. */ -const char *source_forward_string INIT(NULL); +const char *source_forward_string = NULL; int source_reverse_x, source_reverse_y; int source_show_all; @@ -418,10 +416,10 @@ struct tn { }; struct font *tn_table[TNTABLELEN]; -struct font *font_head INIT(NULL); -struct tn *tn_head INIT(NULL); +struct font *font_head = NULL; +struct tn *tn_head = NULL; ubyte maxchar; -unsigned short current_timestamp INIT(0); +unsigned short current_timestamp = 0; /* * Command line flags. @@ -558,7 +556,7 @@ struct pagecolor { }; /* Information on background color and initial color stack for each page. */ -struct pagecolor *page_colors INIT(NULL); +struct pagecolor *page_colors = NULL; /* The initial color stack is gotten from the pagecolor record for a page. */ const struct rgb *color_bottom; @@ -597,18 +595,18 @@ struct fgrec { #endif }; -struct bgrec *bg_head INIT(NULL); /* head of list */ -struct bgrec *bg_current INIT(NULL); /* current bg value */ +struct bgrec *bg_head = NULL; /* head of list */ +struct bgrec *bg_current = NULL; /* current bg value */ struct fgrec *fg_current; /* current fg value */ -struct fgrec *fg_active INIT(NULL); /* where the GCs are */ +struct fgrec *fg_active = NULL; /* where the GCs are */ /* List of allocated colors (to be deallocated upon document change) */ Pixel *color_list; /* list of colors */ -unsigned int color_list_len INIT(0); /* current len of list*/ -unsigned int color_list_max INIT(0); /* allocated size */ +unsigned int color_list_len = 0; /* current len of list*/ +unsigned int color_list_max = 0; /* allocated size */ /* Whether the color situation has been warned about. */ -Boolean color_warned INIT(False); +Boolean color_warned = False; /* Cursor color (for XRecolorCursor). */ extern XColor cr_Color; @@ -621,7 +619,7 @@ extern struct mg_size_rec { } mg_size[5]; -int debug INIT(0); +int debug = 0; #define DBG_BITMAP 1 #define DBG_DVI 2 @@ -637,15 +635,15 @@ int offset_x, offset_y; unsigned int unshrunk_paper_w, unshrunk_paper_h; unsigned int unshrunk_page_w, unshrunk_page_h; -char *dvi_name INIT(NULL); /* dvi file name */ +char *dvi_name = NULL; /* dvi file name */ FILE *dvi_file; /* user's file */ -Boolean dvi_file_ready INIT(False); +Boolean dvi_file_ready = False; /* done with font generation and prescanning */ time_t dvi_time; /* last modification time */ ino_t dvi_inode; /* used for source specials */ unsigned char *dvi_property; /* for setting in window */ size_t dvi_property_length; -Boolean titles_are_stale INIT(True); +Boolean titles_are_stale = True; /* replace icon/window titles */ const char *prog; int bak_shrink; /* last shrink factor != 1 */ @@ -731,8 +729,8 @@ Pixel *pixeltbl_t; #define EV_NOWAIT EV_GE_IDLE -unsigned int ev_flags INIT(EV_IDLE); -volatile int event_counter INIT(0); +unsigned int ev_flags = EV_IDLE; +volatile int event_counter = 0; jmp_buf canit_env; struct xchild { @@ -781,18 +779,18 @@ struct WindowRec { extern struct WindowRec mane, alt, currwin; int min_x, max_x, min_y, max_y; -Boolean drawing_mag INIT(False); +Boolean drawing_mag = False; #define shrink_factor currwin.shrinkfactor -Widget top_level INIT(0); +Widget top_level = 0; Widget vport_widget, draw_widget, clip_widget; # if BUTTONS Widget form_widget; -int xtra_wid INIT(0); +int xtra_wid = 0; extern const char default_button_config[]; /* defined in events.c */ Widget panel_widget; -Cursor panel_cursor INIT(0); +Cursor panel_cursor = 0; # endif #define WARN(t, s) (void) warning_popup(s, "OK", NULL) @@ -806,10 +804,10 @@ Cursor panel_cursor INIT(0); * and then raise them later, due to unpredictable window manager behavior. */ -Boolean postpone_popups INIT(True); -size_t n_init_popups INIT(0); +Boolean postpone_popups = True; +size_t n_init_popups = 0; Widget *init_popups; -size_t alloc_init_popups INIT(0); +size_t alloc_init_popups = 0; /* * Structure to use for status popups. @@ -823,11 +821,11 @@ struct status_popup { Boolean spurious; }; -char *ffline INIT(NULL); /* an array used by filefind to store */ +char *ffline = NULL; /* an array used by filefind to store */ /* the file name being formed. */ /* It expands as needed. */ /* Also used elsewhere. */ -size_t ffline_len INIT(0); /* current length of ffline[] */ +size_t ffline_len = 0; /* current length of ffline[] */ #if FREETYPE || PS @@ -901,8 +899,8 @@ struct geom_info { typedef void (*mouse_proc) ARGS((XEvent *)); extern void null_mouse ARGS((XEvent *)); -mouse_proc mouse_motion INIT(null_mouse); -mouse_proc mouse_release INIT(null_mouse); +mouse_proc mouse_motion = null_mouse; +mouse_proc mouse_release = null_mouse; /* Used for source special lookup (forward search) and for window manager delete protocol (toolkit only). */