shithub: puzzles

Download patch

ref: a1663d6650053eee5e43a1267a05578a920521da
parent: 441b11b310a17dbf7751f4c77fe69ca729b0fffb
author: Simon Tatham <[email protected]>
date: Wed Apr 25 15:24:06 EDT 2018

C89 build fixes.

Recent changes introduced a couple of non-C89-compatible mixed
declarations and code.

--- a/filling.c
+++ b/filling.c
@@ -1289,10 +1289,10 @@
 
 static key_label *game_request_keys(const game_params *params, int *nkeys)
 {
+    int i;
     key_label *keys = snewn(11, key_label);
-    *nkeys = 11;
 
-    int i;
+    *nkeys = 11;
 
     for(i = 0; i < 10; ++i)
     {
--- a/unequal.c
+++ b/unequal.c
@@ -1282,12 +1282,12 @@
 
 static key_label *game_request_keys(const game_params *params, int *nkeys)
 {
+    int i;
     int order = params->order;
     char off = (order > 9) ? '0' : '1';
     key_label *keys = snewn(order + 1, key_label);
     *nkeys = order + 1;
 
-    int i;
     for(i = 0; i < order; i++) {
         if (i==10) off = 'a'-10;
         keys[i].button = i + off;