[gcalctool] Remove final links from MP code to gcalctool code
- From: Robert Ancell <rancell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gcalctool] Remove final links from MP code to gcalctool code
- Date: Thu, 13 Aug 2009 00:59:38 +0000 (UTC)
commit 27fd7d1315071bdf1f54b1de2880c909be4596a4
Author: Robert Ancell <robert ancell gmail com>
Date: Thu Aug 13 01:59:08 2009 +0100
Remove final links from MP code to gcalctool code
src/functions.c | 4 ----
src/mp-binary.c | 4 +++-
src/mp-equation-lexer.l | 6 ------
src/mp-equation.h | 1 -
4 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/src/functions.c b/src/functions.c
index 4b00dcf..9dac4ab 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -583,10 +583,6 @@ do_expression(int function, int arg, int cursor_start, int cursor_end)
message = _("Invalid number for the current base");
break;
- case -PARSER_ERR_TOO_LONG_NUMBER:
- message = _("Too long number");
- break;
-
case -PARSER_ERR_BITWISEOP:
/* Translators: Error displayed to user when they
* perform an invalid bitwise operation, e.g.
diff --git a/src/mp-binary.c b/src/mp-binary.c
index 8d609b5..90663fb 100644
--- a/src/mp-binary.c
+++ b/src/mp-binary.c
@@ -1,6 +1,8 @@
#include "mp.h"
#include "mp-internal.h"
-#include "calctool.h" // FIXME: Used for MAX_DIGITS
+
+// FIXME: Make dynamic
+#define MAX_DIGITS 1000
static char digits[] = "0123456789ABCDEF";
diff --git a/src/mp-equation-lexer.l b/src/mp-equation-lexer.l
index 94c14d6..4a84df9 100644
--- a/src/mp-equation-lexer.l
+++ b/src/mp-equation-lexer.l
@@ -31,7 +31,6 @@
#include <string.h>
#include <sys/types.h>
-#include "calctool.h"
#include "mp-equation-private.h"
#include "mp-equation-parser.h"
@@ -133,35 +132,30 @@ NOT "¬"|"~"|[nN][oO][tT]
{DEC_NUM}{EXP}{DEC_NUM} {
if (_mp_equation_get_extra(yyscanner)->options->base == 16) REJECT;
-if (strlen(yytext) > MAX_DIGITS) yyextra->error = -PARSER_ERR_TOO_LONG_NUMBER;
mp_set_from_string(yytext, _mp_equation_get_extra(yyscanner)->options->base, &yylval->int_t);
return tNUMBER;
}
{BIN_NUM} {
if (_mp_equation_get_extra(yyscanner)->options->base != 2) REJECT;
-if (strlen(yytext) > MAX_DIGITS) yyextra->error = -PARSER_ERR_TOO_LONG_NUMBER;
mp_set_from_string(yytext, _mp_equation_get_extra(yyscanner)->options->base, &yylval->int_t);
return tNUMBER;
}
{OCT_NUM} {
if (_mp_equation_get_extra(yyscanner)->options->base != 8) REJECT;
-if (strlen(yytext) > MAX_DIGITS) yyextra->error = -PARSER_ERR_TOO_LONG_NUMBER;
mp_set_from_string(yytext, _mp_equation_get_extra(yyscanner)->options->base, &yylval->int_t);
return tNUMBER;
}
{DEC_NUM} {
if (_mp_equation_get_extra(yyscanner)->options->base != 10) REJECT;
-if (strlen(yytext) > MAX_DIGITS) yyextra->error = -PARSER_ERR_TOO_LONG_NUMBER;
mp_set_from_string(yytext, _mp_equation_get_extra(yyscanner)->options->base, &yylval->int_t);
return tNUMBER;
}
{HEX_NUM} {
if (_mp_equation_get_extra(yyscanner)->options->base != 16) REJECT;
-if (strlen(yytext) > MAX_DIGITS) yyextra->error = -PARSER_ERR_TOO_LONG_NUMBER;
mp_set_from_string(yytext, _mp_equation_get_extra(yyscanner)->options->base, &yylval->int_t);
return tNUMBER;
}
diff --git a/src/mp-equation.h b/src/mp-equation.h
index 4895f09..61d008b 100644
--- a/src/mp-equation.h
+++ b/src/mp-equation.h
@@ -26,7 +26,6 @@
#include "mp.h"
#define PARSER_ERR_INVALID 1
-#define PARSER_ERR_TOO_LONG_NUMBER 2
#define PARSER_ERR_BITWISEOP 3
#define PARSER_ERR_MODULUSOP 4
#define PARSER_ERR_OVERFLOW 5
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]