Skip to content

Commit c9a1298

Browse files
committed
parse SOCVendor/GPUVendor needs len param.
1 parent 5e8b83c commit c9a1298

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

inc/hgl/platform/SOC.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace hgl
4141
"JLQ",
4242
};
4343

44-
const SOCVendor ParseSOCVendor(const char *str);
44+
const SOCVendor ParseSOCVendor(const char *str,const int len=0);
4545

4646
enum class CpuArch
4747
{
@@ -173,7 +173,7 @@ namespace hgl
173173
"Maleoon",
174174
};
175175

176-
const SOCGPUVendor ParseSOCGPUVendor(const char *str);
176+
const SOCGPUVendor ParseSOCGPUVendor(const char *str,const int len=0);
177177

178178
struct SOCGPUInfo
179179
{

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ IF(CM_PLATFORM_SOC)
127127
SET(SOC_SOURCE ${CMPLATFORM_ROOT_INCLUDE_PATH}/hgl/platform/SOC.h
128128
SOC/SOC.cpp
129129
SOC/ARMCpuInfo.cpp
130-
SOC/Kryo.cpp
131130
)
132131

133132
SOURCE_GROUP("SOC" FILES ${SOC_SOURCE})

src/SOC/SOC.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,23 +150,23 @@ namespace
150150

151151
namespace hgl
152152
{
153-
const SOCVendor ParseSOCVendor(const char *str)
153+
const SOCVendor ParseSOCVendor(const char *str,const int len)
154154
{
155155
if(!str||!*str)return(SOCVendor::Unknow);
156156

157-
int index=hgl::find_str_in_array<char>(int(SOCVendor::RANGE_SIZE),(const char **)SOCVendorName,str);
157+
int index=hgl::find_str_in_array<char>(int(SOCVendor::RANGE_SIZE),(const char **)SOCVendorName,str,len);
158158

159159
if(index<0||index>=int(SOCVendor::RANGE_SIZE))
160160
return(SOCVendor::Unknow);
161161

162162
return SOCVendor(index);
163163
}
164164

165-
const SOCGPUVendor ParseSOCGPUVendor(const char *str)
165+
const SOCGPUVendor ParseSOCGPUVendor(const char *str,const int len)
166166
{
167167
if(!str||!*str)return(SOCGPUVendor::Unknow);
168168

169-
int index=hgl::find_str_in_array<char>(int(SOCGPUVendor::RANGE_SIZE),(const char **)SOCGPUVendorName,str);
169+
int index=hgl::find_str_in_array<char>(int(SOCGPUVendor::RANGE_SIZE),(const char **)SOCGPUVendorName,str,len);
170170

171171
if(index<0||index>=int(SOCGPUVendor::RANGE_SIZE))
172172
return(SOCGPUVendor::Unknow);

src/Win/EnumWinFonts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include<Windows.h>
1+
#include<hgl/platform/Platform.h>
22
#include<hgl/text/FontInfo.h>
33
#include<hgl/type/StrChar.h>
44

0 commit comments

Comments
 (0)