This commit is contained in:
Branimir Karadžić 2017-01-20 16:34:27 -08:00
Родитель 8a1c9a2f27
Коммит a8cf2f86a9
4 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -3499,7 +3499,7 @@ namespace bgfx
cmdbuf.write(handle);
cmdbuf.write(uniform.m_type);
cmdbuf.write(uniform.m_num);
uint8_t len = (uint8_t)strlen(_name)+1;
uint8_t len = (uint8_t)bx::strnlen(_name)+1;
cmdbuf.write(len);
cmdbuf.write(_name, len);
}
@ -3527,7 +3527,7 @@ namespace bgfx
cmdbuf.write(handle);
cmdbuf.write(_type);
cmdbuf.write(_num);
uint8_t len = (uint8_t)strlen(_name)+1;
uint8_t len = (uint8_t)bx::strnlen(_name)+1;
cmdbuf.write(len);
cmdbuf.write(_name, len);
}
@ -3603,7 +3603,7 @@ namespace bgfx
BGFX_API_FUNC(void saveScreenShot(const char* _filePath) )
{
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::SaveScreenShot);
uint16_t len = (uint16_t)strlen(_filePath)+1;
uint16_t len = (uint16_t)bx::strnlen(_filePath)+1;
cmdbuf.write(len);
cmdbuf.write(_filePath, len);
}
@ -3622,7 +3622,7 @@ namespace bgfx
{
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::UpdateViewName);
cmdbuf.write(_id);
uint16_t len = (uint16_t)strlen(_name)+1;
uint16_t len = (uint16_t)bx::strnlen(_name)+1;
cmdbuf.write(len);
cmdbuf.write(_name, len);
}

Просмотреть файл

@ -980,7 +980,7 @@ namespace bgfx { namespace gl
//
// If <length> is 0 then <marker> is assumed to be null-terminated.
uint32_t size = (0 == _length ? (uint32_t)strlen(_marker) : _length) + 1;
uint32_t size = (0 == _length ? (uint32_t)bx::strnlen(_marker) : _length) + 1;
size *= sizeof(wchar_t);
wchar_t* name = (wchar_t*)alloca(size);
mbstowcs(name, _marker, size-2);
@ -1039,7 +1039,7 @@ namespace bgfx { namespace gl
glGetError(); // ignore error if glGetString returns NULL.
if (NULL != str)
{
return bx::hashMurmur2A(str, (uint32_t)strlen(str) );
return bx::hashMurmur2A(str, (uint32_t)bx::strnlen(str) );
}
return 0;
@ -1051,7 +1051,7 @@ namespace bgfx { namespace gl
{
char name[1024];
const char* pos = _extensions;
const char* end = _extensions + strlen(_extensions);
const char* end = _extensions + bx::strnlen(_extensions);
while (pos < end)
{
uint32_t len;
@ -1062,7 +1062,7 @@ namespace bgfx { namespace gl
}
else
{
len = bx::uint32_min(sizeof(name), (uint32_t)strlen(pos) );
len = bx::uint32_min(sizeof(name), (uint32_t)bx::strnlen(pos) );
}
strncpy(name, pos, len);
@ -1469,7 +1469,7 @@ namespace bgfx { namespace gl
for (uint32_t ii = 0; ii < BX_COUNTOF(s_vendorIds); ++ii)
{
const VendorId& vendorId = s_vendorIds[ii];
if (0 == strncmp(vendorId.name, m_vendor, strlen(vendorId.name) ) )
if (0 == strncmp(vendorId.name, m_vendor, bx::strnlen(vendorId.name) ) )
{
g_caps.vendorId = vendorId.id;
break;
@ -1559,7 +1559,7 @@ namespace bgfx { namespace gl
{
char name[1024];
const char* pos = extensions;
const char* end = extensions + strlen(extensions);
const char* end = extensions + bx::strnlen(extensions);
uint32_t index = 0;
while (pos < end)
{
@ -1571,7 +1571,7 @@ namespace bgfx { namespace gl
}
else
{
len = bx::uint32_min(sizeof(name), (uint32_t)strlen(pos) );
len = bx::uint32_min(sizeof(name), (uint32_t)bx::strnlen(pos) );
}
strncpy(name, pos, len);
@ -5294,7 +5294,7 @@ namespace bgfx { namespace gl
void writeString(bx::WriterI* _writer, const char* _str)
{
bx::write(_writer, _str, (int32_t)strlen(_str) );
bx::write(_writer, _str, (int32_t)bx::strnlen(_str) );
}
void writeStringf(bx::WriterI* _writer, const char* _format, ...)
@ -5311,8 +5311,8 @@ namespace bgfx { namespace gl
void strins(char* _str, const char* _insert)
{
size_t len = strlen(_insert);
memmove(&_str[len], _str, strlen(_str)+1);
size_t len = bx::strnlen(_insert);
memmove(&_str[len], _str, bx::strnlen(_str)+1);
memcpy(_str, _insert, len);
}
@ -5382,7 +5382,7 @@ namespace bgfx { namespace gl
{
if (GL_COMPUTE_SHADER != m_type)
{
int32_t codeLen = (int32_t)strlen(code);
int32_t codeLen = (int32_t)bx::strnlen(code);
int32_t tempLen = codeLen + (4<<10);
char* temp = (char*)alloca(tempLen);
bx::StaticMemoryBlockWriter writer(temp, tempLen);

Просмотреть файл

@ -1812,7 +1812,7 @@ namespace bgfx { namespace mtl
void writeString(bx::WriterI* _writer, const char* _str)
{
bx::write(_writer, _str, (int32_t)strlen(_str) );
bx::write(_writer, _str, (int32_t)bx::strnlen(_str) );
}
void ShaderMtl::create(const Memory* _mem)

Просмотреть файл

@ -15,7 +15,7 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
bx::write(writer, temp, (int32_t)strlen(temp) );
bx::write(writer, temp, (int32_t)bx::strnlen(temp) );
return true;
}
@ -24,7 +24,7 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
bx::write(writer, temp, (int32_t)strlen(temp) );
bx::write(writer, temp, (int32_t)bx::strnlen(temp) );
return true;
}
@ -33,7 +33,7 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
bx::write(writer, temp, (int32_t)strlen(temp) );
bx::write(writer, temp, (int32_t)bx::strnlen(temp) );
return true;
}