aboutsummaryrefslogtreecommitdiffstats
path: root/main/ast_expr2.fl
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-03 20:17:31 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-03 20:17:31 +0000
commit3a37070093275603ff3c797c2ca426f6d52b6fe2 (patch)
tree54ccd89a92a427e6ca4d727612181f40eb82ffc2 /main/ast_expr2.fl
parent9982b145f400fd20c6dffa27529a75b4af67adec (diff)
Removing expr floating patch from 1.4; too much of a behavior change. If you want this fix, try trunk instead. bug 9508.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@73143 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/ast_expr2.fl')
-rw-r--r--main/ast_expr2.fl31
1 files changed, 7 insertions, 24 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl
index 49c051bd9..5990a66ed 100644
--- a/main/ast_expr2.fl
+++ b/main/ast_expr2.fl
@@ -24,29 +24,12 @@
#include "asterisk.h"
-#include <sys/types.h>
-#include <stdio.h>
-
#ifndef STANDALONE
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#else
-#ifndef __USE_ISOC99
-#define __USE_ISOC99 1
-#endif
-#endif
-
-#ifdef __USE_ISOC99
-#define FP___PRINTF "%.16Lg"
-#define FP___FMOD fmodl
-#define FP___STRTOD strtold
-#define FP___TYPE long double
-#else
-#define FP___PRINTF "%.8g"
-#define FP___FMOD fmod
-#define FP___STRTOD strtod
-#define FP___TYPE double
#endif
+#include <sys/types.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
@@ -65,14 +48,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/strings.h"
enum valtype {
- AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string
+ AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string
} ;
struct val {
enum valtype type;
union {
char *s;
- FP___TYPE i; /* long double or just double if it's a bad day */
+ quad_t i;
} u;
} ;
@@ -157,7 +140,7 @@ static char *expr2_token_subst(char *mess);
\"[^"]*\" {SET_COLUMNS; SET_STRING; return TOKEN;}
[\n] {/* what to do with eol */}
-[0-9]+(\.[0-9]+)? {
+[0-9]+ {
SET_COLUMNS;
/* the original behavior of the expression parser was
* to bring in numbers as a numeric string
@@ -252,10 +235,10 @@ int ast_expr(char *expr, char *buf, int length)
return_value = 1;
}
} else {
- if (io.val->type == AST_EXPR_number) {
+ if (io.val->type == AST_EXPR_integer) {
int res_length;
- res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
+ res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
return_value = (res_length <= length) ? res_length : length;
} else {
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)