Cleanup.
This commit is contained in:
Родитель
3e4c4b8a6c
Коммит
eccf6b7b1c
11
src/bgfx.cpp
11
src/bgfx.cpp
|
@ -116,9 +116,10 @@ namespace bgfx
|
|||
BX_UNUSED(_filePath, _width, _height, _pitch, _data, _size, _yflip);
|
||||
|
||||
#if BX_CONFIG_CRT_FILE_READER_WRITER
|
||||
char* filePath = (char*)alloca(strlen(_filePath)+5);
|
||||
strcpy(filePath, _filePath);
|
||||
strcat(filePath, ".tga");
|
||||
const size_t len = bx::strnlen(_filePath)+5;
|
||||
char* filePath = (char*)alloca(len);
|
||||
bx::strlncpy(filePath, len, _filePath);
|
||||
bx::strlncat(filePath, len, ".tga");
|
||||
|
||||
bx::CrtFileWriter writer;
|
||||
if (bx::open(&writer, filePath) )
|
||||
|
@ -526,7 +527,7 @@ namespace bgfx
|
|||
return _default;
|
||||
}
|
||||
|
||||
if (0 == strncmp(ptr, "0m", 2) )
|
||||
if (0 == bx::strncmp(ptr, "0m", 2) )
|
||||
{
|
||||
_ptr = ptr + 2;
|
||||
return _default;
|
||||
|
@ -1071,7 +1072,7 @@ namespace bgfx
|
|||
|
||||
void UniformBuffer::writeMarker(const char* _marker)
|
||||
{
|
||||
uint16_t num = (uint16_t)strlen(_marker)+1;
|
||||
uint16_t num = (uint16_t)bx::strnlen(_marker)+1;
|
||||
uint32_t opcode = encodeOpcode(bgfx::UniformType::Count, 0, num, true);
|
||||
write(opcode);
|
||||
write(_marker, num);
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h> // va_list
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <alloca.h>
|
||||
|
||||
// Check handle, cannot be bgfx::invalidHandle and must be valid.
|
||||
|
|
Загрузка…
Ссылка в новой задаче