From 312324cc64cbb918e47526056de8c9c8d0693f79 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Sun, 22 Mar 2009 18:59:56 +0000 Subject: more cleanup --- zwgc/X_driver.c | 1 + zwgc/X_gram.c | 2 +- zwgc/X_gram.h | 2 +- zwgc/eval.c | 4 ++-- zwgc/plus.c | 4 ++-- zwgc/plus.h | 2 +- zwgc/xcut.c | 3 ++- zwgc/xmark.c | 1 + zwgc/xrevstack.c | 1 + zwgc/xshow.c | 5 +++-- 10 files changed, 15 insertions(+), 10 deletions(-) (limited to 'zwgc') diff --git a/zwgc/X_driver.c b/zwgc/X_driver.c index 2a71cc2..a51ddd1 100644 --- a/zwgc/X_driver.c +++ b/zwgc/X_driver.c @@ -27,6 +27,7 @@ static const char rcsid_X_driver_c[] = "$Id$"; #ifndef X_DISPLAY_MISSING +#include #include "new_string.h" #include "X_driver.h" #include diff --git a/zwgc/X_gram.c b/zwgc/X_gram.c index 917b5be..390d061 100644 --- a/zwgc/X_gram.c +++ b/zwgc/X_gram.c @@ -428,7 +428,7 @@ x_gram_draw(Display *dpy, XGCValues gcvals; xblock *xb; XTextItem text; - int startblock,endblock,startpixel,endpixel; + int startblock, endblock, startpixel = 0, endpixel = 0; #define SetFG(fg) \ gcvals.foreground=fg; \ diff --git a/zwgc/X_gram.h b/zwgc/X_gram.h index d051f5e..62a1567 100644 --- a/zwgc/X_gram.h +++ b/zwgc/X_gram.h @@ -40,7 +40,7 @@ typedef struct _x_gram { struct _x_gram *below,*above; Window w; #ifdef CMU_ZWGCPLUS - char *notice; + ZNotice_t *notice; #endif struct timeval can_die; } x_gram; diff --git a/zwgc/eval.c b/zwgc/eval.c index 33c4140..b33ea6d 100644 --- a/zwgc/eval.c +++ b/zwgc/eval.c @@ -115,9 +115,9 @@ string eval_expr(Node *expr) { int opcode = expr->opcode; - int bool_result; + int bool_result = 0; string first, second; - char *result; + char *result = NULL; string *text_ptr; /* diff --git a/zwgc/plus.c b/zwgc/plus.c index 313dda9..d9860b1 100644 --- a/zwgc/plus.c +++ b/zwgc/plus.c @@ -431,7 +431,7 @@ get_list_refcount(ZNotice_t *notice) } /* export a reference to the current notice. */ -char * +ZNotice_t * get_stored_notice(void) { if (!stored_notice) @@ -439,7 +439,7 @@ get_stored_notice(void) list_add_notice(stored_notice); - return (char *)stored_notice; + return stored_notice; } void diff --git a/zwgc/plus.h b/zwgc/plus.h index 72408eb..7a6f052 100644 --- a/zwgc/plus.h +++ b/zwgc/plus.h @@ -17,7 +17,7 @@ extern int list_del_notice(ZNotice_t *notice); extern int get_list_refcount(ZNotice_t *notice); extern void set_notice_fake(ZNotice_t *notice, int val); extern int get_notice_fake(ZNotice_t *notice); -extern char *get_stored_notice(void); +extern ZNotice_t *get_stored_notice(void); extern void plus_retry_notice(ZNotice_t *notice, char ch, int metaflag); extern void set_stored_notice(ZNotice_t *notice); extern void plus_window_deletions(ZNotice_t *notice); /* actually in xshow.c */ diff --git a/zwgc/xcut.c b/zwgc/xcut.c index e1ce7c7..6345713 100644 --- a/zwgc/xcut.c +++ b/zwgc/xcut.c @@ -224,7 +224,8 @@ xcut(Display *dpy, */ zwgcplus = 1; - plusvar = ZGetVariable("zwgcplus") ? ZGetVariable("zwgcplus") : (char *)var_get_variable("zwgcplus"); + plusvar = ZGetVariable("zwgcplus") + ? ZGetVariable("zwgcplus") : var_get_variable("zwgcplus"); if ((plusvar[0]=='\0') || (strcmp(plusvar,"no") == 0)) zwgcplus = 0; diff --git a/zwgc/xmark.c b/zwgc/xmark.c index 6a6a7a0..1f4200a 100644 --- a/zwgc/xmark.c +++ b/zwgc/xmark.c @@ -23,6 +23,7 @@ static const char rcsid_xmark_c[] = "$Id$"; #include #include +#include #include "X_gram.h" #include "X_fonts.h" #include "xmark.h" diff --git a/zwgc/xrevstack.c b/zwgc/xrevstack.c index 2bd3f26..12e15ab 100644 --- a/zwgc/xrevstack.c +++ b/zwgc/xrevstack.c @@ -22,6 +22,7 @@ static const char rcsid_xrevstack_c[] = "$Id$"; #ifndef X_DISPLAY_MISSING #ifndef TRUEREVSTACK +#include #include "X_gram.h" x_gram *bottom_gram = NULL; diff --git a/zwgc/xshow.c b/zwgc/xshow.c index bb7415f..20bca23 100644 --- a/zwgc/xshow.c +++ b/zwgc/xshow.c @@ -24,6 +24,7 @@ static const char rcsid_xshow_c[] = "$Id$"; #include #include #include +#include #include "pointer_dictionary.h" #include "new_memory.h" #include "new_string.h" @@ -141,7 +142,7 @@ fixup_and_draw(Display *dpy, int line, block=0; int maxwidth=0, chars=0, maxascent, maxdescent; - int ssize, lsize,csize, rsize, width; + int ssize, lsize,csize, rsize, width = 0; int i, ascent, descent; int yofs = internal_border_width; @@ -607,7 +608,7 @@ plus_window_deletions(ZNotice_t *notice) done = 1; tmp = bottom_gram; while (tmp) { - if (tmp->notice == (char *)notice) { + if (tmp->notice == notice) { fry = tmp; tmp = tmp->above; xdestroygram(dpy, fry->w, desc_context, fry); -- cgit v1.2.3