X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctgraphics%2Fezplot.cpp;h=ed1ca233d26ef8e8c02e967e78717935a77b64bd;hp=ea29c766c4b33b90a94bcb2e610d593e95a2342d;hb=3f6c94c6bd432ad7b7a55ad991d3b8223fb44f18;hpb=23f5654dacb1952c15bda92c2606fae3a55e48ad diff --git a/libctgraphics/ezplot.cpp b/libctgraphics/ezplot.cpp index ea29c76..ed1ca23 100644 --- a/libctgraphics/ezplot.cpp +++ b/libctgraphics/ezplot.cpp @@ -4,9 +4,9 @@ ** EZPLOT ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ezplot.cpp,v 1.28 2001/01/04 21:28:41 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; @@ -888,8 +886,7 @@ EZPlot::plot (SGP* pSGP) } } } - } - + } }