diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-03-30 08:44:33 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-03-30 08:44:33 -0700 |
commit | 2f6ff61d2edbffdd2949a0546a7df67603462fca (patch) | |
tree | 39a5e3cc900f39a6173e56c2912264abf64c0971 | |
parent | 0f8ad26dc4baed4c1807e23c1560907b0c145073 (diff) |
Use C99 struct initializers for XKeyboardControl values
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xload.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -297,9 +297,9 @@ static unsigned long current_leds; static void ClearLights (Display *dpy) { - XKeyboardControl cntrl; - - cntrl.led_mode = LedModeOff; + XKeyboardControl cntrl = { + .led_mode = LedModeOff + }; XChangeKeyboardControl (dpy, KBLedMode, &cntrl); current_leds = 0; } @@ -312,7 +312,6 @@ SetLights (XtPointer data, XtIntervalId *timer) double value; unsigned long new_leds, change, bit; int i; - XKeyboardControl cntrl; toplevel = (Widget) data; dpy = XtDisplay (toplevel); @@ -328,8 +327,10 @@ SetLights (XtPointer data, XtIntervalId *timer) { if (change & bit) { - cntrl.led = i; - cntrl.led_mode = new_leds & bit ? LedModeOn : LedModeOff; + XKeyboardControl cntrl = { + .led = i, + .led_mode = new_leds & bit ? LedModeOn : LedModeOff + }; XChangeKeyboardControl (dpy, KBLed|KBLedMode, &cntrl); current_leds ^= bit; } |