Skip to content
This repository was archived by the owner on Sep 19, 2020. It is now read-only.

Commit f6e48df

Browse files
authored
Merge pull request Unity-Technologies#3 from DaemonEngine/slipher/unity-warnings
Fix warnings introduced by Unity changes
2 parents c275f97 + 9f1e641 commit f6e48df

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

inc/crn_decomp.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ static void* crnd_default_realloc(void* p, size_t size, size_t* pActual_size, bo
19651965
}
19661966

19671967
static size_t crnd_default_msize(void* p, void* pUser_data) {
1968-
pUser_data;
1968+
(void)pUser_data;
19691969
#ifdef WIN32
19701970
return p ? _msize(p) : 0;
19711971
#else
@@ -2323,11 +2323,11 @@ const void* crnd_get_level_data(const void* pData, uint32 data_size, uint32 leve
23232323

23242324
uint32 crnd_get_segmented_file_size(const void* pData, uint32 data_size) {
23252325
if ((!pData) || (data_size < cCRNHeaderMinSize))
2326-
return NULL;
2326+
return false;
23272327

23282328
const crn_header* pHeader = crnd_get_header(pData, data_size);
23292329
if (!pHeader)
2330-
return NULL;
2330+
return false;
23312331

23322332
uint32 size = pHeader->m_header_size;
23332333

@@ -3297,8 +3297,8 @@ class crn_unpacker {
32973297

32983298
bool unpack_dxt1(uint8** pDst, uint32 output_pitch_in_bytes, uint32 output_width, uint32 output_height) {
32993299
const uint32 num_color_endpoints = m_color_endpoints.size();
3300-
const uint32 width = output_width + 1 & ~1;
3301-
const uint32 height = output_height + 1 & ~1;
3300+
const uint32 width = (output_width + 1) & ~1;
3301+
const uint32 height = (output_height + 1) & ~1;
33023302
const int32 delta_pitch_in_dwords = (output_pitch_in_bytes >> 2) - (width << 1);
33033303

33043304
if (m_block_buffer.size() < width)
@@ -3349,8 +3349,8 @@ class crn_unpacker {
33493349
bool unpack_dxt5(uint8** pDst, uint32 row_pitch_in_bytes, uint32 output_width, uint32 output_height) {
33503350
const uint32 num_color_endpoints = m_color_endpoints.size();
33513351
const uint32 num_alpha_endpoints = m_alpha_endpoints.size();
3352-
const uint32 width = output_width + 1 & ~1;
3353-
const uint32 height = output_height + 1 & ~1;
3352+
const uint32 width = (output_width + 1) & ~1;
3353+
const uint32 height = (output_height + 1) & ~1;
33543354
const int32 delta_pitch_in_dwords = (row_pitch_in_bytes >> 2) - (width << 2);
33553355

33563356
if (m_block_buffer.size() < width)
@@ -3411,8 +3411,8 @@ class crn_unpacker {
34113411

34123412
bool unpack_dxn(uint8** pDst, uint32 row_pitch_in_bytes, uint32 output_width, uint32 output_height) {
34133413
const uint32 num_alpha_endpoints = m_alpha_endpoints.size();
3414-
const uint32 width = output_width + 1 & ~1;
3415-
const uint32 height = output_height + 1 & ~1;
3414+
const uint32 width = (output_width + 1) & ~1;
3415+
const uint32 height = (output_height + 1) & ~1;
34163416
const int32 delta_pitch_in_dwords = (row_pitch_in_bytes >> 2) - (width << 2);
34173417

34183418
if (m_block_buffer.size() < width)
@@ -3474,8 +3474,8 @@ class crn_unpacker {
34743474

34753475
bool unpack_dxt5a(uint8** pDst, uint32 row_pitch_in_bytes, uint32 output_width, uint32 output_height) {
34763476
const uint32 num_alpha_endpoints = m_alpha_endpoints.size();
3477-
const uint32 width = output_width + 1 & ~1;
3478-
const uint32 height = output_height + 1 & ~1;
3477+
const uint32 width = (output_width + 1) & ~1;
3478+
const uint32 height = (output_height + 1) & ~1;
34793479
const int32 delta_pitch_in_dwords = (row_pitch_in_bytes >> 2) - (width << 1);
34803480

34813481
if (m_block_buffer.size() < width)
@@ -3526,8 +3526,8 @@ class crn_unpacker {
35263526

35273527
bool unpack_etc1(uint8** pDst, uint32 output_pitch_in_bytes, uint32 output_width, uint32 output_height) {
35283528
const uint32 num_color_endpoints = m_color_endpoints.size();
3529-
const uint32 width = output_width + 1 & ~1;
3530-
const uint32 height = output_height + 1 & ~1;
3529+
const uint32 width = (output_width + 1) & ~1;
3530+
const uint32 height = (output_height + 1) & ~1;
35313531
const int32 delta_pitch_in_dwords = (output_pitch_in_bytes >> 2) - (width << 1);
35323532

35333533
if (m_block_buffer.size() < width << 1)
@@ -3593,8 +3593,8 @@ class crn_unpacker {
35933593
bool unpack_etc2a(uint8** pDst, uint32 output_pitch_in_bytes, uint32 output_width, uint32 output_height) {
35943594
const uint32 num_color_endpoints = m_color_endpoints.size();
35953595
const uint32 num_alpha_endpoints = m_alpha_endpoints.size();
3596-
const uint32 width = output_width + 1 & ~1;
3597-
const uint32 height = output_height + 1 & ~1;
3596+
const uint32 width = (output_width + 1) & ~1;
3597+
const uint32 height = (output_height + 1) & ~1;
35983598
const int32 delta_pitch_in_dwords = (output_pitch_in_bytes >> 2) - (width << 2);
35993599

36003600
if (m_block_buffer.size() < width << 1)

0 commit comments

Comments
 (0)