r557: no message
[ctsim.git] / libctgraphics / ezplot.cpp
index b59d92dde5a8f5723aae5f338253761a7400c017..ed1ca233d26ef8e8c02e967e78717935a77b64bd 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ezplot.cpp,v 1.30 2001/01/28 19:10:18 kevin Exp $
+**  $Id: ezplot.cpp,v 1.31 2001/02/20 04:48:45 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
@@ -36,14 +36,12 @@ static const int DEF_CURVE_CLR = C_RED;
 
 
 EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n)
-: x(NULL), y(NULL)
+: x(new double[n]), y(new double[n])
 {
-  x = new double [n];
-  y = new double [n];
-  
-  int copyCount = n * sizeof(double);
-  memcpy (x, xData, copyCount);
-  memcpy (y, yData, copyCount);
+  for (int i = 0; i < n; i++) {
+    x[i] = xData[i];
+    y[i] = yData[i];
+  }
   
   m_iPointCount = n;
 }
@@ -94,7 +92,7 @@ EZPlot::addCurve (const float x[], const double y[], int num)
 }
 
 void
-EZPlot::addCurve (const double x[], const float y[], int num)
+EZPlot::addCurve (const double* const x, const float* const y, int num)
 {
   double* dy = new double [num];
   
@@ -108,7 +106,7 @@ EZPlot::addCurve (const double x[], const float y[], int num)
 
 
 void
-EZPlot::addCurve (const double x[], const double y[], int num)
+EZPlot::addCurve (const double* const x, const double* const y, int num)
 {
   if (num < 1)
     return;