chiark
/
gitweb
/
~ian
/
sgt-puzzles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4bd99ec
)
Shamelessly pander to compilers whose data flow warning systems
author
Simon Tatham
<anakin@pobox.com>
Mon, 14 Apr 2008 11:32:06 +0000
(11:32 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Mon, 14 Apr 2008 11:32:06 +0000
(11:32 +0000)
insist that a variable should be initialised in all branches of an
if, instead of just all the non-assertion-failing ones.
[originally from svn r7989]
solo.c
patch
|
blob
|
history
diff --git
a/solo.c
b/solo.c
index 1879a988792d80438be1a4a95fe4e0690dac2cea..8ec0296fb34a773cbeb1feeb5ce1734ef38d47d2 100644
(file)
--- a/
solo.c
+++ b/
solo.c
@@
-2779,10
+2779,10
@@
static game_state *new_game(midend *me, game_params *params, char *desc)
if (*desc == '_')
c = 0;
- else if (*desc >= 'a' && *desc <= 'z')
+ else {
+ assert(*desc >= 'a' && *desc <= 'z');
c = *desc - 'a' + 1;
- else
- assert(!"Shouldn't get here");
+ }
desc++;
adv = (c != 25); /* 'z' is a special case */