From 158aa26d3daf0ee5121e75c9150ae1849e5dc09e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 6 Apr 2021 14:17:37 +0200 Subject: [PATCH] :art: Add -Wno-pedantic --- Makefile | 3 +++ src/lib/prim.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8385c170..7c6a5047 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ GWLIBS := lib${PRG}.a libcmdapp/libcmdapp.a ast/libgwion_ast.a GWLIBS += util/libgwion_util.a ast/libprettyerr/libprettyerr.a util/libtermcolor/libtermcolor.a _LDFLAGS = ${GWLIBS} ${LDFLAGS} +# we are not pedantic +CFLAGS += -Wno-pedantic + all: options-show ${_GWLIBS} src/main.o @$(info link ${PRG}) @${CC} src/main.o -o ${PRG} ${_LDFLAGS} ${LIBS} diff --git a/src/lib/prim.c b/src/lib/prim.c index 2b8410cc..37087684 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -387,6 +387,10 @@ static GWION_IMPORT(dur) { GWI_BB(gwi_oper_ini(gwi, "dur", "float", "dur")) GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) + GWI_BB(gwi_oper_ini(gwi, "float", "dur", "dur")) + CHECK_FF("*=>", rassign, r_mul) + CHECK_FF("/=>", rassign, r_div) + GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "int")) GWI_BB(gwi_oper_end(gwi, ">", float_gt)) GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) @@ -419,6 +423,9 @@ static GWION_IMPORT(time) { GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) GWI_BB(gwi_oper_ini(gwi, "time", "time", "dur")) GWI_BB(gwi_oper_end(gwi, "-", FloatMinus)) + GWI_BB(gwi_oper_ini(gwi, "float", "time", "time")) + CHECK_FF("*=>", rassign, r_mul) + CHECK_FF("/=>", rassign, r_div) GWI_BB(gwi_oper_ini(gwi, "dur", "time", "time")) CHECK_FF("=>", rassign, r_assign) GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) @@ -431,7 +438,6 @@ static GWION_IMPORT(time) { return gwi_oper_end(gwi, "<=", float_le); } - #define BINARY_FLOAT_FOLD(name, TYPE, OP, pre, post) \ BINARY_FOLD(float, name, TYPE, OP, pre, post, is_prim_float, is_prim_float, m_float, ae_prim_float, fnum, fnum, fnum) -- 2.43.0