[gcalctool] Rename T_DIVIDE to T_DIV
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Rename T_DIVIDE to T_DIV
- Date: Tue, 21 Aug 2012 20:59:21 +0000 (UTC)
commit 7778af24847d03a2122b9fd7426dfa9f965ae25f
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date: Tue Aug 21 15:55:04 2012 +0200
Rename T_DIVIDE to T_DIV
T_DIVIDE is already defined by *BSD as an "integer divide fault" trap type value.
src/lexer.c | 2 +-
src/parser.c | 6 +++---
src/prelexer.c | 2 +-
src/prelexer.h | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/lexer.c b/src/lexer.c
index 9f6f9ab..176c773 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -94,7 +94,7 @@ l_insert_next_token(LexerState* lstate)
||type == T_ADD
||type == T_SUBTRACT
||type == T_MULTIPLY
- ||type == T_DIVIDE
+ ||type == T_DIV
||type == T_L_FLOOR
||type == T_R_FLOOR
||type == T_L_CEILING
diff --git a/src/parser.c b/src/parser.c
index 497f148..fb4fd12 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -19,7 +19,7 @@ p_get_precedence(LexerTokenType type)
return P_Multiply;
if(type == T_MOD)
return P_Mod;
- if(type == T_DIVIDE)
+ if(type == T_DIV)
return P_Divide;
if(type == T_NOT)
return P_Not;
@@ -934,9 +934,9 @@ expression_2(ParserState* state)
return 0;
return 1;
}
- else if(token->token_type == T_DIVIDE)
+ else if(token->token_type == T_DIV)
{
- /* expression T_DIVIDE expression */
+ /* expression T_DIV expression */
node = p_create_node(state, token, p_make_precedence_t(state, token->token_type), p_get_associativity(token), NULL, pf_do_divide);
p_insert_into_tree(state, node);
diff --git a/src/prelexer.c b/src/prelexer.c
index 723b190..225d499 100644
--- a/src/prelexer.c
+++ b/src/prelexer.c
@@ -146,7 +146,7 @@ pl_get_next_token(PreLexerState* state)
return T_MULTIPLY;
if(pl_compare_all(ch, 3, (gchar*[]){"/","â","Ã"}))
- return T_DIVIDE;
+ return T_DIV;
if(pl_compare_all(ch, 1, (gchar*[]){"â"}))
return T_L_FLOOR;
diff --git a/src/prelexer.h b/src/prelexer.h
index b27998f..4dd21e9 100644
--- a/src/prelexer.h
+++ b/src/prelexer.h
@@ -36,7 +36,7 @@ typedef enum
T_ADD, //Plus
T_SUBTRACT, //Minus
T_MULTIPLY, //Multiply
- T_DIVIDE, //Divide
+ T_DIV, //Divide
T_MOD, //Modulus
T_L_FLOOR, //Floor ( Left )
T_R_FLOOR, //20 //Floor ( Right )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]