summaryrefslogtreecommitdiff
path: root/src/ast/types.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/types.cpp')
-rw-r--r--src/ast/types.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ast/types.cpp b/src/ast/types.cpp
index f9103b37..496cf694 100644
--- a/src/ast/types.cpp
+++ b/src/ast/types.cpp
@@ -40,13 +40,14 @@ static const struct {
{"usize", CORETYPE_UINT},
};
-enum eCoreType coretype_fromstring(const ::std::string& name)
+enum eCoreType coretype_fromstring(const char* name)
{
for(unsigned int i = 0; i < sizeof(CORETYPES)/sizeof(CORETYPES[0]); i ++)
{
- if( name < CORETYPES[i].name )
+ int cmp = strcmp(name, CORETYPES[i].name);
+ if( cmp < 0 )
break;
- if( name == CORETYPES[i].name )
+ if( cmp == 0 )
return CORETYPES[i].type;
}
return CORETYPE_INVAL;