mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Build fix: take declarations out of for loops.
The NestedVM build is still unhappy with this C99ism, unfortunately.
This commit is contained in:
6
midend.c
6
midend.c
@ -386,10 +386,11 @@ game_params *midend_get_params(midend *me)
|
|||||||
static char *encode_params(midend *me, const game_params *params, bool full)
|
static char *encode_params(midend *me, const game_params *params, bool full)
|
||||||
{
|
{
|
||||||
char *encoded = me->ourgame->encode_params(params, full);
|
char *encoded = me->ourgame->encode_params(params, full);
|
||||||
|
int i;
|
||||||
|
|
||||||
/* Assert that the params consist of printable ASCII containing
|
/* Assert that the params consist of printable ASCII containing
|
||||||
* neither '#' nor ':'. */
|
* neither '#' nor ':'. */
|
||||||
for (int i = 0; encoded[i]; i++)
|
for (i = 0; encoded[i]; i++)
|
||||||
assert(encoded[i] >= 32 && encoded[i] < 127 &&
|
assert(encoded[i] >= 32 && encoded[i] < 127 &&
|
||||||
encoded[i] != '#' && encoded[i] != ':');
|
encoded[i] != '#' && encoded[i] != ':');
|
||||||
return encoded;
|
return encoded;
|
||||||
@ -399,7 +400,8 @@ static void assert_printable_ascii(char const *s)
|
|||||||
{
|
{
|
||||||
/* Assert that s is entirely printable ASCII, and hence safe for
|
/* Assert that s is entirely printable ASCII, and hence safe for
|
||||||
* writing in a save file. */
|
* writing in a save file. */
|
||||||
for (int i = 0; s[i]; i++)
|
int i;
|
||||||
|
for (i = 0; s[i]; i++)
|
||||||
assert(s[i] >= 32 && s[i] < 127);
|
assert(s[i] >= 32 && s[i] < 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user