Cleanup.
This commit is contained in:
parent
7983b68047
commit
bfe5a66b3e
@ -210,7 +210,7 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath,
|
||||
uint8_t* out = NULL;
|
||||
static uint8_t pngMagic[] = { 0x89, 0x50, 0x4E, 0x47, 0x0d, 0x0a };
|
||||
|
||||
if (0 == memcmp(data, pngMagic, sizeof(pngMagic) ) )
|
||||
if (0 == bx::memCmp(data, pngMagic, sizeof(pngMagic) ) )
|
||||
{
|
||||
release = lodepng_free;
|
||||
|
||||
@ -329,22 +329,22 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _filePath,
|
||||
{
|
||||
const EXRChannelInfo& channel = exrHeader.channels[ii];
|
||||
if (UINT8_MAX == idxR
|
||||
&& 0 == strcmp(channel.name, "R") )
|
||||
&& 0 == bx::strncmp(channel.name, "R") )
|
||||
{
|
||||
idxR = ii;
|
||||
}
|
||||
else if (UINT8_MAX == idxG
|
||||
&& 0 == strcmp(channel.name, "G") )
|
||||
&& 0 == bx::strncmp(channel.name, "G") )
|
||||
{
|
||||
idxG = ii;
|
||||
}
|
||||
else if (UINT8_MAX == idxB
|
||||
&& 0 == strcmp(channel.name, "B") )
|
||||
&& 0 == bx::strncmp(channel.name, "B") )
|
||||
{
|
||||
idxB = ii;
|
||||
}
|
||||
else if (UINT8_MAX == idxA
|
||||
&& 0 == strcmp(channel.name, "A") )
|
||||
&& 0 == bx::strncmp(channel.name, "A") )
|
||||
{
|
||||
idxA = ii;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ using namespace entry;
|
||||
|
||||
PP_EXPORT const void* PPP_GetInterface(const char* _name)
|
||||
{
|
||||
if (0 == strcmp(_name, PPP_INSTANCE_INTERFACE) )
|
||||
if (0 == bx::strncmp(_name, PPP_INSTANCE_INTERFACE) )
|
||||
{
|
||||
static PPP_Instance instanceInterface =
|
||||
{
|
||||
|
@ -463,7 +463,7 @@ namespace bgfx
|
||||
{
|
||||
for (const EmbeddedShader* es = _es; NULL != es->name; ++es)
|
||||
{
|
||||
if (0 == strcmp(_name, es->name) )
|
||||
if (0 == bx::strncmp(_name, es->name) )
|
||||
{
|
||||
for (const EmbeddedShader::Data* esd = es->data; RendererType::Count != esd->type; ++esd)
|
||||
{
|
||||
@ -808,7 +808,7 @@ namespace bgfx
|
||||
for (uint32_t ii = 0; ii < UniformType::Count; ++ii)
|
||||
{
|
||||
if (NULL != s_uniformTypeName[ii]
|
||||
&& 0 == strcmp(_name, s_uniformTypeName[ii]) )
|
||||
&& 0 == bx::strncmp(_name, s_uniformTypeName[ii]) )
|
||||
{
|
||||
return UniformType::Enum(ii);
|
||||
}
|
||||
@ -842,7 +842,7 @@ namespace bgfx
|
||||
{
|
||||
for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii)
|
||||
{
|
||||
if (0 == strcmp(_name, s_predefinedName[ii]) )
|
||||
if (0 == bx::strncmp(_name, s_predefinedName[ii]) )
|
||||
{
|
||||
return PredefinedUniform::Enum(ii);
|
||||
}
|
||||
|
@ -2685,7 +2685,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
for (jj = 0; jj < num; ++jj)
|
||||
{
|
||||
curr = &vertexElements[jj];
|
||||
if (0 == strcmp(curr->SemanticName, "TEXCOORD")
|
||||
if (0 == bx::strncmp(curr->SemanticName, "TEXCOORD")
|
||||
&& curr->SemanticIndex == index)
|
||||
{
|
||||
break;
|
||||
@ -2989,7 +2989,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
{
|
||||
D3D11_SAMPLER_DESC sd;
|
||||
sampler->GetDesc(&sd);
|
||||
if (0 != memcmp(_rgba, sd.BorderColor, 16) )
|
||||
if (0 != bx::memCmp(_rgba, sd.BorderColor, 16) )
|
||||
{
|
||||
// Sampler will be released when updated sampler
|
||||
// is added to cache.
|
||||
|
@ -2236,7 +2236,7 @@ data.NumQualityLevels = 0;
|
||||
for (jj = 0; jj < num; ++jj)
|
||||
{
|
||||
curr = &_vertexElements[jj];
|
||||
if (0 == strcmp(curr->SemanticName, "TEXCOORD")
|
||||
if (0 == bx::strncmp(curr->SemanticName, "TEXCOORD")
|
||||
&& curr->SemanticIndex == index)
|
||||
{
|
||||
break;
|
||||
@ -2388,14 +2388,14 @@ data.NumQualityLevels = 0;
|
||||
|
||||
dxbcHash(temp->data + 20, temp->size - 20, temp->data + 4);
|
||||
|
||||
patchShader = 0 == memcmp(program.m_fsh->m_code->data, temp->data, 16);
|
||||
patchShader = 0 == bx::memCmp(program.m_fsh->m_code->data, temp->data, 16);
|
||||
BX_CHECK(patchShader, "DXBC fragment shader patching error (ShaderHandle: %d).", program.m_fsh - m_shaders);
|
||||
|
||||
if (!patchShader)
|
||||
{
|
||||
for (uint32_t ii = 20; ii < temp->size; ii += 16)
|
||||
{
|
||||
if (0 != memcmp(&program.m_fsh->m_code->data[ii], &temp->data[ii], 16) )
|
||||
if (0 != bx::memCmp(&program.m_fsh->m_code->data[ii], &temp->data[ii], 16) )
|
||||
{
|
||||
// bx::debugPrintfData(&program.m_fsh->m_code->data[ii], temp->size-ii, "");
|
||||
// bx::debugPrintfData(&temp->data[ii], temp->size-ii, "");
|
||||
@ -3579,7 +3579,7 @@ data.NumQualityLevels = 0;
|
||||
_commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, cmd.cbv);
|
||||
}
|
||||
|
||||
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
||||
if (0 != bx::memCmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
||||
{
|
||||
bx::memCopy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
||||
_commandList->IASetVertexBuffers(0
|
||||
@ -3609,7 +3609,7 @@ data.NumQualityLevels = 0;
|
||||
_commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, cmd.cbv);
|
||||
}
|
||||
|
||||
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
||||
if (0 != bx::memCmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
||||
{
|
||||
bx::memCopy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
||||
_commandList->IASetVertexBuffers(0
|
||||
@ -3618,7 +3618,7 @@ data.NumQualityLevels = 0;
|
||||
);
|
||||
}
|
||||
|
||||
if (0 != memcmp(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) ) )
|
||||
if (0 != bx::memCmp(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) ) )
|
||||
{
|
||||
bx::memCopy(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) );
|
||||
_commandList->IASetIndexBuffer(&cmd.ibv);
|
||||
|
@ -1354,7 +1354,7 @@ namespace bgfx { namespace gl
|
||||
ext += 3;
|
||||
}
|
||||
|
||||
if (0 == strcmp(ext, extension.m_name) )
|
||||
if (0 == bx::strncmp(ext, extension.m_name) )
|
||||
{
|
||||
extension.m_supported = true;
|
||||
supported = true;
|
||||
@ -1543,7 +1543,7 @@ namespace bgfx { namespace gl
|
||||
;
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31)
|
||||
&& 0 == strcmp(m_vendor, "Imagination Technologies")
|
||||
&& 0 == bx::strncmp(m_vendor, "Imagination Technologies")
|
||||
&& NULL != strstr(m_version, "(SDK 3.5@3510720)") )
|
||||
{
|
||||
// Skip initializing extensions that are broken in emulator.
|
||||
|
Loading…
Reference in New Issue
Block a user