glslang: Fix a few more warnings, and see it using nullptr causes anyone problems (testing c++11 portability).

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31218 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-05-18 01:59:45 +00:00
parent b06127c513
commit ca3457f1a7
11 changed files with 87 additions and 81 deletions

View file

@ -100,15 +100,15 @@ TPpContext::MemoryPool* TPpContext::mem_CreatePool(size_t chunksize, unsigned in
if (chunksize == 0)
chunksize = CHUNKSIZE;
if (align & (align - 1))
return 0;
return nullptr;
if (chunksize < sizeof(MemoryPool))
return 0;
return nullptr;
if (chunksize & (align - 1))
return 0;
return nullptr;
MemoryPool *pool = (MemoryPool*)malloc(chunksize);
if (! pool)
return 0;
return nullptr;
pool->next = 0;
pool->chunksize = chunksize;
@ -143,10 +143,12 @@ void* TPpContext::mem_Alloc(MemoryPool *pool, size_t size)
// request size is too big for the chunksize, so allocate it as
// a single chunk of the right size
ch = (struct chunk*)malloc(minreq);
if (!ch) return 0;
if (! ch)
return nullptr;
} else {
ch = (struct chunk*)malloc(pool->chunksize);
if (!ch) return 0;
if (! ch)
return nullptr;
pool->free = (uintptr_t)ch + minreq;
pool->end = (uintptr_t)ch + pool->chunksize;
}