shithub: puzzles

Download patch

ref: 836a5c4ea742cc2ab23537993e8c54b251ae803b
parent: 8fb4cd031ae0bdcab133049c8683b41ac41d4000
author: Simon Tatham <anakin@pobox.com>
date: Tue Nov 13 16:40:49 EST 2018

Adopt C99 bool in misc.c functions.

The 'decode' flag to obfuscate_bitmap and the 'wrap' flag to
move_cursor are the only ones affected here.

--- a/misc.c
+++ b/misc.c
@@ -46,7 +46,7 @@
  * 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 @@
     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) {
--- a/puzzles.h
+++ b/puzzles.h
@@ -376,7 +376,7 @@
  */
 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 @@
 /* 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);