• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision354 (tree)
Zeit2020-10-26 19:12:24
Autorquiret

Log Message

- added EIR_VALCMP/EIR_VALCMP_LT helpers for comparison functions (to save typing)
- bugfix for signed number parsing

Ändern Zusammenfassung

Diff

--- common/sdk/NumericFormat.h (revision 353)
+++ common/sdk/NumericFormat.h (revision 354)
@@ -402,13 +402,16 @@
402402
403403 if constexpr ( std::is_signed <numberType>::value )
404404 {
405- ucp_t ucp = iter.Resolve();
406-
407- if ( ucp == GetMinusSignCodepoint <ucp_t, exceptMan> () )
405+ if ( !iter.IsEnd() )
408406 {
409- isSigned = true;
407+ ucp_t ucp = iter.Resolve();
410408
411- iter.Increment();
409+ if ( ucp == GetMinusSignCodepoint <ucp_t, exceptMan> () )
410+ {
411+ isSigned = true;
412+
413+ iter.Increment();
414+ }
412415 }
413416 }
414417
--- common/sdk/eirutils.h (revision 353)
+++ common/sdk/eirutils.h (revision 354)
@@ -60,6 +60,23 @@
6060
6161 return eCompResult::EQUAL;
6262 }
63+
64+#define EIR_VALCMP( left, right ) \
65+ { \
66+ auto cmpRes = eir::DefaultValueCompare( left, right ); \
67+ if ( cmpRes != eir::eCompResult::EQUAL ) \
68+ { \
69+ return cmpRes; \
70+ } \
71+ }
72+#define EIR_VALCMP_LT( _cmpVal ) \
73+ { \
74+ eir::eCompResult cmpVal = _cmpVal; \
75+ if ( cmpVal != eir::eCompResult::EQUAL ) \
76+ { \
77+ return ( cmpVal == eir::eCompResult::LEFT_LESS ); \
78+ } \
79+ }
6380
6481 // Basic function.
6582 template <typename leftType, typename rightType>
Show on old repository browser