mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-05 21:25:44 -07:00
Updated gencpp with latest fixes used in other projects.
This variant can support parsing some Unreal Engine files!!
This commit is contained in:
@ -73,22 +73,22 @@ namespace ESpecifier
|
||||
{ sizeof( "= 0" ), "= 0" },
|
||||
{ sizeof( "volatile" ), "volatile" },
|
||||
};
|
||||
return lookup[ type ];
|
||||
return lookup[type];
|
||||
}
|
||||
|
||||
Type to_type( StrC str )
|
||||
{
|
||||
local_persist u32 keymap[ NumSpecifiers ];
|
||||
local_persist u32 keymap[NumSpecifiers];
|
||||
do_once_start for ( u32 index = 0; index < NumSpecifiers; index++ )
|
||||
{
|
||||
StrC enum_str = to_str( ( Type )index );
|
||||
keymap[ index ] = crc32( enum_str.Ptr, enum_str.Len - 1 );
|
||||
StrC enum_str = to_str( (Type)index );
|
||||
keymap[index] = crc32( enum_str.Ptr, enum_str.Len - 1 );
|
||||
}
|
||||
do_once_end u32 hash = crc32( str.Ptr, str.Len );
|
||||
for ( u32 index = 0; index < NumSpecifiers; index++ )
|
||||
{
|
||||
if ( keymap[ index ] == hash )
|
||||
return ( Type )index;
|
||||
if ( keymap[index] == hash )
|
||||
return (Type)index;
|
||||
}
|
||||
return Invalid;
|
||||
}
|
||||
|
Reference in New Issue
Block a user