commit 49ba84b9cffc87b4ca2fc99d48601be133c0f558
parent 83bebebf379519979f99f6f55f754c224885971d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Tue, 23 Jun 2026 15:59:47 +0200
Fix warnings
Diffstat:
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/solpp.c b/solpp.c
@@ -246,8 +246,8 @@ main(int argc, char** argv)
if(!prim && !rcv) msh_misc.voffset += nverts_grp;
prim = find_primary(&simul, line+2);
rcv = find_receiver(&simul, line+2);
- if(prim) BUF_PUSH(msh_prim.entities, prim->id);
- if(rcv) BUF_PUSH(msh_rcv.entities, rcv->id);
+ if(prim) { BUF_PUSH(msh_prim.entities, prim->id); }
+ if(rcv) { BUF_PUSH(msh_rcv.entities, rcv->id); }
ntris_grp = 0;
nverts_grp = 0;
off_grp = 0;
@@ -298,8 +298,8 @@ main(int argc, char** argv)
off_grp = nverts_grp;
}
}
- if(prim) BUF_PUSH(msh_prim.ncells, ntris_grp);
- if(rcv) BUF_PUSH(msh_rcv.ncells, ntris_grp);
+ if(prim) { BUF_PUSH(msh_prim.ncells, ntris_grp); }
+ if(rcv) { BUF_PUSH(msh_rcv.ncells, ntris_grp); }
CHK(snprintf(filename, sizeof(filename),
"%sprimaries.vtk", prefix) < sizeof(prefix));
diff --git a/solpp.h b/solpp.h
@@ -53,7 +53,7 @@ struct mc { double E/* Expected value */, SE/* Standard Error */; };
}(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)); \
+ if((B).sz >= (B).ca) {BUF_RESERVE((B), ((B).ca?(B).ca*2:32));} \
(B).mem[(B).sz++]=(E); \
} (void)0
#define BUF_SZ(B) (B).sz
@@ -70,7 +70,7 @@ read_line(buf_char_T* b, FILE* stream)
{
char* c;
- if(!BUF_SZ(*b)) BUF_RESIZE(*b, 32);
+ if(!BUF_SZ(*b)) { BUF_RESIZE(*b, 32); }
if(!fgets(BUF_MEM(*b), (int)BUF_SZ(*b), stream)) return NULL;
/* Ensure that the whole line is read */
@@ -244,11 +244,11 @@ read_receiver_map_side_data(struct rcv* rcv, const size_t n, FILE* input)
CHK(line = read_line(&buf, input));
str = line + 8;
- if(!strncmp(str, "Front_faces", 11)) { side = FRONT; str += 12; }
+ if(!strncmp(str, "Front_faces", 11)) { side = FRONT; str += 12; }
else if(!strncmp(str, "Back_faces", 10)) { side = BACK; str += 11; }
else { fprintf(stderr, "Unexpected side name\n"); abort(); }
- if(!strncmp(str, "Incoming_flux", 13)) { flux = INCOMING; }
+ if(!strncmp(str, "Incoming_flux", 13)) { flux = INCOMING; }
else if(!strncmp(str, "Absorbed_flux", 13)) { flux = ABSORBED; }
else { fprintf(stderr, "Unexpected flux name\n"); abort(); }
@@ -282,11 +282,11 @@ read_receiver_map(struct simul* simul, FILE* input)
/* Skip vertices */
CHK(line = read_line(&buf, input));
CHK(sscanf(line, "POINTS %zu float", &n) == 1);
- FOR_EACH(i, 0, n) CHK(read_line(&buf, input));
+ FOR_EACH(i, 0, n) { CHK(read_line(&buf, input)); }
/* Skip polygons */
CHK(line = read_line(&buf, input));
CHK(sscanf(line, "POLYGONS %zu %*u", &n) == 1);
- FOR_EACH(i, 0, n) CHK(read_line(&buf, input));
+ FOR_EACH(i, 0, n) { CHK(read_line(&buf, input)); }
/* Read the map data of one side */
CHK(line = read_line(&buf, input));
CHK(sscanf(line, "CELL_DATA %zu", &n) == 1);