diff --git a/ChangeLog b/ChangeLog index f24b1a91b05e51dcfff7f4dbbf1c5042cfea8b72..2ef3170b2b77e0d6e8327a4c31520104af066e4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ before trying the legacy ways. Patch by Mike Frysinger. * configure.ac - Add a configure flag to disable the use of the fattening libmagic. Patch by Mike Frysinger. + * src/{global,rcfile,winio}.c - Print menu numbers for debugging + in hex, and tweak a few of those debugging messages. 2014-03-23 Benno Schulenberg <bensberg@justemail.net> * src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a diff --git a/src/global.c b/src/global.c index e5fdc6793bee5c4f2bd147f0ad5fba9988132191..37384f74e844b21fd6045416f27549af68a5e730 100644 --- a/src/global.c +++ b/src/global.c @@ -354,7 +354,7 @@ const sc *first_sc_for(int menu, void (*func)(void)) return rawsc; #ifdef DEBUG - fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu); + fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long) func, menu); #endif /* Otherwise... */ return NULL; @@ -395,8 +395,7 @@ void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggl assign_keyinfo(s); #ifdef DEBUG - fprintf(stderr, "list val = %d\n", (int) s->menu); - fprintf(stderr, "Hey, set sequence to %d for shortcut \"%s\"\n", s->seq, scstring); + fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menu %x\n", s->seq, scstring, (int) s->menu); #endif } @@ -490,7 +489,7 @@ void print_sclist(void) for (s = sclist; s->next != NULL; s = s->next) { f = sctofunc(s); if (f) - fprintf(stderr, "Shortcut \"%s\", function: %s, menus %d\n", s->keystr, f->desc, f->menus); + fprintf(stderr, "Shortcut \"%s\", function: %s, menus %x\n", s->keystr, f->desc, f->menus); else fprintf(stderr, "Hmm, didnt find a func for \"%s\"\n", s->keystr); } diff --git a/src/rcfile.c b/src/rcfile.c index c1cdcfdc26a9304acf5ebf048194e4c186587ef5..e1001676d1f34b7a11ab28b3f6f4ea94896679b1 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -521,7 +521,7 @@ void parse_keybinding(char *ptr) } #ifdef DEBUG - fprintf(stderr, "newsc now address %d, menu func assigned = %d, menu = %d\n", + fprintf(stderr, "newsc now address %d, func assigned = %d, menu = %x\n", &newsc, newsc->scfunc, menu); #endif @@ -544,10 +544,10 @@ void parse_keybinding(char *ptr) we found for the same menu, then make this the new beginning. */ for (s = sclist; s != NULL; s = s->next) { if (((s->menu & newsc->menu)) && s->seq == newsc->seq) { - s->menu &= ~newsc->menu; #ifdef DEBUG - fprintf(stderr, "replaced menu entry %d\n", s->menu); + fprintf(stderr, "replacing entry in menu %x\n", s->menu); #endif + s->menu &= ~newsc->menu; } } newsc->next = sclist; @@ -602,16 +602,16 @@ void parse_unbinding(char *ptr) } #ifdef DEBUG - fprintf(stderr, "unbinding \"%s\" from menu = %d\n", keycopy, menu); + fprintf(stderr, "unbinding \"%s\" from menu %x\n", keycopy, menu); #endif /* Now find the appropriate entries in the menu to delete. */ for (s = sclist; s != NULL; s = s->next) { if (((s->menu & menu)) && !strcmp(s->keystr,keycopy)) { - s->menu &= ~menu; #ifdef DEBUG - fprintf(stderr, "deleted menu entry %d\n", s->menu); + fprintf(stderr, "deleting entry from menu %x\n", s->menu); #endif + s->menu &= ~menu; } } } diff --git a/src/winio.c b/src/winio.c index 00a384fe3c4d1a38514677bc31615b6c6fa1d158..900b7180991c421033500013ca8026a3fc20b8ca 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1786,13 +1786,13 @@ const sc *get_shortcut(int menu, int *kbinput, bool && ((s->type == META && *meta_key == TRUE && *kbinput == s->seq) || (s->type != META && *kbinput == s->seq))) { #ifdef DEBUG - fprintf (stderr, "matched seq \"%s\" and btw meta was %d (menus %d = %d)\n", s->keystr, *meta_key, menu, s->menu); + fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menus %x = %x)\n", s->keystr, *meta_key, menu, s->menu); #endif return s; } } #ifdef DEBUG - fprintf (stderr, "matched nothing btw meta was %d\n", *meta_key); + fprintf (stderr, "matched nothing, btw meta was %d\n", *meta_key); #endif return NULL; @@ -2387,7 +2387,7 @@ void bottombars(int menu) continue; #ifdef DEBUG - fprintf(stderr, "found one! f->menus = %d, desc = \"%s\"\n", f->menus, f->desc); + fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc); #endif s = first_sc_for(menu, f->scfunc); if (s == NULL) {