shut up some anal-retentive warnings

This commit is contained in:
Andrei Alexeyev 2020-03-07 18:47:02 +02:00
parent d6b2177786
commit a8bf8012f6
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
3 changed files with 6 additions and 4 deletions

View file

@ -90,6 +90,7 @@ taisei_c_args = [
'-Winit-self',
'-Wlogical-op',
'-Wmissing-prototypes',
'-Wno-gnu-folding-constant',
'-Wno-long-long',
'-Wno-missing-braces',
'-Wno-typedef-redefinition',

View file

@ -227,11 +227,12 @@ static void dialog_actor_update_composite(DialogActor *a) {
size_t name_len = strlen(a->name);
size_t face_len = strlen(a->face);
size_t variant_len;
bool have_variant = a->variant;
size_t lenfull_base = sizeof("dialog/") + name_len - 1;
size_t lenfull_face = lenfull_base + sizeof("_face_") + face_len - 1;
if(a->variant) {
if(have_variant) {
variant_len = strlen(a->variant);
lenfull_base += sizeof("_variant_") + variant_len - 1;
}
@ -241,7 +242,7 @@ static void dialog_actor_update_composite(DialogActor *a) {
dst = memcpy(dst, "dialog/", sizeof("dialog/") - 1);
dst = memcpy(dst + sizeof("dialog/") - 1, a->name, name_len + 1);
if(a->variant) {
if(have_variant) {
char *tmp = dst;
dst = memcpy(dst + name_len, "_variant_", sizeof("_variant_") - 1);
dst = memcpy(dst + sizeof("_variant_") - 1, a->variant, variant_len + 1);

View file

@ -932,8 +932,8 @@ void glcommon_load_functions(void) {
}
}
glad_glDrawArraysInstancedBaseInstanceANGLE = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEANGLEPROC)SDL_GL_GetProcAddress("glDrawArraysInstancedBaseInstanceANGLE");
glad_glDrawElementsInstancedBaseVertexBaseInstanceANGLE = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLEPROC)SDL_GL_GetProcAddress("glDrawElementsInstancedBaseVertexBaseInstanceANGLE");
glad_glDrawArraysInstancedBaseInstanceANGLE = *(PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEANGLEPROC*)(void**)SDL_GL_GetProcAddress("glDrawArraysInstancedBaseInstanceANGLE");
glad_glDrawElementsInstancedBaseVertexBaseInstanceANGLE = *(PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLEPROC*)(void**)SDL_GL_GetProcAddress("glDrawElementsInstancedBaseVertexBaseInstanceANGLE");
#endif
}