chiark / gitweb /
Adopt C99 bool in misc.c functions.
authorSimon Tatham <anakin@pobox.com>
Tue, 13 Nov 2018 21:40:49 +0000 (21:40 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 13 Nov 2018 21:48:24 +0000 (21:48 +0000)
The 'decode' flag to obfuscate_bitmap and the 'wrap' flag to
move_cursor are the only ones affected here.

misc.c
puzzles.h

diff --git a/misc.c b/misc.c
index 73faf3ace7a96fcde2b3fca0707501b42b507a77..992f1a5e2650564c5eee8d7d442a932e4e054c26 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -46,7 +46,7 @@ void free_keys(key_label *keys, int nkeys)
  * keyless, reversible, but visually completely obfuscatory masking
  * function to the mine bitmap.
  */
-void obfuscate_bitmap(unsigned char *bmp, int bits, int decode)
+void obfuscate_bitmap(unsigned char *bmp, int bits, bool decode)
 {
     int bytes, firsthalf, secondhalf;
     struct step {
@@ -288,7 +288,7 @@ void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col)
     draw_line(dr, cx + r, cy + r, cx + r/2, cy + r, col);
 }
 
-void move_cursor(int button, int *x, int *y, int maxw, int maxh, int wrap)
+void move_cursor(int button, int *x, int *y, int maxw, int maxh, bool wrap)
 {
     int dx = 0, dy = 0;
     switch (button) {
index 887af7b19e09004bab41b2fcfc46ac3ed5b681c8..5d40e80626bbc1b5c285a68c00e4186456d0352e 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -376,7 +376,7 @@ char *dupstr(const char *s);
  */
 void free_cfg(config_item *cfg);
 void free_keys(key_label *keys, int nkeys);
-void obfuscate_bitmap(unsigned char *bmp, int bits, int decode);
+void obfuscate_bitmap(unsigned char *bmp, int bits, bool decode);
 char *fgetline(FILE *fp);
 
 /* allocates output each time. len is always in bytes of binary data.
@@ -403,7 +403,7 @@ void draw_rect_outline(drawing *dr, int x, int y, int w, int h,
 /* Draw a set of rectangle corners (e.g. for a cursor display). */
 void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col);
 
-void move_cursor(int button, int *x, int *y, int maxw, int maxh, int wrap);
+void move_cursor(int button, int *x, int *y, int maxw, int maxh, bool wrap);
 
 /* Used in netslide.c and sixteen.c for cursor movement around edge. */
 int c2pos(int w, int h, int cx, int cy);