X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fcalc.c;h=0e21ec59bf041e15b343a865beb7421c04da4dcc;hb=5e240548ba570610ce0dbc248a2b7654a0e080fa;hp=806685e8dd814029dc88f423d4a95d6af56a5803;hpb=2f5af21b263403997e154658635d6b6e6eaab453;p=m6w6%2Fext-psi diff --git a/src/calc.c b/src/calc.c index 806685e..0e21ec5 100644 --- a/src/calc.c +++ b/src/calc.c @@ -99,12 +99,12 @@ int psi_calc_num_exp(num_exp *exp, impl_val *strct, impl_val *res) { #define PSI_CALC_OP(var) do { \ const char *fmt = "calc %" PRI##var ", %" PRI##var ": %" PRI##var "\n"; \ res->var = PSI_CALC(v1->var, v2->var); \ - if (!res->var) fprintf(stderr, fmt, v1->var, v2->var, res->var); \ + if (!res->var && (v1->var || v2->var)) fprintf(stderr, fmt, v1->var, v2->var, res->var); \ } while (0) #define PSI_CALC_OP2(vres, var1, var2) do { \ const char *fmt = "calc %" PRI##var1 ", %" PRI##var2 ": %" PRI##vres "\n"; \ res->vres = PSI_CALC(v1->var1, v2->var2); \ - if (!res->vres) fprintf(stderr, fmt, v1->var1, v2->var2, res->vres); \ + if (!res->vres && (v1->var1 || v2->var2)) fprintf(stderr, fmt, v1->var1, v2->var2, res->vres); \ } while(0) #ifdef HAVE_LONG_DOUBLE