From 8a6ce53429cdb8d75cfe8ac514dfee6a5a130083 Mon Sep 17 00:00:00 2001 From: "D. Mitch Bailey" Date: Mon, 8 May 2023 02:30:49 -0700 Subject: [PATCH] Version 1.1.5 Allow 'k' as SI suffix for 1000. --- README.md | 4 ++-- configure.ac | 2 +- src/CNormalValue.cc | 1 + src/Cvc.hh | 2 +- src/CvcTypes.hh | 1 + src/utility.cc | 2 +- src/utility.h | 8 ++++---- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b30af9c..0311992 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ Requirements: - python 2.7.10 The following are only required if making changes to the parser or compiling from github -- bison 3.3 -- automake 1.14.1 +- bison 3.3.2 +- automake 1.16.1 GUI requirements: - kivy 1.10.0 diff --git a/configure.ac b/configure.ac index a6b48fc..e004855 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT(CVC_RV, [1.1.4], [cvc@shuharisystem.com]) +AC_INIT(CVC_RV, [1.1.5], [cvc@shuharisystem.com]) AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADERS([config.h]) AC_USE_SYSTEM_EXTENSIONS diff --git a/src/CNormalValue.cc b/src/CNormalValue.cc index 4beb5a7..1e82739 100755 --- a/src/CNormalValue.cc +++ b/src/CNormalValue.cc @@ -33,6 +33,7 @@ CNormalValue::CNormalValue(string theStringValue) { case 'G': { myRealValue *= pow(10, 9); break; } case 'M': { myRealValue *= pow(10, 6); break; } case 'K': { myRealValue *= pow(10, 3); break; } + case 'k': { myRealValue *= pow(10, 3); break; } case 'm': { myRealValue *= pow(10, -3); break; } case 'u': { myRealValue *= pow(10, -6); break; } case 'n': { myRealValue *= pow(10, -9); break; } diff --git a/src/Cvc.hh b/src/Cvc.hh index bedbfb5..9637ae7 100755 --- a/src/Cvc.hh +++ b/src/Cvc.hh @@ -24,7 +24,7 @@ #ifndef CVC_H_ #define CVC_H_ -#define CVC_VERSION "1.1.4" +#define CVC_VERSION "1.1.5" extern bool gDebug_cvc; extern bool gSetup_cvc; diff --git a/src/CvcTypes.hh b/src/CvcTypes.hh index 2938629..dec6270 100755 --- a/src/CvcTypes.hh +++ b/src/CvcTypes.hh @@ -95,6 +95,7 @@ template T from_string(std::string const & s) { {"n", 1e-9}, {"u", 1e-6}, {"m", 1e-3}, + {"k", 1e3}, {"K", 1e3}, {"M", 1e6}, {"G", 1e9}, diff --git a/src/utility.cc b/src/utility.cc index f2e413f..2422bcf 100755 --- a/src/utility.cc +++ b/src/utility.cc @@ -62,7 +62,7 @@ std::string PrintToleranceParameter(std::string definition, int parameter, int s std::string AddSiSuffix(float theValue) { char myFormattedString[64]; - const string myBigSuffix = "KMGTPE"; + const string myBigSuffix = "kMGTPE"; const string mySmallSuffix = "munpfa"; int myIndex = 0; while ( abs(theValue) > 1000 && myIndex < 6 ) { diff --git a/src/utility.h b/src/utility.h index b6f7069..0fd3c17 100755 --- a/src/utility.h +++ b/src/utility.h @@ -48,10 +48,10 @@ std::string int_to_hex( T i ) || sscanf((string).c_str(), "%[-+]%d%1s", &vv_sign, &vv_integer, vv_trailer) == 2 \ || sscanf((string).c_str(), "%d.%d%1s", &vv_integer, &vv_fraction, vv_trailer) == 2 \ || sscanf((string).c_str(), "%d%1s", &vv_integer, vv_trailer) == 1 \ - || sscanf((string).c_str(), "%[-+]%d.%d%1[afpnumKMGTPE]%1s", &vv_sign, &vv_integer, &vv_fraction, vv_suffix, vv_trailer) == 4 \ - || sscanf((string).c_str(), "%[-+]%d%1[afpnumKMGTPE]%1s", &vv_sign, &vv_integer, vv_suffix, vv_trailer) == 3 \ - || sscanf((string).c_str(), "%d.%d%1[afpnumKMGTPE]%1s", &vv_integer, &vv_fraction, vv_suffix, vv_trailer) == 3 \ - || sscanf((string).c_str(), "%d%1[afpnumKMGTPE]%1s", &vv_integer, vv_suffix, vv_trailer) == 2 \ + || sscanf((string).c_str(), "%[-+]%d.%d%1[afpnumkKMGTPE]%1s", &vv_sign, &vv_integer, &vv_fraction, vv_suffix, vv_trailer) == 4 \ + || sscanf((string).c_str(), "%[-+]%d%1[afpnumkKMGTPE]%1s", &vv_sign, &vv_integer, vv_suffix, vv_trailer) == 3 \ + || sscanf((string).c_str(), "%d.%d%1[afpnumkKMGTPE]%1s", &vv_integer, &vv_fraction, vv_suffix, vv_trailer) == 3 \ + || sscanf((string).c_str(), "%d%1[afpnumkKMGTPE]%1s", &vv_integer, vv_suffix, vv_trailer) == 2 \ ) char * CurrentTime();