Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 2830 sonarqube enum #2849

Merged
merged 29 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be3ce26
#2830 Changed enum Builtin to enum class
Mar 19, 2024
0153110
#2830 Converted enum to enum class at config_constants.h
Mar 19, 2024
0a771d4
Feature #2830 bootstrap enum (#2843)
JohnHalleyGotway Mar 23, 2024
1c97607
#2830 Changed enum PadSize to enum class
Mar 27, 2024
40b67d4
#2830 Removed redundant parantheses
Mar 27, 2024
79f81af
#2830 Removed commenyted out code
Mar 27, 2024
cef8aad
Merge remote-tracking branch 'origin/develop' into feature_2830_sonar…
Mar 27, 2024
8cc667c
#2830 Use auto
Mar 27, 2024
d6cba7d
#2830 Changed enum to enum class for DistType, InterpMthd, GridTempla…
Mar 28, 2024
15987a1
#2830 Moved enum_class_as_integer from header file to cc files
Mar 28, 2024
8a277fa
#2830 Added enum_as_int.hpp
Apr 1, 2024
fa41fa3
#2830 Added enum_as_int.hpp
Apr 1, 2024
5c95525
Deleted enum_class_as_integer and renamed it to enum_class_as_int
Apr 1, 2024
62acda7
Removed redundant paranthese
Apr 1, 2024
6ac387f
#2830 Changed enum to enumclass
Apr 1, 2024
175f4ed
#2830 Changed enum_class_as_integer to enum_class_as_int
Apr 1, 2024
2bef141
#2830 Changed enum STATJobType to enum class
Apr 3, 2024
9e0cd6d
#2830 Changed STATLineType to enum class
Apr 5, 2024
8fad8f2
#2830 Changed Action to enum class
Apr 5, 2024
6d8a3c7
#2830 Changed ModeDataType to enum class
Apr 5, 2024
df25b86
#2830 Changed StepCase to enum class
Apr 5, 2024
1f1d525
#2830 Changed enum to enum class
Apr 5, 2024
aebdd2a
#2830 Changed GenesisPairCategory to enum class
Apr 5, 2024
00380dc
#2830 Removed rediundabt parenrthese
Apr 5, 2024
42c453e
#2830 Reduced same if checking
Apr 5, 2024
2bd5dcf
#2830 Cleanup
Apr 5, 2024
1f32746
#2830 USe empty() instead of lebgth checking
Apr 5, 2024
0811740
#2830 Adjusted indentations
Apr 5, 2024
78f1824
Merge remote-tracking branch 'origin/develop' into feature_2830_sonar…
JohnHalleyGotway Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions src/basic/vx_config/builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,54 +75,54 @@ static double my_C_to_F (double);

const BuiltinInfo binfo[] = {

{ "sin", 1, builtin_sin, nullptr, nullptr, sin, nullptr },
{ "cos", 1, builtin_cos, nullptr, nullptr, cos, nullptr },
{ "tan", 1, builtin_tan, nullptr, nullptr, tan, nullptr },
{ "sin", 1, Builtin::sin, nullptr, nullptr, sin, nullptr },
{ "cos", 1, Builtin::cos, nullptr, nullptr, cos, nullptr },
{ "tan", 1, Builtin::tan, nullptr, nullptr, tan, nullptr },

{ "sind", 1, builtin_sind, nullptr, nullptr, sin_deg, nullptr },
{ "cosd", 1, builtin_cosd, nullptr, nullptr, cos_deg, nullptr },
{ "tand", 1, builtin_tand, nullptr, nullptr, tan_deg, nullptr },
{ "sind", 1, Builtin::sind, nullptr, nullptr, sin_deg, nullptr },
{ "cosd", 1, Builtin::cosd, nullptr, nullptr, cos_deg, nullptr },
{ "tand", 1, Builtin::tand, nullptr, nullptr, tan_deg, nullptr },

{ "asin", 1, builtin_asin, nullptr, nullptr, asin, nullptr },
{ "acos", 1, builtin_acos, nullptr, nullptr, acos, nullptr },
{ "atan", 1, builtin_atan, nullptr, nullptr, atan, nullptr },
{ "asin", 1, Builtin::asin, nullptr, nullptr, asin, nullptr },
{ "acos", 1, Builtin::acos, nullptr, nullptr, acos, nullptr },
{ "atan", 1, Builtin::atan, nullptr, nullptr, atan, nullptr },

{ "asind", 1, builtin_sind, nullptr, nullptr, arc_sin_deg, nullptr },
{ "acosd", 1, builtin_cosd, nullptr, nullptr, arc_cos_deg, nullptr },
{ "atand", 1, builtin_tand, nullptr, nullptr, arc_tan_deg, nullptr },
{ "asind", 1, Builtin::sind, nullptr, nullptr, arc_sin_deg, nullptr },
{ "acosd", 1, Builtin::cosd, nullptr, nullptr, arc_cos_deg, nullptr },
{ "atand", 1, Builtin::tand, nullptr, nullptr, arc_tan_deg, nullptr },

{ "atan2", 2, builtin_atan2, nullptr, nullptr, nullptr, atan2 },
{ "atan2d", 2, builtin_atan2d, nullptr, nullptr, nullptr, atan2_deg },
{ "atan2", 2, Builtin::atan2, nullptr, nullptr, nullptr, atan2 },
{ "atan2d", 2, Builtin::atan2d, nullptr, nullptr, nullptr, atan2_deg },

{ "arg", 2, builtin_arg, nullptr, nullptr, nullptr, my_arg },
{ "argd", 2, builtin_argd, nullptr, nullptr, nullptr, my_arg_deg },
{ "arg", 2, Builtin::arg, nullptr, nullptr, nullptr, my_arg },
{ "argd", 2, Builtin::argd, nullptr, nullptr, nullptr, my_arg_deg },

{ "log", 1, builtin_log, nullptr, nullptr, log, nullptr },
{ "exp", 1, builtin_exp, nullptr, nullptr, exp, nullptr },
{ "log", 1, Builtin::log, nullptr, nullptr, log, nullptr },
{ "exp", 1, Builtin::exp, nullptr, nullptr, exp, nullptr },

{ "log10", 1, builtin_log10, nullptr, nullptr, log10, nullptr },
{ "exp10", 1, builtin_exp10, nullptr, nullptr, my_exp10, nullptr },
{ "log10", 1, Builtin::log10, nullptr, nullptr, log10, nullptr },
{ "exp10", 1, Builtin::exp10, nullptr, nullptr, my_exp10, nullptr },

{ "sqrt", 1, builtin_sqrt, nullptr, nullptr, sqrt, nullptr },
{ "sqrt", 1, Builtin::sqrt, nullptr, nullptr, sqrt, nullptr },

{ "abs", 1, builtin_abs, abs, nullptr, fabs, nullptr },
{ "abs", 1, Builtin::abs, abs, nullptr, fabs, nullptr },

{ "min", 2, builtin_min, nullptr, my_imin, nullptr, my_dmin },
{ "max", 2, builtin_max, nullptr, my_imax, nullptr, my_dmax },
{ "min", 2, Builtin::min, nullptr, my_imin, nullptr, my_dmin },
{ "max", 2, Builtin::max, nullptr, my_imax, nullptr, my_dmax },

{ "mod", 2, builtin_mod, nullptr, my_imod, nullptr, my_dmod },
{ "mod", 2, Builtin::mod, nullptr, my_imod, nullptr, my_dmod },

{ "floor", 1, builtin_floor, nullptr, nullptr, floor, nullptr },
{ "ceil", 1, builtin_ceil, nullptr, nullptr, ceil, nullptr },
{ "floor", 1, Builtin::floor, nullptr, nullptr, floor, nullptr },
{ "ceil", 1, Builtin::ceil, nullptr, nullptr, ceil, nullptr },

{ "step", 1, builtin_step, my_istep, nullptr, my_dstep, nullptr },
{ "step", 1, Builtin::step, my_istep, nullptr, my_dstep, nullptr },

// Functions defined in ConfigConstants
// { "F_to_C", 1, builtin_F_to_C, nullptr, nullptr, my_F_to_C, nullptr },
// { "C_to_F", 1, builtin_C_to_F, nullptr, nullptr, my_C_to_F, nullptr },
// { "F_to_C", 1, Builtin::F_to_C, nullptr, nullptr, my_F_to_C, nullptr },
// { "C_to_F", 1, Builtin::C_to_F, nullptr, nullptr, my_C_to_F, nullptr },

{ "nint", 1, builtin_nint, nullptr, nullptr, nullptr, nullptr },
{ "sign", 1, builtin_sign, nullptr, nullptr, nullptr, nullptr },
{ "nint", 1, Builtin::nint, nullptr, nullptr, nullptr, nullptr },
{ "sign", 1, Builtin::sign, nullptr, nullptr, nullptr, nullptr },


//
Expand Down
68 changes: 34 additions & 34 deletions src/basic/vx_config/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,69 +30,69 @@ static const int max_builtin_args = 2;
////////////////////////////////////////////////////////////////////////


enum Builtin {
enum class Builtin {


//
// built-in functions of one variable
//

builtin_sin,
builtin_cos,
builtin_tan,
sin,
cos,
tan,

builtin_sind,
builtin_cosd,
builtin_tand,
sind,
cosd,
tand,

builtin_asin,
builtin_acos,
builtin_atan,
asin,
acos,
atan,

builtin_asind,
builtin_acosd,
builtin_atand,
asind,
acosd,
atand,

builtin_log,
builtin_exp,
log,
exp,

builtin_log10,
builtin_exp10,
log10,
exp10,

builtin_sqrt,
builtin_abs,
builtin_floor,
builtin_ceil,
builtin_nint,
builtin_sign,
sqrt,
abs,
floor,
ceil,
nint,
sign,

builtin_step,
step,

// Functions defined in ConfigConstants
// builtin_F_to_C,
// builtin_C_to_F,
// F_to_C,
// C_to_F,


//
// built-in functions of two variables
//

builtin_atan2,
builtin_atan2d,
atan2,
atan2d,

builtin_arg,
builtin_argd,
arg,
argd,

builtin_min,
builtin_max,
min,
max,

builtin_mod,
mod,

//
// built-in functions of three variables
//

// builtin_ifte
// ifte

//
// flag value
Expand Down
4 changes: 2 additions & 2 deletions src/basic/vx_config/calculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ const BuiltinInfo & info = binfo[which];
// nint and sign are treated differently
//

if ( info.id == builtin_nint ) { do_nint(); return; }
if ( info.id == Builtin::nint ) { do_nint(); return; }

if ( info.id == builtin_sign ) { do_sign(); return; }
if ( info.id == Builtin::sign ) { do_sign(); return; }

//
//
Expand Down
Loading
Loading