Skip to content

Commit 7cc4443

Browse files
committed
fix clang complier warnings
1 parent adffc28 commit 7cc4443

File tree

7 files changed

+8
-17
lines changed

7 files changed

+8
-17
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project( 'nip4', 'c',
44
license: 'GPL',
55
meson_version: '>=0.64',
66
default_options: [
7-
'c_std=c11',
7+
'c_std=c2x',
88
# turn off asserts etc. in release mode
99
'b_ndebug=if-release'
1010
]

src/dump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,16 +624,16 @@ print_element(int nsp, EType type, void *arg)
624624
break;
625625

626626
case ELEMENT_BINOP:
627-
printf("binop \"%s\"", decode_BinOp((BinOp) arg));
627+
printf("binop \"%s\"", decode_BinOp((BinOp) GPOINTER_TO_INT(arg)));
628628
break;
629629

630630
case ELEMENT_UNOP:
631-
printf("unop \"%s\"", decode_UnOp((UnOp) arg));
631+
printf("unop \"%s\"", decode_UnOp((UnOp) GPOINTER_TO_INT(arg)));
632632
break;
633633

634634
case ELEMENT_COMB:
635635
printf("combinator \"%s\"",
636-
decode_CombinatorType((CombinatorType) arg));
636+
decode_CombinatorType((CombinatorType) GPOINTER_TO_INT(arg)));
637637
break;
638638

639639
case ELEMENT_TAG:

src/heap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ typedef struct pelement {
302302
#define PEGETSYMBOL(P) ((Symbol *) PEGETVAL(P))
303303
#define PEGETSYMREF(P) ((Symbol *) PEGETVAL(P))
304304
#define PEGETCOMPILE(P) ((Compile *) (PEGETVAL(P)))
305-
#define PEGETBINOP(P) ((BinOp) PEGETVAL(P))
306-
#define PEGETUNOP(P) ((UnOp) PEGETVAL(P))
307-
#define PEGETCOMB(P) ((CombinatorType) PEGETVAL(P))
305+
#define PEGETBINOP(P) ((BinOp) GPOINTER_TO_INT(PEGETVAL(P)))
306+
#define PEGETUNOP(P) ((UnOp) GPOINTER_TO_INT(PEGETVAL(P)))
307+
#define PEGETCOMB(P) ((CombinatorType) GPOINTER_TO_INT(PEGETVAL(P)))
308308
#define PEGETTAG(P) ((char *) PEGETVAL(P))
309309
#define PEGETREAL(P) (PEGETVAL(P)->body.num)
310310
#define PEGETBOOL(P) ((gboolean) GPOINTER_TO_UINT(PEGETVAL(P)))

src/infobar.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ infobar_update_pixel(Infobar *infobar,
233233
Tilesource *tilesource, double image_x, double image_y)
234234
{
235235
if (!infobar->updating) {
236-
Imagewindow *win = infobar->win;
237236
PixelUpdate *update = g_new0(PixelUpdate, 1);
238237

239238
update->infobar = infobar;

src/kplot/extern.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ struct kplotctx {
122122
struct kpair dims;
123123
};
124124

125-
__BEGIN_DECLS
126-
127125
int kdata_dep_add(struct kdata *, struct kdata *, ksetfunc);
128126
int kdata_dep_run(struct kdata *, size_t);
129127
int kdata_set(struct kdata *, size_t, double, double);
@@ -153,6 +151,4 @@ int kplot_cairo_to_data(struct kplotctx *ctx,
153151
double cairo_x, double cairo_y,
154152
double *data_x, double *data_y);
155153

156-
__END_DECLS
157-
158154
#endif

src/kplot/kplot.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ struct kplotcfg {
187187
struct kdata;
188188
struct kplot;
189189

190-
__BEGIN_DECLS
191-
192190
void kdata_destroy(struct kdata *);
193191
int kdata_get(const struct kdata *, size_t, struct kpair *);
194192

@@ -258,6 +256,4 @@ struct kplotcfg *kplot_get_plotcfg(struct kplot *);
258256

259257
#include "extern.h"
260258

261-
__END_DECLS
262-
263259
#endif

src/workspaceview.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ workspaceview_drag_update(GtkEventControllerMotion *self,
10821082
break;
10831083

10841084
case WVIEW_SELECT:
1085-
if (abs(offset_x) > 5 || abs(offset_x) > 5) {
1085+
if (fabs(offset_x) > 5 || fabs(offset_x) > 5) {
10861086
wview->state = WVIEW_DRAG;
10871087

10881088
if (wview->drag_cview)

0 commit comments

Comments
 (0)