This commit is contained in:
Branimir Karadžić
2017-02-08 19:55:31 -08:00
parent aa2a9deb5f
commit b99ebb9535
46 changed files with 338 additions and 353 deletions
+2 -4
View File
@@ -3,10 +3,8 @@
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include <ctype.h> // isspace
#include <stdint.h>
#include <stdlib.h> // size_t
#include <string.h> // strlen
#include <bx/allocator.h>
#include <bx/hash.h>
@@ -33,7 +31,7 @@ struct CmdContext
void add(const char* _name, ConsoleFn _fn, void* _userData)
{
uint32_t cmd = bx::hashMurmur2A(_name, (uint32_t)strlen(_name) );
uint32_t cmd = bx::hashMurmur2A(_name, (uint32_t)bx::strnlen(_name) );
BX_CHECK(m_lookup.end() == m_lookup.find(cmd), "Command \"%s\" already exist.", _name);
Func fn = { _fn, _userData };
m_lookup.insert(stl::make_pair(cmd, fn) );
@@ -51,7 +49,7 @@ struct CmdContext
if (argc > 0)
{
int err = -1;
uint32_t cmd = bx::hashMurmur2A(argv[0], (uint32_t)strlen(argv[0]) );
uint32_t cmd = bx::hashMurmur2A(argv[0], (uint32_t)bx::strnlen(argv[0]) );
CmdLookup::iterator it = m_lookup.find(cmd);
if (it != m_lookup.end() )
{