Skip to content

Commit de481aa

Browse files
committed
GPU Config: Add short/unsigned short as possible configuration value type
1 parent 287e229 commit de481aa

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

GPU/GPUTracking/Standalone/utils/qconfig.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,24 @@ inline int qAddOptionType<unsigned int>(qConfigSettings<unsigned int>& settings,
374374
settings.doDefault);
375375
}
376376
template <>
377+
inline int qAddOptionType<short>(qConfigSettings<short>& settings, short& ref, int& i, const char** argv, const int argc, short /*def*/)
378+
{
379+
return qAddOptionGeneric<short>(
380+
settings, ref, i, argv, argc, settings.set, [](const char* a) -> short {
381+
return atoi(a);
382+
},
383+
settings.doDefault);
384+
}
385+
template <>
386+
inline int qAddOptionType<unsigned short>(qConfigSettings<unsigned short>& settings, unsigned short& ref, int& i, const char** argv, const int argc, unsigned short /*def*/)
387+
{
388+
return qAddOptionGeneric<unsigned short>(
389+
settings, ref, i, argv, argc, settings.set, [](const char* a) -> unsigned short {
390+
return strtoul(a, nullptr, 0);
391+
},
392+
settings.doDefault);
393+
}
394+
template <>
377395
inline int qAddOptionType<long>(qConfigSettings<long>& settings, long& ref, int& i, const char** argv, const int argc, long /*def*/)
378396
{
379397
return qAddOptionGeneric<long>(

0 commit comments

Comments
 (0)