[hackers] [svkbd] a few more tweaks || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 5 Aug 2020 00:10:24 +0200 (CEST)

commit 0bd17df5ed0a121f003a4a26c265dc54a0fa923d
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Wed Aug 5 00:09:41 2020 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Wed Aug 5 00:09:41 2020 +0200

    a few more tweaks

diff --git a/svkbd.c b/svkbd.c
index 563bb17..d49bcd8 100644
--- a/svkbd.c
+++ b/svkbd.c
_AT_@ -37,13 +37,10 @@ enum { SchemeNorm, SchemePress, SchemeHighlight, SchemeLast };
 enum { NetWMWindowType, NetLast };
 
 /* typedefs */
-typedef unsigned int uint;
-typedef unsigned long ulong;
-
 typedef struct {
         char *label;
         KeySym keysym;
- uint width;
+ unsigned int width;
         int x, y, w, h;
         Bool pressed;
         Bool highlighted;
_AT_@ -51,7 +48,7 @@ typedef struct {
 
 typedef struct {
         KeySym mod;
- uint button;
+ unsigned int button;
 } Buttonmod;
 
 /* function declarations */
_AT_@ -349,9 +346,8 @@ hasoverlay(KeySym keysym)
 void
 leavenotify(XEvent *e)
 {
- if (currentoverlay != -1) {
+ if (currentoverlay != -1)
                 hideoverlay();
- }
         unpress(NULL, 0);
 }
 
_AT_@ -463,7 +459,8 @@ unpress(Key *k, KeySym mod)
                         enableoverlays = !enableoverlays;
                         break;
                 case XK_Break:
- running = False;
+ running = False;
+ break;
                 default:
                         break;
                 }
_AT_@ -599,9 +596,9 @@ setup(void)
         XTextProperty str;
         XSizeHints *sizeh = NULL;
         XClassHint *ch;
+ XWMHints *wmh;
         Atom atype = -1;
         int i, j, sh, sw;
- XWMHints *wmh;
 
 #ifdef XINERAMA
         XineramaScreenInfo *info = NULL;
_AT_@ -629,7 +626,7 @@ setup(void)
 
         /* find an unused keycode to use as a temporary keycode (derived from source:
            https://stackoverflow.com/questions/44313966/c-xtest-emitting-key-presses-for-every-unicode-character) */
- KeySym *keysyms = NULL;
+ KeySym *keysyms;
         int keysyms_per_keycode = 0;
         int keycode_low, keycode_high;
         Bool key_is_empty;
_AT_@ -817,10 +814,10 @@ showoverlay(int idx)
         }
 
         for (i = idx, j=0; i < OVERLAYS; i++, j++) {
- if (overlay[i].keysym == XK_Cancel) {
+ if (overlay[i].keysym == XK_Cancel)
                         break;
- }
- while (keys[j].keysym == 0) j++;
+ while (keys[j].keysym == 0)
+ j++;
                 keys[j].label = overlay[i].label;
                 keys[j].keysym = overlay[i].keysym;
         }
_AT_@ -835,7 +832,7 @@ showoverlay(int idx)
 void
 hideoverlay(void)
 {
- if (debug) printdbg("Hiding overlay %d\n", currentoverlay);
+ if (debug) printdbg("Hiding overlay, overlay was #%d\n", currentoverlay);
         currentoverlay = -1;
         overlaykeysym = 0;
         currentlayer = -1;
_AT_@ -847,7 +844,7 @@ sigterm(int signo)
 {
         running = False;
         sigtermd = True;
- if (debug) printdbg("Sigterm received\n");
+ if (debug) printdbg("SIGTERM received\n");
 }
 
 void
Received on Wed Aug 05 2020 - 00:10:24 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 05 2020 - 00:12:34 CEST