aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk.c24
-rw-r--r--mines.c14
-rw-r--r--net.c2
-rw-r--r--netslide.c2
-rw-r--r--twiddle.c12
5 files changed, 28 insertions, 26 deletions
diff --git a/gtk.c b/gtk.c
index deeb7a1..7a92d66 100644
--- a/gtk.c
+++ b/gtk.c
@@ -76,7 +76,7 @@ struct frontend {
config_item *cfg;
int cfg_which, cfgret;
GtkWidget *cfgbox;
- char *paste_data;
+ void *paste_data;
int paste_data_len;
char *laststatus;
};
@@ -566,7 +566,7 @@ void message_box(GtkWidget *parent, char *title, char *msg, int centre)
GTK_SIGNAL_FUNC(win_key_press), ok);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent));
- //set_transient_window_pos(parent, window);
+ /* set_transient_window_pos(parent, window); */
gtk_widget_show(window);
gtk_main();
}
@@ -798,7 +798,7 @@ static int get_config(frontend *fe, int which)
gtk_window_set_modal(GTK_WINDOW(fe->cfgbox), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(fe->cfgbox),
GTK_WINDOW(fe->window));
- //set_transient_window_pos(fe->window, fe->cfgbox);
+ /* set_transient_window_pos(fe->window, fe->cfgbox); */
gtk_widget_show(fe->cfgbox);
gtk_main();
@@ -836,6 +836,8 @@ int paste_initialised = FALSE;
void init_paste()
{
+ unsigned char empty[] = { 0 };
+
if (paste_initialised)
return;
@@ -849,21 +851,21 @@ void init_paste()
* ICCCM, we must do this before we start using cut buffers.
*/
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER0, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER0, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER1, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER1, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER2, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER2, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER3, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER3, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER4, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER4, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER5, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER5, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER6, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER6, XA_STRING, 8, PropModeAppend, empty, 0);
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- XA_CUT_BUFFER7, XA_STRING, 8, PropModeAppend, "", 0);
+ XA_CUT_BUFFER7, XA_STRING, 8, PropModeAppend, empty, 0);
}
/* Store data in a cut-buffer. */
diff --git a/mines.c b/mines.c
index 50ba8f0..cf35d7c 100644
--- a/mines.c
+++ b/mines.c
@@ -1291,7 +1291,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
*/
struct minectx {
- signed char *grid;
+ char *grid;
int w, h;
int sx, sy;
int allow_big_perturbs;
@@ -1786,7 +1786,7 @@ static char *minegen(int w, int h, int n, int x, int y, int unique,
* We bypass this bit if we're not after a unique grid.
*/
if (unique) {
- signed char *solvegrid = snewn(w*h, char);
+ signed char *solvegrid = snewn(w*h, signed char);
struct minectx actx, *ctx = &actx;
int solveret, prevret = -2;
@@ -1933,7 +1933,7 @@ static void obfuscate_bitmap(unsigned char *bmp, int bits, int decode)
static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
random_state *rs, char **game_desc)
{
- signed char *grid, *ret, *p;
+ char *grid, *ret, *p;
unsigned char *bmp;
int i, area;
@@ -2060,7 +2060,7 @@ static char *new_game_desc(game_params *params, random_state *rs,
/*
* For batch-generated grids, pre-open one square.
*/
- signed char *grid;
+ char *grid;
char *desc;
grid = new_mine_layout(params->w, params->h, params->n,
@@ -2262,7 +2262,7 @@ static game_state *new_game(midend_data *me, game_params *params, char *desc)
memset(state->layout, 0, sizeof(struct mine_layout));
state->layout->refcount = 1;
- state->grid = snewn(wh, char);
+ state->grid = snewn(wh, signed char);
memset(state->grid, -2, wh);
if (*desc == 'r') {
@@ -2355,7 +2355,7 @@ static game_state *dup_game(game_state *state)
ret->just_used_solve = state->just_used_solve;
ret->layout = state->layout;
ret->layout->refcount++;
- ret->grid = snewn(ret->w * ret->h, char);
+ ret->grid = snewn(ret->w * ret->h, signed char);
memcpy(ret->grid, state->grid, ret->w * ret->h);
return ret;
@@ -2689,7 +2689,7 @@ static game_drawstate *game_new_drawstate(game_state *state)
ds->w = state->w;
ds->h = state->h;
ds->started = FALSE;
- ds->grid = snewn(ds->w * ds->h, char);
+ ds->grid = snewn(ds->w * ds->h, signed char);
memset(ds->grid, -99, ds->w * ds->h);
diff --git a/net.c b/net.c
index 38a025c..33af6c6 100644
--- a/net.c
+++ b/net.c
@@ -120,7 +120,7 @@ static int xyd_cmp(const void *av, const void *bv) {
if (a->direction > b->direction)
return +1;
return 0;
-};
+}
static int xyd_cmp_nc(void *av, void *bv) { return xyd_cmp(av, bv); }
diff --git a/netslide.c b/netslide.c
index f6282eb..b0d975f 100644
--- a/netslide.c
+++ b/netslide.c
@@ -129,7 +129,7 @@ static int xyd_cmp(void *av, void *bv) {
if (a->direction > b->direction)
return +1;
return 0;
-};
+}
static struct xyd *new_xyd(int x, int y, int direction)
{
diff --git a/twiddle.c b/twiddle.c
index 7beedc4..9ac4a3a 100644
--- a/twiddle.c
+++ b/twiddle.c
@@ -260,12 +260,12 @@ static void do_rotate(int *grid, int w, int h, int n, int orientable,
for (j = 0; j < n/2; j++) {
int k;
int g[4];
- int p[4] = {
- j*w+i,
- i*w+(n-j-1),
- (n-j-1)*w+(n-i-1),
- (n-i-1)*w+j
- };
+ int p[4];
+
+ p[0] = j*w+i;
+ p[1] = i*w+(n-j-1);
+ p[2] = (n-j-1)*w+(n-i-1);
+ p[3] = (n-i-1)*w+j;
for (k = 0; k < 4; k++)
g[k] = grid[p[k]];