Skip to content
Snippets Groups Projects
Commit 614eaea7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

prefix all the xmath functions with "x_" : some of these are defined
in the new C++ math lib with the same names
parent 07047d67
Branches
Tags
No related merge requests found
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/* A lexical scanner generated by flex */ /* A lexical scanner generated by flex */
/* Scanner skeleton version: /* Scanner skeleton version:
* $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.1 2004-05-12 02:02:21 geuzaine Exp $ * $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.2 2004-05-12 18:14:20 geuzaine Exp $
*/ */
#define FLEX_SCANNER #define FLEX_SCANNER
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
...@@ -41,7 +42,6 @@ ...@@ -41,7 +42,6 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
/* Use prototypes in function declarations. */ /* Use prototypes in function declarations. */
#define YY_USE_PROTOS #define YY_USE_PROTOS
...@@ -616,7 +616,7 @@ YY_MALLOC_DECL ...@@ -616,7 +616,7 @@ YY_MALLOC_DECL
YY_DECL YY_DECL
{ {
register yy_state_type yy_current_state; register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp; register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act; register int yy_act;
#line 50 "scanner.l" #line 50 "scanner.l"
...@@ -1182,6 +1182,7 @@ register char *yy_bp; ...@@ -1182,6 +1182,7 @@ register char *yy_bp;
#endif /* ifndef YY_NO_UNPUT */ #endif /* ifndef YY_NO_UNPUT */
#ifndef YY_NO_INPUT
#ifdef __cplusplus #ifdef __cplusplus
static int yyinput() static int yyinput()
#else #else
...@@ -1253,7 +1254,7 @@ static int input() ...@@ -1253,7 +1254,7 @@ static int input()
return c; return c;
} }
#endif /* YY_NO_INPUT */
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file ) void yyrestart( FILE *input_file )
...@@ -1364,11 +1365,6 @@ YY_BUFFER_STATE b; ...@@ -1364,11 +1365,6 @@ YY_BUFFER_STATE b;
} }
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
......
...@@ -43,9 +43,10 @@ symbol_table_create(int length) ...@@ -43,9 +43,10 @@ symbol_table_create(int length)
static char *names[] = {"Exp", "Log", "Sqrt", "Sin", "Cos", "Tan", "Ctan", static char *names[] = {"Exp", "Log", "Sqrt", "Sin", "Cos", "Tan", "Ctan",
"Asin", "Acos", "Atan", "Actan", "Sinh", "Cosh", "Tanh", "Asin", "Acos", "Atan", "Actan", "Sinh", "Cosh", "Tanh",
"Ctanh", "Asinh", "Acosh", "Atanh", "Actanh", "Fabs" }; "Ctanh", "Asinh", "Acosh", "Atanh", "Actanh", "Fabs" };
static double (*functions[]) (double) = { exp, log, sqrt, sin, cos, tan, ctan, static double (*functions[]) (double) = { exp, log, sqrt, sin, cos, tan, x_ctan,
asin, acos, atan, actan, sinh, cosh, tanh, asin, acos, atan, x_actan, sinh, cosh, tanh,
ctanh, asinh, acosh, atanh, actanh, fabs}; x_ctanh, x_asinh, x_acosh, x_atanh, x_actanh,
fabs};
unsigned int i; unsigned int i;
/* /*
......
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
/* This file was modified for inclusion in Gmsh */ /* This file was modified for inclusion in Gmsh */
#include "xmath.h" #include "xmath.h"
#include <math.h>
double double
ctan(double x) x_ctan(double x)
{ {
/* /*
* Calculate cotangent value. * Calculate cotangent value.
...@@ -32,7 +33,7 @@ ctan(double x) ...@@ -32,7 +33,7 @@ ctan(double x)
} }
double double
actan(double x) x_actan(double x)
{ {
/* /*
* Calculate inverse cotangent value. * Calculate inverse cotangent value.
...@@ -41,7 +42,7 @@ actan(double x) ...@@ -41,7 +42,7 @@ actan(double x)
} }
double double
ctanh(double x) x_ctanh(double x)
{ {
/* /*
* Calculate hyperbolic cotangent value. * Calculate hyperbolic cotangent value.
...@@ -50,7 +51,7 @@ ctanh(double x) ...@@ -50,7 +51,7 @@ ctanh(double x)
} }
double double
asinh(double x) x_asinh(double x)
{ {
/* /*
* Calculate inverse hyperbolic sine value using relation between * Calculate inverse hyperbolic sine value using relation between
...@@ -60,7 +61,7 @@ asinh(double x) ...@@ -60,7 +61,7 @@ asinh(double x)
} }
double double
acosh(double x) x_acosh(double x)
{ {
/* /*
* Calculate inverse hyperbolic cosine value using relation between * Calculate inverse hyperbolic cosine value using relation between
...@@ -70,7 +71,7 @@ acosh(double x) ...@@ -70,7 +71,7 @@ acosh(double x)
} }
double double
atanh(double x) x_atanh(double x)
{ {
/* /*
* Calculate inverse hyperbolic tangent value using relation between * Calculate inverse hyperbolic tangent value using relation between
...@@ -80,7 +81,7 @@ atanh(double x) ...@@ -80,7 +81,7 @@ atanh(double x)
} }
double double
actanh(double x) x_actanh(double x)
{ {
/* /*
* Calculate inverse hyperbolic cotangent value. * Calculate inverse hyperbolic cotangent value.
......
...@@ -23,27 +23,12 @@ ...@@ -23,27 +23,12 @@
#ifndef XMATH_H #ifndef XMATH_H
#define XMATH_H #define XMATH_H
#include <math.h> double x_ctan(double x);
double x_actan(double x);
/* Calculate cotangent of value x. */ double x_ctanh(double x);
double ctan(double x); double x_asinh(double x);
double x_acosh(double x);
/* Calculate inverse cotangent of value x. */ double x_atanh(double x);
double actan(double x); double x_actanh(double x);
/* Calculate hyperbolical cotangent of value x. */
double ctanh(double x);
/* Calculate inverse hyperbolical sine of value x. */
double asinh(double x);
/* Calculate inverse hyperbolical cosine of value x. */
double acosh(double x);
/* Calculate inverse hyperbolical tangent of value x. */
double atanh(double x);
/* Calculate inverse hyperbolical cotangent of value x. */
double actanh(double x);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment