mirror of
https://github.com/louisrubet/rpn
synced 2025-01-16 03:41:28 +01:00
#64: removed useless members
This commit is contained in:
parent
669fd212c8
commit
5b921811a9
3 changed files with 12 additions and 13 deletions
|
@ -462,7 +462,7 @@ static ret_value parse(const char* entry, program& prog)
|
|||
// remaining_entry is used only in case of concatenated entry
|
||||
// ex: entry="1 2+" -> vector<string> = {"1", "2+"} -> first "1", second "2" and remaining_entry="+"
|
||||
// this remaining entry is treated as an entry
|
||||
|
||||
|
||||
// TODO errors ?
|
||||
_obj_from_string(main_entry, prog, remaining_entry);
|
||||
main_entry = remaining_entry;
|
||||
|
|
|
@ -59,15 +59,17 @@ void help()
|
|||
|
||||
void std()
|
||||
{
|
||||
int precision = -1;
|
||||
|
||||
if (stack_size()>=1)
|
||||
{
|
||||
ARG_MUST_BE_OF_TYPE(0, cmd_number);
|
||||
|
||||
int precision = int(((number*)_stack->pop_back())->_value);
|
||||
number::s_default_precision = int(precision);
|
||||
precision = int(((number*)_stack->pop_back())->_value);
|
||||
}
|
||||
|
||||
number::s_current_precision = number::s_default_precision;
|
||||
if (precision != -1)
|
||||
number::s_current_precision = precision;
|
||||
number::s_mode = number::std;
|
||||
|
||||
// format for mpfr_printf
|
||||
|
|
15
src/rpn.cpp
15
src/rpn.cpp
|
@ -39,7 +39,8 @@ extern "C" {
|
|||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
// default number of printed digits
|
||||
// default mode and number of printed digits
|
||||
#define DEFAULT_MODE number::std
|
||||
#define DEFAULT_PRECISION 20
|
||||
|
||||
// MPFR related constants
|
||||
|
@ -219,7 +220,6 @@ struct number : public object
|
|||
fix,
|
||||
sci
|
||||
} mode_enum;
|
||||
static mode_enum s_default_mode;
|
||||
static mode_enum s_mode;
|
||||
|
||||
enum {
|
||||
|
@ -229,14 +229,11 @@ struct number : public object
|
|||
} _representation;
|
||||
|
||||
// precision
|
||||
static int s_default_precision;
|
||||
static int s_current_precision;
|
||||
};
|
||||
|
||||
number::mode_enum number::s_default_mode = number::std;
|
||||
number::mode_enum number::s_mode = number::s_default_mode;
|
||||
int number::s_default_precision = DEFAULT_PRECISION;
|
||||
int number::s_current_precision = number::s_default_precision;
|
||||
number::mode_enum number::s_mode = DEFAULT_MODE;
|
||||
int number::s_current_precision = DEFAULT_PRECISION;
|
||||
|
||||
struct ostring : public object
|
||||
{
|
||||
|
@ -788,8 +785,8 @@ public:
|
|||
static void apply_default()
|
||||
{
|
||||
//default float precision, float mode, verbosity
|
||||
number::s_mode = number::s_default_mode;
|
||||
number::s_current_precision = number::s_default_precision;
|
||||
number::s_mode = DEFAULT_MODE;
|
||||
number::s_current_precision = DEFAULT_PRECISION;
|
||||
|
||||
// format for mpfr_printf
|
||||
stringstream ss;
|
||||
|
|
Loading…
Reference in a new issue