(com-parser) Use STRLEN_CONST

This commit is contained in:
twinaphex 2020-10-02 20:49:56 +02:00
parent 7517ea081a
commit 12012b5041
2 changed files with 5 additions and 3 deletions

View File

@ -99,7 +99,7 @@ else
endif
endif
INCLUDE_DIRS += -I. -I../../deps/peglib
INCLUDE_DIRS += -I. -I../../deps/peglib -I../../libretro-common/include
$(info os : $(OS))
$(info host : $(ARCH))

View File

@ -18,6 +18,7 @@
#include <fstream>
#include <sstream>
#include <cstring>
#include <string/stdstring.h>
using namespace peg;
using namespace std;
@ -198,7 +199,7 @@ string insert_name(const string& fname, const string& name)
{
if(name.length() == 2 && name[1] == 'S')
{
if(!strncmp(fname.c_str() + action.length(), "Shader", strlen("Shader")))
if(!strncmp(fname.c_str() + action.length(), "Shader", STRLEN_CONST("Shader")))
return action + name[0] + (fname.c_str() + action.length());
else
return action + name[0] + "Shader" + (fname.c_str() + action.length());
@ -588,7 +589,8 @@ public:
char* str = line;
while (*str && ::isspace(*str))
str++;
if (*str && !strncmp(str, "typedef struct ", strlen("typedef struct ")))
if (*str && !strncmp(str, "typedef struct ",
STRLEN_CONST("typedef struct ")))
{
if(*str && strstr(str, "Vtbl"))
{