summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2013-09-05 18:15:36 (GMT)
committerjoye <joye>2013-09-05 18:15:36 (GMT)
commitdb9a77f7616abf01af1e05b8ab68bc4865151743 (patch)
treeb6b048e52d69c488da4a20adcfa6461db640b955
parentecdc9c8a4528f2d2421f9a9b4044c74c83eff96b (diff)
downloadblt-db9a77f7616abf01af1e05b8ab68bc4865151743.zip
blt-db9a77f7616abf01af1e05b8ab68bc4865151743.tar.gz
blt-db9a77f7616abf01af1e05b8ab68bc4865151743.tar.bz2
*** empty log message ***
-rw-r--r--src/bltGrAxis.C24
-rw-r--r--src/bltInt.C27
-rw-r--r--src/bltVector.C10
3 files changed, 19 insertions, 42 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C
index c55b00f..2a4a268 100644
--- a/src/bltGrAxis.C
+++ b/src/bltGrAxis.C
@@ -26,6 +26,8 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <math.h>
+
#include "bltGraph.h"
#include "bltOp.h"
#include "bltGrElem.h"
@@ -663,7 +665,7 @@ ObjToLimitProc(
string = Tcl_GetString(objPtr);
if (string[0] == '\0') {
- *limitPtr = Blt_NaN();
+ *limitPtr = NAN;
} else if (Blt_ExprDoubleFromObj(interp, objPtr, limitPtr) != TCL_OK) {
return TCL_ERROR;
}
@@ -1333,14 +1335,14 @@ FixAxisRange(Axis *axisPtr)
* than -max, or have undefined log scale limits. */
if (((isnormal(axisPtr->reqMin)) && (isnormal(axisPtr->reqMax))) &&
(axisPtr->reqMin >= axisPtr->reqMax)) {
- axisPtr->reqMin = axisPtr->reqMax = Blt_NaN();
+ axisPtr->reqMin = axisPtr->reqMax = NAN;
}
if (axisPtr->logScale) {
if ((isnormal(axisPtr->reqMin)) && (axisPtr->reqMin <= 0.0)) {
- axisPtr->reqMin = Blt_NaN();
+ axisPtr->reqMin = NAN;
}
if ((isnormal(axisPtr->reqMax)) && (axisPtr->reqMax <= 0.0)) {
- axisPtr->reqMax = Blt_NaN();
+ axisPtr->reqMax = NAN;
}
}
@@ -1598,7 +1600,7 @@ LogScaleAxis(Axis *axisPtr, double min, double max)
nMajor = nMinor = 0;
/* Suppress compiler warnings. */
majorStep = minorStep = 0.0;
- tickMin = tickMax = Blt_NaN();
+ tickMin = tickMax = NAN;
if (min < max) {
min = (min != 0.0) ? log10(fabs(min)) : 0.0;
max = (max != 0.0) ? log10(fabs(max)) : 1.0;
@@ -1728,7 +1730,7 @@ LinearScaleAxis(Axis *axisPtr, double min, double max)
nTicks = 0;
step = 1.0;
/* Suppress compiler warning. */
- axisMin = axisMax = tickMin = tickMax = Blt_NaN();
+ axisMin = axisMax = tickMin = tickMax = NAN;
if (min < max) {
double range;
@@ -3727,10 +3729,10 @@ ConfigureAxis(Axis *axisPtr)
}
}
if ((isnormal(axisPtr->scrollMin)) && (axisPtr->scrollMin <= 0.0)) {
- axisPtr->scrollMin = Blt_NaN();
+ axisPtr->scrollMin = NAN;
}
if ((isnormal(axisPtr->scrollMax)) && (axisPtr->scrollMax <= 0.0)) {
- axisPtr->scrollMax = Blt_NaN();
+ axisPtr->scrollMax = NAN;
}
}
angle = fmod(axisPtr->tickAngle, 360.0);
@@ -3825,8 +3827,8 @@ NewAxis(Graph *graphPtr, const char *name, int margin)
axisPtr->margin = MARGIN_NONE;
axisPtr->tickLength = 8;
axisPtr->scrollUnits = 10;
- axisPtr->reqMin = axisPtr->reqMax = Blt_NaN();
- axisPtr->reqScrollMin = axisPtr->reqScrollMax = Blt_NaN();
+ axisPtr->reqMin = axisPtr->reqMax = NAN;
+ axisPtr->reqScrollMin = axisPtr->reqScrollMax = NAN;
axisPtr->flags = (AXIS_SHOWTICKS|AXIS_GRIDMINOR|AXIS_AUTO_MAJOR|
AXIS_AUTO_MINOR | AXIS_EXTERIOR);
if (graphPtr->classId == CID_ELEM_BAR) {
@@ -5635,7 +5637,7 @@ TimeScaleAxis(Axis *axisPtr, double min, double max)
nTicks = 0;
step = 1.0;
/* Suppress compiler warning. */
- axisMin = axisMax = tickMin = tickMax = Blt_NaN();
+ axisMin = axisMax = tickMin = tickMax = NAN;
if (min < max) {
double range;
diff --git a/src/bltInt.C b/src/bltInt.C
index b5034f5..a5213ca 100644
--- a/src/bltInt.C
+++ b/src/bltInt.C
@@ -45,8 +45,6 @@
#define TCL_VERSION_LOADED TCL_VERSION
#endif
-static double bltNaN;
-
BLT_EXTERN Tcl_AppInitProc Blt_core_Init;
BLT_EXTERN Tcl_AppInitProc Blt_core_SafeInit;
@@ -123,30 +121,6 @@ unset var path\n\
\n"
};
-double
-Blt_NaN(void)
-{
- return bltNaN;
-}
-
-static double
-MakeNaN(void)
-{
- union DoubleValue {
- unsigned int words[2];
- double value;
- } result;
-
-#ifdef WORDS_BIGENDIAN
- result.words[0] = 0x7ff80000;
- result.words[1] = 0x00000000;
-#else
- result.words[0] = 0x00000000;
- result.words[1] = 0x7ff80000;
-#endif
- return result.value;
-}
-
static int
SetLibraryPath(Tcl_Interp *interp)
{
@@ -242,7 +216,6 @@ int Blt_core_Init(Tcl_Interp *interp) /* Interpreter to add extra commands */
if (Blt_VectorCmdInitProc(interp) != TCL_OK)
return TCL_ERROR;
- bltNaN = MakeNaN();
if (Tcl_PkgProvide(interp, "blt_core", BLT_VERSION) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/src/bltVector.C b/src/bltVector.C
index fa6ee88..5f2e8a5 100644
--- a/src/bltVector.C
+++ b/src/bltVector.C
@@ -42,12 +42,14 @@
* x notify reorder #1 #2
*/
+#include <math.h>
+#include <time.h>
+
#include "bltVecInt.h"
#include "bltOp.h"
#include "bltNsUtil.h"
#include "bltSwitch.h"
#include <bltMath.h>
-#include <time.h>
#ifndef TCL_NAMESPACE_ONLY
#define TCL_NAMESPACE_ONLY TCL_GLOBAL_ONLY
@@ -510,7 +512,7 @@ void
Blt_Vec_UpdateClients(Vector *vPtr)
{
vPtr->dirty++;
- vPtr->max = vPtr->min = Blt_NaN();
+ vPtr->max = vPtr->min = NAN;
if (vPtr->notifyFlags & NOTIFY_NEVER) {
return;
}
@@ -634,7 +636,7 @@ Blt_Vec_Max(Vector *vecObjPtr)
double max;
double *vp, *vend;
- max = Blt_NaN();
+ max = NAN;
vp = vecObjPtr->valueArr + vecObjPtr->first;
vend = vecObjPtr->valueArr + vecObjPtr->last;
max = *vp++;
@@ -1104,7 +1106,7 @@ Blt_Vec_New(VectorInterpData *dataPtr) /* Interpreter-specific data. */
vPtr->hashPtr = NULL;
vPtr->chain = Blt_Chain_Create();
vPtr->flush = FALSE;
- vPtr->min = vPtr->max = Blt_NaN();
+ vPtr->min = vPtr->max = NAN;
vPtr->notifyFlags = NOTIFY_WHENIDLE;
vPtr->dataPtr = dataPtr;
return vPtr;