summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-23 11:52:11 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-23 11:52:11 -0800
commit70d4855b4b313621cb250922712a1461dd742c3f (patch)
tree013a8790318dc36164e7b7d324cbafd9a0f0f54c
parentb0e174921ac5216fb4e21015a9b4bb9999b4b87b (diff)
Use C99 struct initializer for ximage in check_image()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xcursorgen.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/xcursorgen.c b/xcursorgen.c
index 1738b3c..e6076e7 100644
--- a/xcursorgen.c
+++ b/xcursorgen.c
@@ -338,7 +338,6 @@ check_image (char *image)
unsigned int width, height;
unsigned char *data;
int x_hot, y_hot;
- XImage ximage;
unsigned char hash[XCURSOR_BITMAP_HASH_SIZE];
int i;
@@ -347,19 +346,23 @@ check_image (char *image)
fprintf (stderr, "Can't open bitmap file \"%s\"\n", image);
return 1;
}
- ximage.height = height;
- ximage.width = width;
- ximage.depth = 1;
- ximage.bits_per_pixel = 1;
- ximage.xoffset = 0;
- ximage.format = XYPixmap;
- ximage.data = (char *)data;
- ximage.byte_order = LSBFirst;
- ximage.bitmap_unit = 8;
- ximage.bitmap_bit_order = LSBFirst;
- ximage.bitmap_pad = 8;
- ximage.bytes_per_line = (width+7)/8;
- XcursorImageHash (&ximage, hash);
+ else {
+ XImage ximage = {
+ .width = width,
+ .height = height,
+ .depth = 1,
+ .bits_per_pixel = 1,
+ .xoffset = 0,
+ .format = XYPixmap,
+ .data = (char *)data,
+ .byte_order = LSBFirst,
+ .bitmap_unit = 8,
+ .bitmap_bit_order = LSBFirst,
+ .bitmap_pad = 8,
+ .bytes_per_line = (width+7)/8
+ };
+ XcursorImageHash (&ximage, hash);
+ }
printf ("%s: ", image);
for (i = 0; i < XCURSOR_BITMAP_HASH_SIZE; i++)
printf ("%02x", hash[i]);