Skip to content

Commit

Permalink
Remove a few misleading-indentation warnings
Browse files Browse the repository at this point in the history
Remove a few GCC (tested on 13.2.0) warnings from code
  • Loading branch information
fedepell committed Dec 1, 2024
1 parent be12a1f commit 005f54d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/compiler/codegen_c_builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ int fb_gen_common_c_builder_header(fb_output_t *out)
" _uvref.type = flatcc_builder_refmap_find(B, vec.type); _uvref.value = flatcc_builder_refmap_find(B, vec.value);\\\n"
" _len = N ## _union_vec_len(vec); if (_uvref.type == 0) {\\\n"
" _uvref.type = flatcc_builder_refmap_insert(B, vec.type, (flatcc_builder_create_type_vector(B, vec.type, _len))); }\\\n"
" if (_uvref.type == 0) return _ret; if (_uvref.value == 0) {\\\n"
" if (_uvref.type == 0) { return _ret; } if (_uvref.value == 0) {\\\n"
" if (flatcc_builder_start_offset_vector(B)) return _ret;\\\n"
" for (_i = 0; _i < _len; ++_i) { _uref = N ## _clone(B, N ## _union_vec_at(vec, _i));\\\n"
" if (!_uref.value || !(flatcc_builder_offset_vector_push(B, _uref.value))) return _ret; }\\\n"
Expand Down Expand Up @@ -416,11 +416,11 @@ int fb_gen_common_c_builder_header(fb_output_t *out)
"static inline T *N ## _array_copy(T *p, const T *p2, size_t n)\\\n"
"{ memcpy(p, p2, n * sizeof(T)); return p; }\\\n"
"static inline T *N ## _array_copy_from_pe(T *p, const T *p2, size_t n)\\\n"
"{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\\\n"
" for (i = 0; i < n; ++i) N ## _copy_from_pe(&p[i], &p2[i]); return p; }\\\n"
"{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else {\\\n"
" for (i = 0; i < n; ++i) N ## _copy_from_pe(&p[i], &p2[i]); } return p; }\\\n"
"static inline T *N ## _array_copy_to_pe(T *p, const T *p2, size_t n)\\\n"
"{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\\\n"
" for (i = 0; i < n; ++i) N ## _copy_to_pe(&p[i], &p2[i]); return p; }\n",
"{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else {\\\n"
" for (i = 0; i < n; ++i) N ## _copy_to_pe(&p[i], &p2[i]); } return p; }\n",
nsc);
fprintf(out->fp,
"#define __%sdefine_scalar_primitives(NS, N, T)\\\n"
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/codegen_c_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static void gen_union(fb_output_t *out)
"__## NS ## field_present(ID, t__tmp)\\\n"
"static inline T ## _union_t N ## _ ## NK ## _union(N ## _table_t t__tmp)\\\n"
"{ T ## _union_t u__tmp = { 0, 0 }; u__tmp.type = N ## _ ## NK ## _type_get(t__tmp);\\\n"
" if (u__tmp.type == 0) return u__tmp; u__tmp.value = N ## _ ## NK ## _get(t__tmp); return u__tmp; }\\\n"
" if (u__tmp.type == 0) { return u__tmp; } u__tmp.value = N ## _ ## NK ## _get(t__tmp); return u__tmp; }\\\n"
"static inline NS ## string_t N ## _ ## NK ## _as_string(N ## _table_t t__tmp)\\\n"
"{ return NS ## string_cast_from_generic(N ## _ ## NK ## _get(t__tmp)); }\\\n"
"\n");
Expand Down

0 comments on commit 005f54d

Please sign in to comment.