mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-28 19:55:26 +00:00
Cleanup.
This commit is contained in:
@@ -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() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user