projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r599: no message
[ctsim.git]
/
libctgraphics
/
ezplot.cpp
diff --git
a/libctgraphics/ezplot.cpp
b/libctgraphics/ezplot.cpp
index ea29c766c4b33b90a94bcb2e610d593e95a2342d..ed1ca233d26ef8e8c02e967e78717935a77b64bd 100644
(file)
--- a/
libctgraphics/ezplot.cpp
+++ b/
libctgraphics/ezplot.cpp
@@
-4,9
+4,9
@@
** EZPLOT
**
** This is part of the CTSim program
** 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
**
** 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)
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;
}
m_iPointCount = n;
}
@@
-94,7
+92,7
@@
EZPlot::addCurve (const float x[], const double y[], int num)
}
void
}
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];
{
double* dy = new double [num];
@@
-108,7
+106,7
@@
EZPlot::addCurve (const double x[], const float y[], int num)
void
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;
{
if (num < 1)
return;
@@
-888,8
+886,7
@@
EZPlot::plot (SGP* pSGP)
}
}
}
}
}
}
- }
-
+ }
}
}