summaryrefslogtreecommitdiff
path: root/xload.c
diff options
context:
space:
mode:
Diffstat (limited to 'xload.c')
-rw-r--r--xload.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/xload.c b/xload.c
index 952c3fc..41a8802 100644
--- a/xload.c
+++ b/xload.c
@@ -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;
}