summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-30 08:44:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-30 08:44:33 -0700
commit2f6ff61d2edbffdd2949a0546a7df67603462fca (patch)
tree39a5e3cc900f39a6173e56c2912264abf64c0971
parent0f8ad26dc4baed4c1807e23c1560907b0c145073 (diff)
Use C99 struct initializers for XKeyboardControl values
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-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;
}