|
From: <sm...@us...> - 2009-03-12 08:18:55
|
Revision: 9727
http://plplot.svn.sourceforge.net/plplot/?rev=9727&view=rev
Author: smekal
Date: 2009-03-12 08:18:31 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
To get rid of Visual C++ warnings, unreferenced variables were removed, explicit type casts added and type of variables changed.
Modified Paths:
--------------
trunk/src/plbuf.c
trunk/src/plcont.c
trunk/src/plctrl.c
trunk/src/pldeprecated.c
trunk/src/pldtik.c
trunk/src/plfill.c
trunk/src/plhist.c
trunk/src/plimage.c
trunk/src/pltick.c
trunk/src/plvect.c
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plbuf.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -1007,7 +1007,7 @@
{
size_t save_size;
struct _state *plot_state = (struct _state *)state;
- unsigned int i;
+ PLINT i;
U_CHAR *buf; /* Assume that this is byte-sized */
if(pls->plbuf_write) {
Modified: trunk/src/plcont.c
===================================================================
--- trunk/src/plcont.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plcont.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -255,7 +255,8 @@
static void pl_drawcontlabel(PLFLT tpx, PLFLT tpy, char *flabel, PLFLT *distance, PLINT *lastindex)
{
- PLFLT currx_old, curry_old, delta_x, delta_y;
+ PLFLT delta_x, delta_y;
+ PLINT currx_old, curry_old;
delta_x = plP_pcdcx(plsc->currx)-plP_pcdcx(plP_wcpcx(tpx));
delta_y = plP_pcdcy(plsc->curry)-plP_pcdcy(plP_wcpcy(tpy));
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plctrl.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -160,7 +160,7 @@
return;
}
- icol1 = col1 * plsc->ncol1;
+ icol1 = (PLINT)(col1 * plsc->ncol1);
icol1 = MIN(icol1, plsc->ncol1-1);
plsc->icol1 = icol1;
@@ -1745,7 +1745,7 @@
int il, ir;
x = (double) (i * (pls->ncol1-1)) / (double) (ncol-1);
- il = x;
+ il = (int)x;
ir = il + 1;
delta = x - il;
@@ -1759,9 +1759,9 @@
newcolor->a = pls->cmap1[il].a;
}
else {
- newcolor->r = (1.-delta) * pls->cmap1[il].r + delta * pls->cmap1[ir].r;
- newcolor->g = (1.-delta) * pls->cmap1[il].g + delta * pls->cmap1[ir].g;
- newcolor->b = (1.-delta) * pls->cmap1[il].b + delta * pls->cmap1[ir].b;
+ newcolor->r = (unsigned char)((1.-delta) * pls->cmap1[il].r + delta * pls->cmap1[ir].r);
+ newcolor->g = (unsigned char)((1.-delta) * pls->cmap1[il].g + delta * pls->cmap1[ir].g);
+ newcolor->b = (unsigned char)((1.-delta) * pls->cmap1[il].b + delta * pls->cmap1[ir].b);
newcolor->a = (1.-delta) * pls->cmap1[il].a + delta * pls->cmap1[ir].a;
}
}
Modified: trunk/src/pldeprecated.c
===================================================================
--- trunk/src/pldeprecated.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/pldeprecated.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -151,10 +151,10 @@
/* transform arrow -> a */
for (j = 0; j < npts; j++) {
- a_x[j] = arrow_x[j] * dpx -
- arrow_y[j] * dpy + px0;
- a_y[j] = arrow_x[j] * dpy +
- arrow_y[j] * dpx + py0;
+ a_x[j] = (PLINT)(arrow_x[j] * dpx -
+ arrow_y[j] * dpy + px0);
+ a_y[j] = (PLINT)(arrow_x[j] * dpy +
+ arrow_y[j] * dpx + py0);
}
/* draw the arrow */
Modified: trunk/src/pldtik.c
===================================================================
--- trunk/src/pldtik.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/pldtik.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -112,7 +112,7 @@
\*----------------------------------------------------------------------*/
void
pldtfac(PLFLT vmin, PLFLT vmax, PLFLT *factor, PLFLT *start) {
- PLFLT diff, tdiff;
+ PLFLT diff;
PLINT year, month, day, hour, min;
PLFLT sec;
Modified: trunk/src/plfill.c
===================================================================
--- trunk/src/plfill.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plfill.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -191,8 +191,8 @@
si /= temp;
ci /= temp;
- dinc = plsc->delta[k] * SSQR(plsc->ypmm * ABS(ci),
- plsc->xpmm * ABS(si)) / 1000.;
+ dinc = (PLINT)(plsc->delta[k] * SSQR(plsc->ypmm * ABS(ci),
+ plsc->xpmm * ABS(si)) / 1000.);
if (dinc < 0) dinc = -dinc;
if (dinc == 0) dinc = 1;
@@ -265,8 +265,8 @@
ta = *a;
tb = *b;
- *a = floor((double) (ta * c + tb * d + 0.5));
- *b = floor((double) (tb * c - ta * d + 0.5));
+ *a = (PLINT)floor((double) (ta * c + tb * d + 0.5));
+ *b = (PLINT)floor((double) (tb * c - ta * d + 0.5));
}
static void
@@ -310,7 +310,7 @@
if (cstep == -nstep) continue;
if (yp2 == yp3 && yp1 > yp2) continue;
}
- plotx = xp1 + floor(((double) (ploty - yp1) * dx) / dy + 0.5);
+ plotx = xp1 + (PLINT)floor(((double) (ploty - yp1) * dx) / dy + 0.5);
addcoord(plotx, ploty);
}
}
Modified: trunk/src/plhist.c
===================================================================
--- trunk/src/plhist.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plhist.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -75,7 +75,7 @@
}
for (i = 0; i < n; i++) {
- bin = (data[i] - datmin) / dx;
+ bin = (PLINT)((data[i] - datmin) / dx);
if ((flags & 2) == 0) {
bin = bin > 0 ? bin : 0;
bin = bin < nbin ? bin : nbin - 1;
@@ -142,7 +142,7 @@
}
if (flags & 2) {
if (!(flags & 4) || (y[i] != vpwymi)) {
- int xm = x[i] + (x[i] - x[i-1]);
+ int xm = (int)(x[i] + (x[i] - x[i-1]));
pljoin(x[i], vpwymi, x[i], y[i]);
pljoin(x[i], y[i], xm, y[i]);
pljoin(xm, y[i], xm, vpwymi);
Modified: trunk/src/plimage.c
===================================================================
--- trunk/src/plimage.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plimage.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -97,7 +97,7 @@
/* Translated (by pltr) coordinates */
PLFLT tx, ty;
/* The corners of a single filled region */
- int corners[4];
+ /* int corners[4]; - unreferenced */
/* The color to use in the fill */
PLFLT color;
@@ -332,14 +332,14 @@
dy = (ymax - ymin) / (PLFLT)ny;
/* Pixel dimensions of the (Dxmin, Dymin) to (Dxmax, Dymax) box */
- nnx = ceil((Dxmax - Dxmin) / dx);
- nny = ceil((Dymax - Dymin) / dy);
+ nnx = (PLINT)ceil((Dxmax - Dxmin) / dx);
+ nny = (PLINT)ceil((Dymax - Dymin) / dy);
/* Call plimagefr with the value -> color range mapped to the minimum
Offsets for the idata indices to select
(Dxmin, Dymin) to (Dxmax, Dymax) */
- xm = floor((Dxmin - xmin) / dx);
- ym = floor((Dymin - ymin) / dy);
+ xm = (PLINT)floor((Dxmin - xmin) / dx);
+ ym = (PLINT)floor((Dymin - ymin) / dy);
/* Allocate space for the sub-image */
plAlloc2dGrid(&z, nnx, nny);
Modified: trunk/src/pltick.c
===================================================================
--- trunk/src/pltick.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/pltick.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -74,7 +74,7 @@
{
PLINT yminor;
- yminor = MAX(1.0, plsc->minht * plsc->ypmm);
+ yminor = (PLINT)(MAX(1.0, plsc->minht * plsc->ypmm));
plxtik(plP_wcpcx(xmin), plP_wcpcy(y), yminor, yminor);
plP_movwor(xmin, y);
plP_drawor(xmax, y);
@@ -92,7 +92,7 @@
{
PLINT xminor;
- xminor = MAX(1.0, plsc->minht * plsc->xpmm);
+ xminor = (PLINT)(MAX(1.0, plsc->minht * plsc->xpmm));
plytik(plP_wcpcx(x), plP_wcpcy(ymin), xminor, xminor);
plP_movwor(x, ymin);
plP_drawor(x, ymax);
Modified: trunk/src/plvect.c
===================================================================
--- trunk/src/plvect.c 2009-03-11 23:04:09 UTC (rev 9726)
+++ trunk/src/plvect.c 2009-03-12 08:18:31 UTC (rev 9727)
@@ -89,8 +89,8 @@
/* transform arrow -> a */
for (j = 0; j < plsc->arrow_npts; j++) {
- a_x[j] = plsc->arrow_x[j] * dpx - plsc->arrow_y[j] * dpy + px0;
- a_y[j] = plsc->arrow_x[j] * dpy + plsc->arrow_y[j] * dpx + py0;
+ a_x[j] = (PLINT)(plsc->arrow_x[j] * dpx - plsc->arrow_y[j] * dpy + px0);
+ a_y[j] = (PLINT)(plsc->arrow_x[j] * dpy + plsc->arrow_y[j] * dpx + py0);
}
/* draw the arrow */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|