|
From: <arj...@us...> - 2009-01-26 20:24:29
|
Revision: 9393
http://plplot.svn.sourceforge.net/plplot/?rev=9393&view=rev
Author: arjenmarkus
Date: 2009-01-26 20:24:26 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
Added return statements after plabort(), making sure that all functions return
after a call to plabort()
Modified Paths:
--------------
trunk/src/plcont.c
trunk/src/plcore.c
Modified: trunk/src/plcont.c
===================================================================
--- trunk/src/plcont.c 2009-01-26 20:19:13 UTC (rev 9392)
+++ trunk/src/plcont.c 2009-01-26 20:24:26 UTC (rev 9393)
@@ -36,7 +36,7 @@
plcntr(PLFLT (*plf2eval) (PLINT, PLINT, PLPointer),
PLPointer plf2eval_data,
PLINT nx, PLINT ny, PLINT kx, PLINT lx,
- PLINT ky, PLINT ly, PLFLT flev, PLINT **ipts,
+ PLINT ky, PLINT ly, PLFLT flev, PLINT **ipts,
void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
PLPointer pltr_data);
@@ -487,6 +487,7 @@
if (pltr == NULL) {
/* If pltr is undefined, abort with an error. */
plabort("plcont: The pltr callback must be defined");
+ return;
}
grid.f = f;
@@ -594,14 +595,14 @@
for (kcol = kx; kcol < lx; kcol++) {
for (krow = ky; krow < ly; krow++) {
ipts[kcol][krow] = 0;
- }
+ }
}
for (krow = ky; krow < ly; krow++) {
for (kcol = kx; kcol < lx; kcol++) {
if (ipts[kcol][krow] == 0) {
-
+
/* Follow and draw a contour */
pldrawcn(f2eval, f2eval_data,
nx, ny, kx, lx, ky, ly, flev, flabel, kcol, krow,
@@ -628,7 +629,7 @@
PLPointer f2eval_data,
PLINT nx, PLINT ny, PLINT kx, PLINT lx,
PLINT ky, PLINT ly, PLFLT flev, char *flabel, PLINT kcol, PLINT krow,
- PLFLT lastx, PLFLT lasty, PLINT startedge, PLINT **ipts,
+ PLFLT lastx, PLFLT lasty, PLINT startedge, PLINT **ipts,
PLFLT *distance, PLINT *lastindex,
void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer),
PLPointer pltr_data)
@@ -657,12 +658,12 @@
ipts[kcol][krow] = 1;
/* Check if no contour has been crossed i.e. iedge[i] = -1 */
- if ((iedge[0] == -1) && (iedge[1] == -1) && (iedge[2] == -1)
+ if ((iedge[0] == -1) && (iedge[1] == -1) && (iedge[2] == -1)
&& (iedge[3] == -1)) return;
- /* Check if this is a completely flat square - in which case
+ /* Check if this is a completely flat square - in which case
ignore it */
- if ( (f[0] == 0.0) && (f[1] == 0.0) && (f[2] == 0.0) &&
+ if ( (f[0] == 0.0) && (f[1] == 0.0) && (f[2] == 0.0) &&
(f[3] == 0.0) ) return;
/* Calculate intersection points */
@@ -728,15 +729,15 @@
(krownext >= ky) && (krownext < ly) &&
(ipts[kcolnext][krownext] == 0)) {
pldrawcn(f2eval, f2eval_data,
- nx, ny, kx, lx, ky, ly, flev, flabel,
+ nx, ny, kx, lx, ky, ly, flev, flabel,
kcolnext, krownext,
- locx[num], locy[num], inext, ipts,
+ locx[num], locy[num], inext, ipts,
distance, lastindex,
pltr, pltr_data);
}
}
/* Hard case where contour passes through corner */
- /* This is still not perfect - it may lose the contour
+ /* This is still not perfect - it may lose the contour
* which won't upset the contour itself (we can find it
* again later) but might upset the labelling */
else {
@@ -751,13 +752,13 @@
(krownext >= ky) && (krownext < ly) &&
(ipts[kcolnext][krownext] == 0)) {
pldrawcn(f2eval, f2eval_data,
- nx, ny, kx, lx, ky, ly, flev, flabel,
+ nx, ny, kx, lx, ky, ly, flev, flabel,
kcolnext, krownext,
- locx[num], locy[num], inext, ipts,
+ locx[num], locy[num], inext, ipts,
distance, lastindex,
pltr, pltr_data);
}
-
+
}
if (first == 1) {
/* Move back to first point */
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-01-26 20:19:13 UTC (rev 9392)
+++ trunk/src/plcore.c 2009-01-26 20:24:26 UTC (rev 9393)
@@ -397,13 +397,13 @@
char *endptr2;
char msgbuf[80];
- *num = strtoul(text,&endptr,0);
+ *num = strtoul(text,&endptr,0);
if (end != endptr[0]) {
sprintf(msgbuf,"text2num: invalid control string detected - %c expected",end);
plwarn(msgbuf);
}
-
+
return (int)(endptr - text);
}
@@ -682,6 +682,7 @@
sprintf (buf, "UTF-8 string is malformed: %s%s",
buf, strlen (string) > 30 ? "[...]" : "");
plabort (buf);
+ return;
}
unicode_buffer [j] = unichar;
i += ptr - (string + i) - 1;
@@ -1651,7 +1652,7 @@
plP_bop();
plsc->level = 1;
-
+
/* The driver options are freed after driver initialisation,
* since it is assumed that in this function options are
* processed and stored somewhere else. For further driver
@@ -1709,7 +1710,7 @@
if (plsc->zdigmax == 0)
plsc->zdigmax = 3;
- if (plsc->timefmt == NULL)
+ if (plsc->timefmt == NULL)
pltimefmt("%c");
/* Switch to graphics mode and set color and arrow style*/
@@ -2552,7 +2553,7 @@
if (!driver->dlhand)
{
char drvspec[ 400 ];
-#ifdef LTDL_WIN32
+#ifdef LTDL_WIN32
sprintf( drvspec, "%s", driver->drvnam );
#else
sprintf( drvspec, "%s/%s", plGetDrvDir (), driver->drvnam );
@@ -3476,7 +3477,7 @@
* Until then, all plimage* rendering is done by the plimageslow
* rendering path.
*/
-#if 0 /* BEGIN dev_fastimg COMMENT */
+#if 0 /* BEGIN dev_fastimg COMMENT */
PLINT i, npts;
short *xscl, *yscl;
int plbuf_write;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|