jpaver / opengametools

A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.
MIT License
375 stars 36 forks source link

ogt_vox: Compiler warnings in release mode #41

Closed mgerhardy closed 2 years ago

mgerhardy commented 2 years ago
/vengi/src/modules/voxelformat/external/ogt_vox.h: In function ‘void generate_instances_for_node(_vox_array<const _vox_scene_node_*>&, const _vox_array<_vox_scene_node_>&, uint32_t, const _vox_array<unsigned int>&, const _vox_array<ogt_vox_model*>&, _vox_array<ogt_vox_instance>&, _vox_array<char>&, _vox_array<ogt_vox_group>&, uint32_t, bool)’:
/vengi/src/modules/voxelformat/external/ogt_vox.h:1027:45: warning: unused variable ‘last_group’ [-Wunused-variable]
 1027 |                     const _vox_scene_node_* last_group     = stack.peek_back(1);
      |                                             ^~~~~~~~~~
/vengi/src/modules/voxelformat/external/ogt_vox.h: In function ‘uint8_t* ogt_vox_write_scene(const ogt_vox_scene*, uint32_t*)’:
/vengi/src/modules/voxelformat/external/ogt_vox.h:2476:107: warning: the address of ‘color_string’ will never be NULL [-Waddress]
 2476 |             uint32_t layer_dict_keyvalue_count = (layer_name_string ? 1 : 0) + (hidden_string ? 1 : 0) + (color_string ? 1 : 0);
      |                                                                                                           ^~~~~~~~~~~~
/vengi/src/modules/voxelformat/external/ogt_vox.h:2472:18: note: ‘color_string’ declared here
 2472 |             char color_string[64];
      |                  ^~~~~~~~~~~~
[ 54%] Built target attrib
/vengi/src/modules/voxelformat/external/ogt_vox.h: In function ‘void ogt_vox_test()’:
/vengi/src/modules/voxelformat/external/ogt_vox.h:2890:25: warning: unused variable ‘test_message’ [-Wunused-variable]
 2890 |             const char* test_message = "failed compute_looped_frame_index test";
      |   
jpaver commented 2 years ago

Thanks for the report - I've addressed these warnings with this commit: https://github.com/jpaver/opengametools/commit/e1743d37cf7a8128568769cf71cf598166c2cd30. Closing!