Fix warnings in release

This commit is contained in:
jun 2025-03-19 18:29:52 +01:00
parent 7e1bbc769e
commit 48b366d8e9
3 changed files with 13 additions and 11 deletions

View File

@ -585,8 +585,8 @@ GUF_STR_KWRDS guf_str *guf_str_try_append_char(guf_str *str, char c, ptrdiff_t t
}
}
const size_t new_cap = guf_str_cap_internal_(str);
GUF_ASSERT_RELEASE(new_cap >= new_len && new_cap >= old_cap);
GUF_ASSERT(guf_str_len_internal_(str) == old_len);
GUF_ASSERT(new_cap >= new_len && new_cap >= old_cap);
GUF_ASSERT(((ptrdiff_t)new_cap - (ptrdiff_t)old_len) >= times);
char *c_str = guf_str_get_cstr_internal_(str);
@ -649,7 +649,7 @@ GUF_STR_KWRDS guf_str *guf_str_try_append(guf_str *str, guf_str_view sv, guf_err
}
const size_t new_cap = guf_str_cap_internal_(str);
GUF_ASSERT(new_cap >= old_cap && new_cap >= new_len);
GUF_ASSERT_RELEASE(new_cap >= old_cap && new_cap >= new_len);
GUF_ASSERT(((ptrdiff_t)new_cap - (ptrdiff_t)old_len) >= sv.len);
char *c_str_dst = guf_str_get_cstr_internal_(str);
@ -804,7 +804,8 @@ GUF_STR_KWRDS guf_str_view guf_str_view_trim_left_ascii(guf_str_view sv)
return sv;
}
for (; sv.len > 0 && guf_char_isspace_ascii(*sv.str); --sv.len, ++sv.str);
for (; sv.len > 0 && guf_char_isspace_ascii(*sv.str); --sv.len, ++sv.str)
;
GUF_ASSERT(sv.len >= 0);
GUF_ASSERT(sv.len == 0 || !guf_char_isspace_ascii(*sv.str));
@ -818,7 +819,8 @@ GUF_STR_KWRDS guf_str_view guf_str_view_trim_right_ascii(guf_str_view sv)
return sv;
}
for (; sv.len > 0 && guf_char_isspace_ascii(sv.str[sv.len - 1]); --sv.len);
for (; sv.len > 0 && guf_char_isspace_ascii(sv.str[sv.len - 1]); --sv.len)
;
GUF_ASSERT(sv.len >= 0);
GUF_ASSERT(sv.len == 0 || !guf_char_isspace_ascii(sv.str[sv.len - 1]));

View File

@ -241,13 +241,13 @@ int main(void)
guf_quaternion rotq = guf_quaternion_from_axis_angle(angle, guf_vec3_normalised((guf_vec3){-2324234.3f, 1.4f, -1.3f}));
guf_mat4x4 rotmat, rotmat_inv;
guf_mat4x4_init_from_quaternion(&rotmat, rotq);
GUF_ASSERT(guf_mat4x4_inverted(&rotmat, &rotmat_inv))
GUF_ASSERT_RELEASE(guf_mat4x4_inverted(&rotmat, &rotmat_inv))
guf_mat4x4_set_trans(&rotmat, (guf_vec3){42.1234f, -512.2f, 3.1415926f});
GUF_ASSERT(guf_mat4x4_inverted(&rotmat, &rotmat_inv));
GUF_ASSERT_RELEASE(guf_mat4x4_inverted(&rotmat, &rotmat_inv));
GUF_ASSERT(guf_mat4x4_inverted(&rotmat_inv, &rotmat));
GUF_ASSERT(guf_mat4x4_inverted(&rotmat, &rotmat_inv));
GUF_ASSERT_RELEASE(guf_mat4x4_inverted(&rotmat_inv, &rotmat));
GUF_ASSERT_RELEASE(guf_mat4x4_inverted(&rotmat, &rotmat_inv));
}
guf_quaternion q = guf_quaternion_from_axis_angle(GUF_PI_F32 / 8.f, guf_vec3_normalised((guf_vec3){0.3f, 10.2f, -25.f}));
@ -270,8 +270,8 @@ int main(void)
} else {
printf("Inverse:\n");
guf_mat4x4_print_with_precision(&mat_inv, stdout, 8);
GUF_ASSERT(guf_mat4x4_inverted(&mat_inv, &mat));
GUF_ASSERT(guf_mat4x4_nearly_equal(&mat, &mat_cpy, 1e-4f, 1e-5f));
GUF_ASSERT_RELEASE(guf_mat4x4_inverted(&mat_inv, &mat));
GUF_ASSERT_RELEASE(guf_mat4x4_nearly_equal(&mat, &mat_cpy, 1e-4f, 1e-5f));
}
mat = (guf_mat4x4) {.data = {

View File

@ -1,6 +1,6 @@
- sort: add cpp #ifdef to remove restrict from declaration
- tests for guf_dict with GUF_DICT_64_BIT_IDX (and also hash32/hash64)
- tests for guf_dict with GUF_DICT_64_BIT_IDX (and also hash32/hash64); maybe pass kv_type to insert to avoid copy
- guf_stack, guf_queue, guf_dqueue, guf_prio_queue (using a heap), guf_ringbuf