Fix warnings;

This commit is contained in:
bjorn 2019-05-12 14:40:01 -07:00
parent 9a1579a773
commit 5b0fa8b522
2 changed files with 10 additions and 5 deletions

View File

@ -290,7 +290,9 @@ static int l_lovrGraphicsPresent(lua_State* L) {
}
static int l_lovrGraphicsCreateWindow(lua_State* L) {
WindowFlags flags = { 0 };
WindowFlags flags;
memset(&flags, 0, sizeof(flags));
luaL_checktype(L, 1, LUA_TTABLE);
lua_getfield(L, 1, "width");

View File

@ -193,7 +193,9 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
jsmntok_t* scenes;
jsmntok_t* skins;
int sceneCount;
} info = { 0 };
} info;
memset(&info, 0, sizeof(info));
gltfAnimationSampler* animationSamplers = NULL;
gltfMesh* meshes = NULL;
@ -411,7 +413,8 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
jsmntok_t* token = info.buffers;
Blob** blob = model->blobs;
for (int i = (token++)->size; i > 0; i--, blob++) {
gltfString uri = { 0 };
gltfString uri;
memset(&uri, 0, sizeof(uri));
size_t size = 0;
for (int k = (token++)->size; k > 0; k--) {
@ -708,7 +711,7 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
} else if (STR_EQ(key, "attributes")) {
int attributeCount = (token++)->size;
for (int a = 0; a < attributeCount; a++) {
DefaultAttribute attributeType = -1;
DefaultAttribute attributeType = ~0;
gltfString name = NOM_STR(json, token);
int attributeIndex = NOM_INT(json, token);
if (STR_EQ(name, "POSITION")) { attributeType = ATTR_POSITION; }
@ -718,7 +721,7 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
else if (STR_EQ(name, "TANGENT")) { attributeType = ATTR_TANGENT; }
else if (STR_EQ(name, "JOINTS_0")) { attributeType = ATTR_BONES; }
else if (STR_EQ(name, "WEIGHTS_0")) { attributeType = ATTR_WEIGHTS; }
if (attributeType >= 0) {
if (attributeType != (DefaultAttribute) ~0) {
primitive->attributes[attributeType] = &model->attributes[attributeIndex];
}
}