r148: *** empty log message ***
[ctsim.git] / libctgraphics / ezplot.cpp
index dfd0baf900807c4f76cf798ddd2d1b0203bd3058..7b7bb55e8c4e6b373db89d1a1731af86222f5ce4 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ezplot.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $
+**  $Id: ezplot.cpp,v 1.6 2000/07/15 08:36:13 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -99,8 +99,8 @@ static int y_fldwid, y_frac;  /* in fraction of number, used for printf() */
 static double xtl_wid, ytl_wid;        /* length of ticks labels in NDC */
 static double tl_height;       /* height of tick labels in NDC */
 
-static char x_numfmt[10];      /* format to print x tick labels */
-static char y_numfmt[10];      /* format to print y tick labels */
+static char x_numfmt[20];      /* format to print x tick labels */
+static char y_numfmt[20];      /* format to print y tick labels */
 
 
 /*----------------------------------------------------------------------
@@ -123,10 +123,22 @@ static char y_numfmt[10]; /* format to print y tick labels */
  *----------------------------------------------------------------------*/
 
 
+SGP_ID 
+ezplot (const float x[], const double y[], int num)
+{
+  double dx [num];
+
+  for (int i = 0; i < num; i++)
+    dx[i] = x[i];
+
+  return ezplot (dx, y, num);
+}
+
+
 SGP_ID
-ezplot (double x[], double y[], int num)
+ezplot (const double x[], const double y[], int num)
 {
-    unsigned int size, i;
+    unsigned int size;
     SGP_ID gid = NULL;
 
     if (ez.i_plotimmediate == TRUE) {
@@ -148,7 +160,7 @@ ezplot (double x[], double y[], int num)
        size = num * sizeof(double);
        ez.curve[ez.i_numcurves].x = new double [size];
        ez.curve[ez.i_numcurves].y = new double [size];
-       for (i = 0; i < num; i++) {
+       for (int i = 0; i < num; i++) {
            ez.curve[ez.i_numcurves].x[i] = x[i];
            ez.curve[ez.i_numcurves].y[i] = y[i];
        }
@@ -899,10 +911,7 @@ void ezinit(void)
 
 void ezfree(void)
 {
-    static char errmsg[] = "EZFREE in EZPLOT";
-    int i;
-    
-    for (i = 0; i < ez.i_numcurves; i++) {
+    for (int i = 0; i < ez.i_numcurves; i++) {
        delete ez.curve[i].x;
        delete ez.curve[i].y;
     }