cwCommon.h,cwCommonImpl.h : small changes.

This commit is contained in:
kevin 2021-08-15 15:56:34 -04:00
parent 8c8be07c63
commit 7df957f4a9
2 changed files with 7 additions and 3 deletions

View File

@ -45,7 +45,8 @@ namespace cw
kFileNotFoundRC, // 26 kFileNotFoundRC, // 26
kTestFailRC, // 27 kTestFailRC, // 27
kInvalidStateRC, // 28 kInvalidStateRC, // 28
kBaseAppRC // 29 kTypeMismatchRC, // 29
kBaseAppRC // 30
} cwRC_t; } cwRC_t;
typedef unsigned rc_t; typedef unsigned rc_t;

View File

@ -18,7 +18,7 @@
#include <cstdint> #include <cstdint>
#include <cmath> #include <cmath>
#include <complex> #include <complex>
#include <type_traits>
#if defined(OS_LINUX) || defined(OS_OSX) #if defined(OS_LINUX) || defined(OS_OSX)
#define cwPOSIX_FILE_SYS #define cwPOSIX_FILE_SYS
@ -158,7 +158,10 @@ namespace cw
const char* label; const char* label;
} idLabelPair_t; } idLabelPair_t;
// Return nullptr if id is not found.
const char* idToLabel( const idLabelPair_t* array, unsigned id, unsigned eolId ); const char* idToLabel( const idLabelPair_t* array, unsigned id, unsigned eolId );
// Returns eolId if the id is not found.
unsigned labelToId( const idLabelPair_t* array, const char* label, unsigned eolId ); unsigned labelToId( const idLabelPair_t* array, const char* label, unsigned eolId );
@ -182,7 +185,7 @@ namespace cw
template< typename T > template< typename T >
bool is_even( const T& t ) bool is_even( const T& t )
{ {
assert( is_integral(t) ); //assert( std::is_integral<T>(t) );
return (t % 2) == 0; return (t % 2) == 0;
} }