From 11dae5126bb5c4523ca9b04f80564b80d16948d3 Mon Sep 17 00:00:00 2001 From: Carsten Hartenfels Date: Sat, 23 Nov 2019 21:14:33 -0500 Subject: [PATCH] Add braces around matrix struct intializers They're missing and trigger warnings in the tests. --- include/cglm/struct/mat3.h | 12 ++++++------ include/cglm/struct/mat4.h | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/cglm/struct/mat3.h b/include/cglm/struct/mat3.h index da53989..c5c6a2a 100644 --- a/include/cglm/struct/mat3.h +++ b/include/cglm/struct/mat3.h @@ -38,12 +38,12 @@ #include "../mat3.h" #include "vec3.h" -#define GLMS_MAT3_IDENTITY_INIT {1.0f, 0.0f, 0.0f, \ - 0.0f, 1.0f, 0.0f, \ - 0.0f, 0.0f, 1.0f} -#define GLMS_MAT3_ZERO_INIT {0.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f} +#define GLMS_MAT3_IDENTITY_INIT {{1.0f, 0.0f, 0.0f, \ + 0.0f, 1.0f, 0.0f, \ + 0.0f, 0.0f, 1.0f}} +#define GLMS_MAT3_ZERO_INIT {{0.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f}} /* for C only */ #define GLMS_MAT3_IDENTITY ((mat3s)GLMS_MAT3_IDENTITY_INIT) diff --git a/include/cglm/struct/mat4.h b/include/cglm/struct/mat4.h index 14fa614..d27d4ec 100644 --- a/include/cglm/struct/mat4.h +++ b/include/cglm/struct/mat4.h @@ -53,15 +53,15 @@ #include "vec4.h" #include "vec3.h" -#define GLMS_MAT4_IDENTITY_INIT {1.0f, 0.0f, 0.0f, 0.0f, \ - 0.0f, 1.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 1.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f, 1.0f} +#define GLMS_MAT4_IDENTITY_INIT {{1.0f, 0.0f, 0.0f, 0.0f, \ + 0.0f, 1.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 1.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f, 1.0f}} -#define GLMS_MAT4_ZERO_INIT {0.0f, 0.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f, 0.0f, \ - 0.0f, 0.0f, 0.0f, 0.0f} +#define GLMS_MAT4_ZERO_INIT {{0.0f, 0.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f, 0.0f, \ + 0.0f, 0.0f, 0.0f, 0.0f}} /* for C only */ #define GLMS_MAT4_IDENTITY ((mat4s)GLMS_MAT4_IDENTITY_INIT)