solstice-pp

Post-processing utilities for the solstice app
git clone git://git.meso-star.com/solstice-pp.git
Log | Files | Refs | README | LICENSE

commit 21b13fc030bcbdc3907412d36590d3f91d514a6e
parent cf7c2fd972605783221c1ad6f71525dfb8b9fd33
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 20 Jun 2025 13:21:38 +0200

Fix GCC warnings

Diffstat:
Msolpp.h | 17+++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/solpp.h b/solpp.h @@ -33,8 +33,12 @@ struct mc { double E/* Expected value */, SE/* Standard Error */; }; #define FOR_EACH(Id, Start, End) for((Id)=(Start); (Id)<(End); ++(Id)) -#define CHK(Cond) if(!(Cond)) \ - {fprintf(stderr, "error:%s:%d\n", __FILE__, __LINE__); abort();} (void)0 +#define CHK(Cond) { \ + if(!(Cond)) { \ + fprintf(stderr, "error:%s:%d\n", __FILE__, __LINE__); \ + abort(); \ + } \ + } (void)0 /******************************************************************************* * Dynamic buffer @@ -42,10 +46,11 @@ struct mc { double E/* Expected value */, SE/* Standard Error */; }; #define BUF(Type) struct { Type* mem; size_t ca; size_t sz; } #define BUF_NULL {NULL, 0, 0} #define BUF_RELEASE(B) free((B).mem) -#define BUF_RESERVE(B, Sz) \ - if((Sz)>(B).ca) { \ - CHK((B).mem = realloc((B).mem, sizeof(*(B).mem)*((B).ca=(Sz)))); \ - } (void)0 +#define BUF_RESERVE(B, Sz) { \ + if((Sz)>(B).ca) { \ + CHK((B).mem = realloc((B).mem, sizeof(*(B).mem)*((B).ca=(Sz)))); \ + } \ + }(void)0 #define BUF_RESIZE(B, Sz) {BUF_RESERVE((B), Sz); (B).sz = Sz;} (void)0 #define BUF_PUSH(B, E) { \ if((B).sz >= (B).ca) BUF_RESERVE((B), ((B).ca?(B).ca*2:32)); \