summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_logic.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-01-14 17:25:20 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-01-14 17:25:20 +0000
commit53ff4acbf341b20b772bdd87d06fed30e0d1b28a (patch)
treeaf2481bf55255c92f40254b6350cf43847ffa3dd /plugins/Variables/src/parse_logic.cpp
parent127744a38a4bad16aa1cbf20c3824345a9644c5a (diff)
minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@7647 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/src/parse_logic.cpp')
-rw-r--r--plugins/Variables/src/parse_logic.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp
index 211ef15e94..ea14e89660 100644
--- a/plugins/Variables/src/parse_logic.cpp
+++ b/plugins/Variables/src/parse_logic.cpp
@@ -271,10 +271,7 @@ static TCHAR *parseOr(ARGUMENTSINFO *ai)
static TCHAR *parseTrue(ARGUMENTSINFO *ai)
{
- if (ai->argc != 1)
- return NULL;
-
- return mir_tstrdup(_T(""));
+ return (ai->argc != 1) ? NULL : mir_tstrdup(_T(""));
}
static TCHAR *parseXor(ARGUMENTSINFO *ai)
@@ -297,23 +294,22 @@ static TCHAR *parseXor(ARGUMENTSINFO *ai)
return mir_tstrdup(_T(""));
}
-int registerLogicTokens()
+void registerLogicTokens()
{
- registerIntToken(_T(AND), parseAnd, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y, ...)\t"LPGEN("performs logical AND (x && y && ...)"));
- registerIntToken(_T(STR_FALSE), parseFalse, TRF_FIELD, LPGEN("Logical Expressions")"\t"LPGEN("Boolean FALSE"));
- registerIntToken(_T(FOR), parseFor, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("performs w, then shows z and performs y while x is TRUE"));
- registerIntToken(_T(IF), parseIf, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y,z)\t"LPGEN("shows y if x is TRUE, otherwise it shows z"));
- registerIntToken(_T(IF2), parseIf2, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("shows x if x is TRUE, otherwise it shows y (if(x,x,y))"));
- registerIntToken(_T(IF3), parseIf3, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y, ...)\t"LPGEN("the first argument parsed successfully"));
- registerIntToken(_T(IFEQUAL), parseIfequal, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if w = x, else z"));
- registerIntToken(_T(IFGREATER), parseIfgreater, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if w > x, else z"));
- registerIntToken(_T(IFLONGER), parseIflonger, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if string length of w > x, else z"));
- registerIntToken(_T(EQUAL), parseEqual, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x = y"));
- registerIntToken(_T(GREATER), parseGreater, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x > y"));
- registerIntToken(_T(LONGER), parseLonger, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x is longer than y"));
- registerIntToken(_T(NOT), parseNot, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x)\t"LPGEN("performs logical NOT (!x)"));
- registerIntToken(_T(OR), parseOr, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y,...)\t"LPGEN("performs logical OR (x || y || ...)"));
- registerIntToken(_T(STR_TRUE), parseTrue, TRF_FIELD, LPGEN("Logical Expressions")"\t"LPGEN("Boolean TRUE"));
- registerIntToken(_T(XOR), parseXor, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("performs logical XOR (x ^ y)"));
- return 0;
+ registerIntToken(AND, parseAnd, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y, ...)\t"LPGEN("performs logical AND (x && y && ...)"));
+ registerIntToken(STR_FALSE, parseFalse, TRF_FIELD, LPGEN("Logical Expressions")"\t"LPGEN("Boolean FALSE"));
+ registerIntToken(FOR, parseFor, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("performs w, then shows z and performs y while x is TRUE"));
+ registerIntToken(IF, parseIf, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y,z)\t"LPGEN("shows y if x is TRUE, otherwise it shows z"));
+ registerIntToken(IF2, parseIf2, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("shows x if x is TRUE, otherwise it shows y (if(x,x,y))"));
+ registerIntToken(IF3, parseIf3, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y, ...)\t"LPGEN("the first argument parsed successfully"));
+ registerIntToken(IFEQUAL, parseIfequal, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if w = x, else z"));
+ registerIntToken(IFGREATER, parseIfgreater, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if w > x, else z"));
+ registerIntToken(IFLONGER, parseIflonger, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(w,x,y,z)\t"LPGEN("y if string length of w > x, else z"));
+ registerIntToken(EQUAL, parseEqual, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x = y"));
+ registerIntToken(GREATER, parseGreater, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x > y"));
+ registerIntToken(LONGER, parseLonger, TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("TRUE if x is longer than y"));
+ registerIntToken(NOT, parseNot, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x)\t"LPGEN("performs logical NOT (!x)"));
+ registerIntToken(OR, parseOr, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y,...)\t"LPGEN("performs logical OR (x || y || ...)"));
+ registerIntToken(STR_TRUE, parseTrue, TRF_FIELD, LPGEN("Logical Expressions")"\t"LPGEN("Boolean TRUE"));
+ registerIntToken(XOR, parseXor, TRF_UNPARSEDARGS | TRF_FUNCTION, LPGEN("Logical Expressions")"\t(x,y)\t"LPGEN("performs logical XOR (x ^ y)"));
}