diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2015-12-29 17:35:00 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-12-29 20:47:40 +0100 |
commit | cc3e97aa0141410eb8b05cab34aecf65f44a164c (patch) | |
tree | f7b72d19129e8172cdde52706634b3935f329f61 /console-client/vga-dynacolor.h | |
parent | b4cf10f408d50e4caaeda6d2bc9df2db3398a9cd (diff) | |
download | hurd-cc3e97aa0141410eb8b05cab34aecf65f44a164c.tar.gz hurd-cc3e97aa0141410eb8b05cab34aecf65f44a164c.tar.bz2 hurd-cc3e97aa0141410eb8b05cab34aecf65f44a164c.zip |
fix compiler warnings in hurd/console-client
console-client: Fix several compiler warnings.
* console-client/bdf.c: Use size_t instead of int.
* console-client/driver.c: Remove unused variable errstring.
* console-client/pc-kbd.c: Cast sc to scancode_x1 before comparing with enum
values.
* console-client/vga-dynacolor.h: Use an explicit if in reference counting.
* console-client/vga-dynafont.c: Use usigned char for bitmaps.
* console-client/vga-support.c: Use unsigned char instead of char.
* console-client/vga-support.h: Likewise.
* console-client/vga.c: Use conchar_attr_equal instead of casting structures to
integers.
* hurd/console.h: Add conchar_attr_equal to compare conchar_attr_t structures.
Diffstat (limited to 'console-client/vga-dynacolor.h')
-rw-r--r-- | console-client/vga-dynacolor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/console-client/vga-dynacolor.h b/console-client/vga-dynacolor.h index 304bcc1b..0526e0d8 100644 --- a/console-client/vga-dynacolor.h +++ b/console-client/vga-dynacolor.h @@ -77,11 +77,17 @@ signed char dynacolor_allocate (dynacolor_t *dc, unsigned char col); /* Add a reference to palette entry P in the dynamic font DC. */ #define dynacolor_add_ref(dc,p) \ - ((dc).ref[0] >= 0 && (dc).ref[p]++) + do { \ + if ((dc).ref[0] >= 0) \ + (dc).ref[p]++; \ + } while (0) /* Deallocate a reference for palette entry P in the dynamic font DC. */ #define dynacolor_release(dc,p) \ - ((dc).ref[0] >= 0 && (dc).ref[p]--) + do { \ + if ((dc).ref[0] >= 0) \ + (dc).ref[p]--; \ + } while (0) /* This is a convenience function that looks up a replacement color pair if the original colors are not available. The function always |