aboutsummaryrefslogtreecommitdiff
path: root/loopy.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2008-09-13 18:25:19 +0000
committerSimon Tatham <anakin@pobox.com>2008-09-13 18:25:19 +0000
commitfe1b91ac49cc2f4cd07801535dc19103a8ebeb70 (patch)
treee89b7747911378cf8387c58f50e50648a4e58469 /loopy.c
parentacf5c55d355b49fec8fb5376737d606be0cd8d4f (diff)
downloadpuzzles-fe1b91ac49cc2f4cd07801535dc19103a8ebeb70.zip
puzzles-fe1b91ac49cc2f4cd07801535dc19103a8ebeb70.tar.gz
puzzles-fe1b91ac49cc2f4cd07801535dc19103a8ebeb70.tar.bz2
puzzles-fe1b91ac49cc2f4cd07801535dc19103a8ebeb70.tar.xz
Since the lack of this has caused portability issues in the past:
add "-ansi -pedantic" to the main Unix makefile, and clean up a few minor problems pointed out thereby. [originally from svn r8175]
Diffstat (limited to 'loopy.c')
-rw-r--r--loopy.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/loopy.c b/loopy.c
index b54922a..f5a237b 100644
--- a/loopy.c
+++ b/loopy.c
@@ -179,7 +179,7 @@ enum { DIFFLIST(ENUM) DIFF_MAX };
static char const *const diffnames[] = { DIFFLIST(TITLE) };
static char const diffchars[] = DIFFLIST(ENCODE);
#define DIFFCONFIG DIFFLIST(CONFIG)
-DIFFLIST(SOLVER_FN_DECL);
+DIFFLIST(SOLVER_FN_DECL)
static int (*(solver_fns[]))(solver_state *) = { DIFFLIST(SOLVER_FN) };
struct game_params {
@@ -3070,7 +3070,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
* bounding-box around the line, then flag all nearby objects for redraw.
*/
if (ds->started) {
- const char redraw_flag = 1<<7;
+ const char redraw_flag = (char)(1<<7);
for (i = 0; i < g->num_edges; i++) {
/* If we're changing state, AND
* the previous state was a coloured line */
@@ -3199,12 +3199,15 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
* direction to create a thin rectangle. */
int dx = (x1 > x2) ? -1 : ((x1 < x2) ? 1 : 0);
int dy = (y1 > y2) ? -1 : ((y1 < y2) ? 1 : 0);
- int points[] = {
- x1 + dy, y1 - dx,
- x1 - dy, y1 + dx,
- x2 - dy, y2 + dx,
- x2 + dy, y2 - dx
- };
+ int points[8];
+ points[0] = x1 + dy;
+ points[1] = y1 - dx;
+ points[2] = x1 - dy;
+ points[3] = y1 + dx;
+ points[4] = x2 - dy;
+ points[5] = y2 + dx;
+ points[6] = x2 + dy;
+ points[7] = y2 - dx;
draw_polygon(dr, points, 4, line_colour, line_colour);
}
if (ds->started) {