cwCommonImpl.h/cpp : Added #include <ccytpe>. Check for null label in labelToId()
This commit is contained in:
parent
7e6ab875c9
commit
39599e3e2e
@ -28,9 +28,11 @@ const char* cw::idToLabel( const idLabelPair_t* array, unsigned id, unsigned eol
|
||||
unsigned cw::labelToId( const idLabelPair_t* array, const char* label, unsigned eolId )
|
||||
{
|
||||
const idLabelPair_t* p = array;
|
||||
for(; p->id != eolId; ++p)
|
||||
if( std::strcmp(label,p->label) == 0 )
|
||||
return p->id;
|
||||
|
||||
if( label != nullptr )
|
||||
for(; p->id != eolId; ++p)
|
||||
if( std::strcmp(label,p->label) == 0 )
|
||||
return p->id;
|
||||
|
||||
return eolId;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
#include <cctype>
|
||||
#include <complex>
|
||||
#include <type_traits>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user