loader_aw

Load OBJ/MTL file formats
git clone git://git.meso-star.fr/loader_aw.git
Log | Files | Refs | README | LICENSE

commit 16405eb66ee858c999c2ec92a655f358c9903dd1
parent a77166e939dee84af2565e8cfce495e1bc9d650c
Author: vaplv <vaplv@free.fr>
Date:   Sun, 21 Sep 2014 16:06:31 +0200

Fix warnings and issues when one compiles in 32-bits

Diffstat:
M.gitignore | 2+-
Msrc/aw_mtl.c | 7++++---
Msrc/aw_obj.c | 7++++---
Msrc/test_aw_mtl.c | 6+++---
4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -3,7 +3,7 @@ CMakeCache.txt CMakeFiles Makefile tmp -[Bb]uild +[Bb]uild* *.sw[po] *.[ao] *~ diff --git a/src/aw_mtl.c b/src/aw_mtl.c @@ -456,14 +456,14 @@ parse_mtl_line(struct aw_mtl* mtl, char* line) } else { res = AW_OK; fprintf(stderr, "%s:%lu: warning: ignored or malformed directive %s\n", - mtl->filename, mtl->iline, word); + mtl->filename, (unsigned long)mtl->iline, word); while((word = strtok_r(NULL, " \t", &word_tk))); } if(res != AW_OK) goto error; if((word = strtok_r(NULL, " ", &word_tk))) { fprintf(stderr, "%s:%lu: unexpected directive %s\n", - mtl->filename, mtl->iline, word); + mtl->filename, (unsigned long)mtl->iline, word); res = AW_BAD_ARGUMENT; goto error; } @@ -471,7 +471,8 @@ parse_mtl_line(struct aw_mtl* mtl, char* line) exit: return res; error: - fprintf(stderr, "%s:%lu: error: parsing failed\n", mtl->filename, mtl->iline); + fprintf(stderr, "%s:%lu: error: parsing failed\n", + mtl->filename, (unsigned long)mtl->iline); goto exit; } diff --git a/src/aw_obj.c b/src/aw_obj.c @@ -448,13 +448,13 @@ parse_obj_line(struct aw_obj* obj, char* line) } else { res = AW_OK; fprintf(stderr, "%s:%lu: warning: ignored or malformed directive %s", - obj->filename, obj->iline, word); + obj->filename, (unsigned long)obj->iline, word); } if(res != AW_OK) goto error; if((word = strtok_r(NULL, " ", &word_tk))) { fprintf(stderr, "%s:%lu: unexpected directive %s\n", - obj->filename, obj->iline, word); + obj->filename, (unsigned long)obj->iline, word); res = AW_BAD_ARGUMENT; goto error; } @@ -462,7 +462,8 @@ parse_obj_line(struct aw_obj* obj, char* line) exit: return res; error: - fprintf(stderr, "%s:%lu: error: parsing failed\n", obj->filename, obj->iline); + fprintf(stderr, "%s:%lu: error: parsing failed\n", + obj->filename, (unsigned long)obj->iline); goto exit; } diff --git a/src/test_aw_mtl.c b/src/test_aw_mtl.c @@ -97,7 +97,7 @@ test_common(struct aw_mtl* mtl) CHECK(f3_eq(mtr->transmission.value, tmp), 1); CHECK(mtr->specular_exponent, 10.f); - CHECK(mtr->refraction_index, 1.19713f); + CHECK(mtr->refraction_index, (float)1.19713f); CHECK(mtr->illumination_model, 6); CHECK(strcmp(mtr->ambient_map.filename, "chrome.mpc"), 0); @@ -233,7 +233,7 @@ test_multiple_materials(struct aw_mtl* mtl) CHECK(aw_mtl_material_get(mtl, 1, &mtr), AW_OK); CHECK(strcmp(mtr->name, "textured_material"), 0); CHECK(mtr->specular_exponent, 6.f); - CHECK(mtr->refraction_index, 1.7f); + CHECK(mtr->refraction_index, (float)1.7f); CHECK(mtr->transmission.color_space, AW_COLOR_RGB); CHECK(f3_eq(mtr->transmission.value, f3(tmp, 1.f, 1.2f, 1.3f)), 1); CHECK(mtr->illumination_model, 0); @@ -247,7 +247,7 @@ test_multiple_materials(struct aw_mtl* mtl) CHECK(strcmp(mtr->diffuse_map.filename, "tex6x6.png"), 0); CHECK(strcmp(mtr->bump_map.filename, "tex6x6-bump.png"), 0); CHECK(mtr->bump_map.scalar, AW_MAP_CHANNEL_RED); - CHECK(mtr->bump_map.bump_multiplier, 0.2f); + CHECK(mtr->bump_map.bump_multiplier, (float)0.2f); CHECK(mtr->specular_exponent_map.filename, NULL); CHECK(aw_mtl_material_get(mtl, 2, &mtr), AW_OK);