Browse Source

Minor compilation warning fixes.

legacy
Sam Hocevar 5 years ago
parent
commit
a1e258656e
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/easymesh/csgbsp.cpp
  2. +2
    -2
      src/image/codec/zed-image.cpp

+ 2
- 2
src/easymesh/csgbsp.cpp View File

@@ -19,7 +19,7 @@ namespace lol
//-- //--
int CsgBsp::AddLeaf(int leaf_type, vec3 origin, vec3 normal, int above_idx) int CsgBsp::AddLeaf(int leaf_type, vec3 origin, vec3 normal, int above_idx)
{ {
if (leaf_type > 2 && leaf_type < -1)
if (leaf_type > 2 || leaf_type < -1)
return -1; return -1;


if ((m_tree.count() == 0 && above_idx == -1) || if ((m_tree.count() == 0 && above_idx == -1) ||
@@ -104,7 +104,7 @@ void CsgBsp::AddTriangleToTree(int const &tri_idx, vec3 const &tri_p0, vec3 cons


for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
vec3 ray = v[(i + 1) % 3] - v[i];
//vec3 ray = v[(i + 1) % 3] - v[i];


if (TestRayVsPlane(v[i], v[(i + 1) % 3], if (TestRayVsPlane(v[i], v[(i + 1) % 3],
m_tree[leaf_idx].m_origin, m_tree[leaf_idx].m_normal, m_tree[leaf_idx].m_origin, m_tree[leaf_idx].m_normal,


+ 2
- 2
src/image/codec/zed-image.cpp View File

@@ -121,7 +121,7 @@ ResourceCodecData* ZedImageCodec::Load(std::string const &path)
//Get FileCount //Get FileCount
uint32_t file_pos = 0; uint32_t file_pos = 0;
uint16_t file_count = 0; uint16_t file_count = 0;
file_count = *((uint16_t*)(&file_buffer[file_pos]));
memcpy(&file_count, &file_buffer[file_pos], sizeof(uint16_t));
file_pos += sizeof(uint16_t); file_pos += sizeof(uint16_t);


array<uint32_t> file_offset; array<uint32_t> file_offset;
@@ -129,7 +129,7 @@ ResourceCodecData* ZedImageCodec::Load(std::string const &path)
//Get all the file offsets //Get all the file offsets
for (int i = 0; i < file_count; i++) for (int i = 0; i < file_count; i++)
{ {
file_offset[i] = *((uint32_t*)(&file_buffer[file_pos]));
memcpy(&file_offset[i], &file_buffer[file_pos], sizeof(uint32_t));
file_pos += sizeof(uint32_t); file_pos += sizeof(uint32_t);
} }
file_offset << file_size; file_offset << file_size;


Loading…
Cancel
Save