Warning fixes, etc.

This commit is contained in:
Henrik Rydgård committed 2014-04-08 16:08:38 +02:00
1 parent b914c1a1fd
commit 1167f20d14
4 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -874,7 +874,7 @@ void *jpeg_decoder::alloc(size_t nSize, bool zero)
}
if (!rv)
{
int capacity = JPGD_MAX(32768 - 256, (nSize + 2047) & ~2047);
int capacity = (int)JPGD_MAX(32768 - 256, (nSize + 2047) & ~2047);
mem_block *b = (mem_block*)jpgd_malloc(sizeof(mem_block) + capacity);
if (!b) { stop_decoding(JPGD_NOTENOUGHMEM); }
b->m_pNext = m_pMem_blocks; m_pMem_blocks = b;
+3 -3
View File
@@ -1803,7 +1803,7 @@ namespace rg_etc1
{
if (block_inten[0] > m_pSorted_luma[n - 1])
{
const uint min_error = labs(block_inten[0] - m_pSorted_luma[n - 1]);
const uint min_error = (uint)(labs(block_inten[0] - m_pSorted_luma[n - 1]));
if (min_error >= trial_solution.m_error)
continue;
}
@@ -1817,7 +1817,7 @@ namespace rg_etc1
{
if (m_pSorted_luma[0] > block_inten[3])
{
const uint min_error = labs(m_pSorted_luma[0] - block_inten[3]);
const uint min_error = (uint)(labs(m_pSorted_luma[0] - block_inten[3]));
if (min_error >= trial_solution.m_error)
continue;
}
@@ -1909,7 +1909,7 @@ done:
for (uint packed_c = 0; packed_c < limit; packed_c++)
{
int v = etc1_decode_value(diff, inten, selector, packed_c);
uint err = labs(v - static_cast<int>(color));
uint err = (uint)labs(v - static_cast<int>(color));
if (err < best_error)
{
best_error = err;
+4 -1
View File
@@ -264,7 +264,10 @@ void glsl_destroy(GLSLProgram *program) {
}
void glsl_bind(const GLSLProgram *program) {
glUseProgram(program->program_);
if (program)
glUseProgram(program->program_);
else
glUseProgram(0);
}
void glsl_unbind() {
+1 -1
View File
@@ -308,7 +308,7 @@ int u8_read_escape_sequence(const char *str, uint32_t *dest)
if (dno > 0)
ch = strtol(digs, NULL, 16);
}
*dest = ch;
*dest = (uint32_t)ch;
return i;
}