|
From: <and...@us...> - 2008-10-01 20:57:22
|
Revision: 8846
http://plplot.svn.sourceforge.net/plplot/?rev=8846&view=rev
Author: andrewross
Date: 2008-10-01 20:57:14 +0000 (Wed, 01 Oct 2008)
Log Message:
-----------
Fix up some issues with transparency support in the core library. Most
these are related to stream buffering and copying streams.
Modified Paths:
--------------
trunk/src/plbuf.c
trunk/src/plcore.c
trunk/src/plctrl.c
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2008-10-01 06:17:49 UTC (rev 8845)
+++ trunk/src/plbuf.c 2008-10-01 20:57:14 UTC (rev 8846)
@@ -495,12 +495,14 @@
case PLSTATE_COLOR0:{
short icol0;
U_CHAR r, g, b;
+ PLFLT a;
rd_data(pls, &icol0, sizeof(short));
if (icol0 == PL_RGB_COLOR) {
rd_data(pls, &r, sizeof(U_CHAR));
rd_data(pls, &g, sizeof(U_CHAR));
rd_data(pls, &b, sizeof(U_CHAR));
+ a = 1.0;
}
else {
if ((int) icol0 >= pls->ncol0) {
@@ -512,11 +514,13 @@
r = pls->cmap0[icol0].r;
g = pls->cmap0[icol0].g;
b = pls->cmap0[icol0].b;
+ a = pls->cmap0[icol0].a;
}
pls->icol0 = icol0;
pls->curcolor.r = r;
pls->curcolor.g = g;
pls->curcolor.b = b;
+ pls->curcolor.a = a;
plP_state(PLSTATE_COLOR0);
break;
@@ -531,6 +535,7 @@
pls->curcolor.r = pls->cmap1[icol1].r;
pls->curcolor.g = pls->cmap1[icol1].g;
pls->curcolor.b = pls->cmap1[icol1].b;
+ pls->curcolor.a = pls->cmap1[icol1].a;
plP_state(PLSTATE_COLOR1);
break;
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2008-10-01 06:17:49 UTC (rev 8845)
+++ trunk/src/plcore.c 2008-10-01 20:57:14 UTC (rev 8846)
@@ -1969,6 +1969,7 @@
to->r = from->r;
to->g = from->g;
to->b = from->b;
+ to->a = from->a;
}
/*--------------------------------------------------------------------------*\
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2008-10-01 06:17:49 UTC (rev 8845)
+++ trunk/src/plctrl.c 2008-10-01 20:57:14 UTC (rev 8846)
@@ -376,6 +376,7 @@
plsc->cmap0[i].r = r[i];
plsc->cmap0[i].g = g[i];
plsc->cmap0[i].b = b[i];
+ plsc->cmap0[i].a = 1.0;
}
if (plsc->level > 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2008-10-14 20:04:45
|
Revision: 8893
http://plplot.svn.sourceforge.net/plplot/?rev=8893&view=rev
Author: smekal
Date: 2008-10-14 20:04:30 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
Added ltdl_win32.c which provides parts of the API of the ltdl library in win32. I didn't look at the source code of the ltdl library (which also provides win32 code presumably), I just provided the necessary API to fulfill the dependencies of plcore.c and make it run. Therefore the code is under LGPL and not dependent on the ltdl license (whatever it is). Changed the CMakeLists.txt file accordingly to include the new code for the win32 case. Minor changes to plcore.c for that case as well (LTDL_WIN32 gets defined for win32 (but not if MSYS or CYGWIN)).
Modified Paths:
--------------
trunk/src/CMakeLists.txt
trunk/src/plcore.c
Added Paths:
-----------
trunk/src/ltdl_win32.c
Modified: trunk/src/CMakeLists.txt
===================================================================
--- trunk/src/CMakeLists.txt 2008-10-14 07:48:25 UTC (rev 8892)
+++ trunk/src/CMakeLists.txt 2008-10-14 20:04:30 UTC (rev 8893)
@@ -50,6 +50,9 @@
plvect.c
mt19937ar.c
)
+if(LTDL_WIN32)
+ set(plplot${LIB_TAG}_LIB_SRCS ${plplot${LIB_TAG}_LIB_SRCS} ltdl_win32.c)
+endif(LTDL_WIN32)
if(BUILD_SHARED_LIBS)
SET_SOURCE_FILES_PROPERTIES(${plplot${LIB_TAG}_LIB_SRCS}
Added: trunk/src/ltdl_win32.c
===================================================================
--- trunk/src/ltdl_win32.c (rev 0)
+++ trunk/src/ltdl_win32.c 2008-10-14 20:04:30 UTC (rev 8893)
@@ -0,0 +1,76 @@
+/* $Id$
+
+ Contains all prototypes for driver functions.
+
+ Copyright (C) 2008 Werner Smekal
+
+ This file is part of PLplot.
+
+ PLplot is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ PLplot is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with PLplot; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+#include <windows.h>
+
+#include "ltdl_win32.h"
+
+lt_dlhandle lastHandle=NULL;
+
+void lt_dlinit( void )
+{
+ lastHandle=NULL;
+}
+
+void lt_dlexit( void )
+{
+ lt_dlhandle prev;
+
+ while( lastHandle!=NULL ) {
+ if( lastHandle->hinstLib )
+ FreeLibrary( lastHandle->hinstLib );
+ prev=lastHandle->previousHandle;
+ free( lastHandle );
+ lastHandle=prev;
+ }
+}
+
+lt_dlhandle lt_dlopenext( char* dllname )
+{
+ lt_dlhandle dlhandle=malloc( sizeof(lt_dlhandle) );
+ memset( dlhandle, '\0', sizeof(lt_dlhandle) );
+
+ dlhandle->hinstLib = LoadLibrary( dllname );
+ if( !dlhandle->hinstLib ) {
+ free( dlhandle );
+ return NULL;
+ }
+
+ dlhandle->previousHandle = lastHandle;
+ lastHandle = dlhandle;
+
+ return dlhandle;
+}
+
+const char* lt_dlerror()
+{
+ static char* text="No error information";
+
+ return text;
+}
+
+void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol )
+{
+ return GetProcAddress( dlhandle->hinstLib, symbol );
+}
Property changes on: trunk/src/ltdl_win32.c
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2008-10-14 07:48:25 UTC (rev 8892)
+++ trunk/src/plcore.c 2008-10-14 20:04:30 UTC (rev 8893)
@@ -38,7 +38,11 @@
#include "plcore.h"
#ifdef ENABLE_DYNDRIVERS
-#include <ltdl.h>
+ #ifndef LTDL_WIN32
+ #include <ltdl.h>
+ #else
+ #include "ltdl_win32.h"
+ #endif
#endif
/*--------------------------------------------------------------------------*\
@@ -2114,7 +2118,7 @@
plsc->dispatch_table = dispatch_table[plsc->device - 1];
}
-int PLDLLIMPEXP plInBuildTree()
+PLDLLIMPEXP int plInBuildTree()
{
static int inited = 0;
static int inBuildTree = 0;
@@ -2179,6 +2183,8 @@
}
}
+ printf("plGetDrvDir(): drvdir=%s\n", drvdir );
+
return drvdir;
}
@@ -2547,7 +2553,11 @@
if (!driver->dlhand)
{
char drvspec[ 400 ];
+#ifdef LTDL_WIN32
+ sprintf( drvspec, "%s", driver->drvnam );
+#else
sprintf( drvspec, "%s/%s", plGetDrvDir (), driver->drvnam );
+#endif /* LTDL_WIN32 */
pldebug("plLoadDriver", "Trying to load %s on %s\n",
driver->drvnam, drvspec );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-11-19 09:34:22
|
Revision: 8992
http://plplot.svn.sourceforge.net/plplot/?rev=8992&view=rev
Author: andrewross
Date: 2008-11-19 09:34:20 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Fix duplicate lines when drawing ticks on the axes.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/pltick.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2008-11-18 22:40:34 UTC (rev 8991)
+++ trunk/src/plbox.c 2008-11-19 09:34:20 UTC (rev 8992)
@@ -234,6 +234,7 @@
if (lbx) {
plP_movphy(vppxmi, vppymi);
+ plP_draphy(vppxma, vppymi);
if (ltx) {
if (ldx) {
pldtfac(vpwxmi, vpwxma, &factor, &tstart);
@@ -265,13 +266,13 @@
tp = tn;
}
}
- plP_draphy(vppxma, vppymi);
}
/* Draw right-hand edge of box */
if (lcy) {
plP_movphy(vppxma, vppymi);
+ plP_draphy(vppxma, vppyma);
if (lty) {
if (ldy) {
pldtfac(vpwymi, vpwyma, &factor, &tstart);
@@ -303,13 +304,13 @@
tp = tn;
}
}
- plP_draphy(vppxma, vppyma);
}
/* Draw the top edge of the box */
if (lcx) {
plP_movphy(vppxma, vppyma);
+ plP_draphy(vppxmi, vppyma);
if (ltx) {
if (ldx) {
pldtfac(vpwxmi, vpwxma, &factor, &tstart);
@@ -341,13 +342,13 @@
tp = tn;
}
}
- plP_draphy(vppxmi, vppyma);
}
/* Draw left-hand edge of box */
if (lby) {
plP_movphy(vppxmi, vppyma);
+ plP_draphy(vppxmi, vppymi);
if (lty) {
if (ldy) {
pldtfac(vpwymi, vpwyma, &factor, &tstart);
@@ -379,13 +380,13 @@
tp = tn;
}
}
- plP_draphy(vppxmi, vppymi);
}
/* Draw the horizontal axis */
if (lax) {
plP_movphy(vppxmi, yp0);
+ plP_draphy(vppxma, yp0);
if (ltx) {
tp = xtick1 * floor(vpwxmi / xtick1);
for (;;) {
@@ -412,13 +413,13 @@
tp = tn;
}
}
- plP_draphy(vppxma, yp0);
}
/* Draw the vertical axis */
if (lay) {
plP_movphy(xp0, vppymi);
+ plP_draphy(xp0, vppyma);
if (lty) {
tp = ytick1 * floor(vpwymi / ytick1);
for (;;) {
@@ -445,7 +446,6 @@
tp = tn;
}
}
- plP_draphy(xp0, vppyma);
}
/* Draw grids */
@@ -715,6 +715,7 @@
/* Draw the line */
plP_movwor(wx1, wy1);
+ plP_drawor(wx2, wy2);
if (lt) {
tp = tick1 * floor(vmin / tick1);
for (;;) {
@@ -760,7 +761,6 @@
}
}
- plP_drawor(wx2, wy2);
/* Label the line */
@@ -935,6 +935,7 @@
/* Draw the line */
plP_movwor(wx, wy1);
+ plP_drawor(wx, wy2);
if (lt) {
tp = tick1 * floor(vmin / tick1);
for (;;) {
@@ -979,7 +980,6 @@
}
}
- plP_drawor(wx, wy2);
/* Label the line */
Modified: trunk/src/pltick.c
===================================================================
--- trunk/src/pltick.c 2008-11-18 22:40:34 UTC (rev 8991)
+++ trunk/src/pltick.c 2008-11-19 09:34:20 UTC (rev 8992)
@@ -32,15 +32,8 @@
void
plxtik(PLINT x, PLINT y, PLINT below, PLINT above)
{
- plP_draphy(x, y);
-
- if (below != 0)
- plP_draphy(x, y - below);
-
- if (above != 0)
- plP_draphy(x, y + above);
-
- plP_draphy(x, y);
+ plP_movphy(x, y-below);
+ plP_draphy(x, y+above);
}
/*----------------------------------------------------------------------*\
@@ -52,15 +45,8 @@
void
plytik(PLINT x, PLINT y, PLINT left, PLINT right)
{
- plP_draphy(x, y);
-
- if (left != 0)
- plP_draphy(x - left, y);
-
- if (right != 0)
- plP_draphy(x + right, y);
-
- plP_draphy(x, y);
+ plP_movphy(x-left, y);
+ plP_draphy(x+right, y);
}
/*----------------------------------------------------------------------*\
@@ -73,9 +59,8 @@
void
plstik(PLFLT mx, PLFLT my, PLFLT dx, PLFLT dy)
{
- plP_draphy(plP_mmpcx(mx), plP_mmpcy(my));
+ plP_movphy(plP_mmpcx(mx), plP_mmpcy(my));
plP_draphy(plP_mmpcx((PLFLT) (mx + dx)), plP_mmpcy((PLFLT) (my + dy)));
- plP_draphy(plP_mmpcx(mx), plP_mmpcy(my));
}
/*----------------------------------------------------------------------*\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2008-12-15 09:51:00
|
Revision: 9110
http://plplot.svn.sourceforge.net/plplot/?rev=9110&view=rev
Author: andrewross
Date: 2008-12-15 09:50:50 +0000 (Mon, 15 Dec 2008)
Log Message:
-----------
Fix a couple of compile warnings with gcc4.3.2.
For constant strings it is better to use fputs rather than fprintf. This
prevents inadvertently or maliciously including format characters such
as %d in the string which would cause fprintf to fail.
Also, on 64-bit platforms size_t may not be an int so explicitly cast
the value to an int to prevent mismatch with %d format. Newer glibc
versions include a z length modifier which signifies size_t, but unless
this is widely available it is likely only to cause additional problems.
Modified Paths:
--------------
trunk/src/plbuf.c
trunk/src/plctrl.c
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2008-12-15 02:06:53 UTC (rev 9109)
+++ trunk/src/plbuf.c 2008-12-15 09:50:50 UTC (rev 9110)
@@ -924,7 +924,7 @@
pls->plbuf_buffer_size += pls->plbuf_buffer_grow;
if (pls->verbose)
- printf("Growing buffer to %d KB\n", pls->plbuf_buffer_size / 1024);
+ printf("Growing buffer to %d KB\n", (int)(pls->plbuf_buffer_size / 1024));
if ((pls->plbuf_buffer = realloc(pls->plbuf_buffer, pls->plbuf_buffer_size)) == NULL)
plexit("plbuf wr_data: Plot buffer grow failed");
}
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2008-12-15 02:06:53 UTC (rev 9109)
+++ trunk/src/plctrl.c 2008-12-15 09:50:50 UTC (rev 9110)
@@ -2053,7 +2053,7 @@
char line[256];
while (i++ < 10) {
- fprintf(stdout, s);
+ fputs(s, stdout);
plio_fgets(line, sizeof(line), stdin);
#ifdef MSDOS
@@ -2084,7 +2084,7 @@
char line[256];
while (i++ < 10) {
- fprintf(stdout, s);
+ fputs(s, stdout);
plio_fgets(line, sizeof(line), stdin);
#ifdef MSDOS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2013-10-24 18:54:22
|
Revision: 12625
http://sourceforge.net/p/plplot/code/12625
Author: airwin
Date: 2013-10-24 18:54:19 +0000 (Thu, 24 Oct 2013)
Log Message:
-----------
Set some variables to quiet false-alarm warnings from -O3 -Wuninitialized.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/pldtik.c
trunk/src/plmap.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2013-10-24 18:22:29 UTC (rev 12624)
+++ trunk/src/plbox.c 2013-10-24 18:54:19 UTC (rev 12625)
@@ -1394,7 +1394,7 @@
PLBOOL ldy, lfy, liy, lly, lmy, lny, lty, lvy, loy, lxy;
PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
PLFLT vpwxmin, vpwxmax, vpwymin, vpwymax;
- PLFLT pos, tn, tp, offset, height, just;
+ PLFLT tn, tp, offset;
PLFLT factor, tstart;
const char *timefmt = NULL;
PLFLT default_mm, char_height_mm, height_mm;
@@ -1404,6 +1404,12 @@
// label function is provided.
PLBOOL custom_exponent_placement = !plsc->label_func && plsc->label_data;
+ // pos, height, and just are unnecessarily set to quiet
+ // -O3 -Wuninitialized warnings that are obvious false alarms from
+ // the clarity of the code associated with the true or false
+ // result for custom_exponent_placement.
+ PLFLT pos = 0.0, height = 0.0, just = 0.0;
+
plgchr( &default_mm, &char_height_mm );
// Set plot options from input
@@ -1880,7 +1886,7 @@
PLBOOL ldy, lfy, liy, lly, lmy, lny, lty, lvy, loy, lxy;
PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
PLFLT vpwxmin, vpwxmax, vpwymin, vpwymax;
- PLFLT pos, tn, offset, height, just;
+ PLFLT tn, offset;
const char *timefmt;
PLINT i;
PLINT xdigmax, xdigits, xdigmax_old, xdigits_old;
@@ -1894,6 +1900,12 @@
// label function is provided.
PLBOOL custom_exponent_placement = !plsc->label_func && plsc->label_data;
+ // pos, height, and just are unnecessarily set to quiet
+ // -O3 -Wuninitialized warnings that are obvious false alarms from
+ // the clarity of the code associated with the true or false
+ // result for custom_exponent_placement.
+ PLFLT pos = 0.0, height = 0.0, just = 0.0;
+
plgchr( &default_mm, &char_height_mm );
// Save some parameters
Modified: trunk/src/pldtik.c
===================================================================
--- trunk/src/pldtik.c 2013-10-24 18:22:29 UTC (rev 12624)
+++ trunk/src/pldtik.c 2013-10-24 18:54:19 UTC (rev 12625)
@@ -39,7 +39,8 @@
{
PLFLT t1, t2, tick_reasonable;
PLINT np, ns;
- PLFLT factor;
+ // Unnecessarily set factor to quiet -O3 -Wuninitialized warnings.
+ PLFLT factor = 0.0;
if ( ld )
Modified: trunk/src/plmap.c
===================================================================
--- trunk/src/plmap.c 2013-10-24 18:22:29 UTC (rev 12624)
+++ trunk/src/plmap.c 2013-10-24 18:54:19 UTC (rev 12625)
@@ -125,7 +125,8 @@
#ifdef HAVE_SHAPELIB
SHPHandle in;
int nentries;
- int nparts;
+ // Unnecessarily set nparts to quiet -O3 -Wuninitialized warnings.
+ int nparts = 0;
int entrynumber = 0;
int partnumber = 0;
int shapetype;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <ai...@us...> - 2009-02-05 00:55:27
|
Revision: 9454
http://plplot.svn.sourceforge.net/plplot/?rev=9454&view=rev
Author: airwin
Date: 2009-02-05 00:55:25 +0000 (Thu, 05 Feb 2009)
Log Message:
-----------
Do required internal changes for MJDtime to qsastime file name conversion.
Improve how the #include of the header file for libqsastime is done for
libplplot.
Modified Paths:
--------------
trunk/src/CMakeLists.txt
trunk/src/plbox.c
Modified: trunk/src/CMakeLists.txt
===================================================================
--- trunk/src/CMakeLists.txt 2009-02-05 00:52:50 UTC (rev 9453)
+++ trunk/src/CMakeLists.txt 2009-02-05 00:55:25 UTC (rev 9454)
@@ -132,6 +132,7 @@
include_directories(
${CMAKE_SOURCE_DIR}/include
+${CMAKE_SOURCE_DIR}/lib/qsastime
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
)
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-02-05 00:52:50 UTC (rev 9453)
+++ trunk/src/plbox.c 2009-02-05 00:55:25 UTC (rev 9454)
@@ -23,7 +23,7 @@
*/
#include "plplotP.h"
-#include "../lib/qsastime/MJDtime.h"
+#include "qsastime.h"
static PLFLT xlog[8] =
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-02-08 20:44:33
|
Revision: 9473
http://plplot.svn.sourceforge.net/plplot/?rev=9473&view=rev
Author: andrewross
Date: 2009-02-08 20:44:22 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
Replace use of sprintf, strcat and strcpy with snprintf, strncat, strncpy to prevent
the possibility of user-supplied data leading to buffer overflows.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/plbuf.c
trunk/src/plcont.c
trunk/src/plcore.c
trunk/src/plctrl.c
trunk/src/plfreetype.c
trunk/src/plgridd.c
trunk/src/plmap.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plbox.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -52,7 +52,7 @@
PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text);
static void
-plform(PLFLT value, PLINT scale, PLINT prec, char *result, PLINT ll, PLINT lf);
+plform(PLFLT value, PLINT scale, PLINT prec, char *result, PLINT len, PLINT ll, PLINT lf);
static void
grid_box(const char *xopt, PLFLT xtick1, PLINT nxsub1,
@@ -773,7 +773,7 @@
tp = tick1 * (1. + floor(vmin / tick1));
for (tn = tp; BETW(tn, vmin, vmax); tn += tick1) {
if(BETW(tn, vmin+tcrit, vmax-tcrit)) {
- plform(tn, scale, prec, string, ll, lf);
+ plform(tn, scale, prec, string, 40, ll, lf);
pos = (vmax_in > vmin_in)?
(tn - vmin) / (vmax - vmin):
(vmax - tn) / (vmax - vmin);
@@ -782,7 +782,7 @@
}
*digits = 2;
if (!ll && mode) {
- sprintf(string, "(x10#u%d#d)", (int) scale);
+ snprintf(string, 40, "(x10#u%d#d)", (int) scale);
plxytx(wx1, wy1, wx2, wy2, height, 1.0, 0.5, string);
}
}
@@ -989,7 +989,7 @@
*digits = 0;
tp = tick1 * floor(vmin / tick1);
for (tn = tp + tick1; BETW(tn, vmin, vmax); tn += tick1) {
- plform(tn, scale, prec, string, ll, lf);
+ plform(tn, scale, prec, string, 40, ll, lf);
pos = (vmax_in > vmin_in)?
(tn - vmin) / (vmax - vmin):
(vmax - tn) / (vmax - vmin);
@@ -1003,7 +1003,7 @@
*digits = MAX(*digits, lstring);
}
if (!ll && mode) {
- sprintf(string, "(x10#u%d#d)", (int) scale);
+ snprintf(string, 40, "(x10#u%d#d)", (int) scale);
pos = 1.15;
height = 0.5;
if (ln && !right) {
@@ -1252,7 +1252,7 @@
strfMJD(string, 40, timefmt, &tm, 0);
}
else {
- plform(tn, xscale, xprec, string, llx, lfx);
+ plform(tn, xscale, xprec, string, 40, llx, lfx);
}
height = lix ? 1.75 : 1.5;
pos = (vpwxmax > vpwxmin)?
@@ -1271,7 +1271,7 @@
if (!llx && !ldx && xmode) {
pos = 1.0;
height = 3.2;
- sprintf(string, "(x10#u%d#d)", (int) xscale);
+ snprintf(string, 40, "(x10#u%d#d)", (int) xscale);
if (lnx)
plmtex("b", height, pos, 0.5, string);
if (lmx)
@@ -1301,7 +1301,7 @@
strfMJD(string, 40, timefmt, &tm, 0);
}
else {
- plform(tn, yscale, yprec, string, lly, lfy);
+ plform(tn, yscale, yprec, string, 40, lly, lfy);
}
pos = (vpwymax > vpwymin)?
(tn - vpwymi) / (vpwyma - vpwymi):
@@ -1334,7 +1334,7 @@
/* Write separate exponential label if mode = 1. */
if (!lly && !ldy && ymode) {
- sprintf(string, "(x10#u%d#d)", (int) yscale);
+ snprintf(string, 40, "(x10#u%d#d)", (int) yscale);
offset = 0.02;
height = 2.0;
if (lny) {
@@ -1372,7 +1372,7 @@
\*--------------------------------------------------------------------------*/
static void
-plform(PLFLT value, PLINT scale, PLINT prec, char *string, PLINT ll, PLINT lf)
+plform(PLFLT value, PLINT scale, PLINT prec, char *string, PLINT len, PLINT ll, PLINT lf)
{
if (ll) {
@@ -1387,18 +1387,18 @@
value = pow(10.0, exponent);
if (exponent < 0) {
char form[10];
- sprintf(form, "%%.%df", ABS(exponent));
- sprintf(string, form, value);
+ snprintf(form, 10, "%%.%df", ABS(exponent));
+ snprintf(string, len, form, value);
}
else {
- sprintf(string, "%d", (int) value);
+ snprintf(string, len, "%d", (int) value);
}
}
else {
/* Exponential, i.e. 10^-1, 10^0, 10^1, etc */
- sprintf(string, "10#u%d", (int) ROUND(value));
+ snprintf(string, len, "10#u%d", (int) ROUND(value));
}
}
else {
@@ -1422,8 +1422,8 @@
scale2 = pow(10., prec);
value = floor((value * scale2) + .5) / scale2;
- sprintf(form, "%%.%df", (int) prec);
- sprintf(temp, form, value);
- strcpy(string, temp);
+ snprintf(form, 10, "%%.%df", (int) prec);
+ snprintf(temp, 30, form, value);
+ strncpy(string, temp, len);
}
}
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plbuf.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -508,7 +508,7 @@
else {
if ((int) icol0 >= pls->ncol0) {
char buffer[256];
- sprintf(buffer, "rdbuf_state: Invalid color map entry: %d", (int) icol0);
+ snprintf(buffer, 256, "rdbuf_state: Invalid color map entry: %d", (int) icol0);
plabort(buffer);
return;
}
Modified: trunk/src/plcont.c
===================================================================
--- trunk/src/plcont.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plcont.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -51,7 +51,7 @@
PLPointer pltr_data);
static void
-plfloatlabel(PLFLT value, char *string);
+plfloatlabel(PLFLT value, char *string, PLINT len);
static PLFLT
plP_pcwcx(PLINT x);
@@ -306,7 +306,7 @@
* print the label
*/
-static void plfloatlabel(PLFLT value, char *string)
+static void plfloatlabel(PLFLT value, char *string, PLINT len)
{
PLINT setpre, precis;
/* form[10] gives enough space for all non-malicious formats.
@@ -349,10 +349,10 @@
if (mant != 0.0)
mant = (int )(mant*pow(10.0, prec-1) + 0.5*mant/fabs(mant))/pow(10.0, prec-1);
- sprintf(form, "%%.%df", prec-1);
- sprintf(string, form, mant);
- sprintf(tmpstring, "#(229)10#u%d", exponent);
- strcat(string, tmpstring);
+ snprintf(form, 10, "%%.%df", prec-1);
+ snprintf(string, len, form, mant);
+ snprintf(tmpstring, 15, "#(229)10#u%d", exponent);
+ strncat(string, tmpstring, len);
if (abs(exponent) < limexp || value == 0.0) {
value = pow(10.0, exponent) * mant;
@@ -365,8 +365,8 @@
if (prec < 0)
prec = 0;
- sprintf(form, "%%.%df", (int) prec);
- sprintf(string, form, value);
+ snprintf(form, 10, "%%.%df", (int) prec);
+ snprintf(string, len, form, value);
}
}
@@ -588,7 +588,7 @@
cont_new_store(flev);
/* format contour label for plptex and define the font height of the labels */
- plfloatlabel(flev, flabel);
+ plfloatlabel(flev, flabel, 30);
plschr(0.0, contlabel_size);
/* Clear array for traversed squares */
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plcore.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -400,7 +400,7 @@
*num = strtoul(text,&endptr,0);
if (end != endptr[0]) {
- sprintf(msgbuf,"text2num: invalid control string detected - %c expected",end);
+ snprintf(msgbuf,80,"text2num: invalid control string detected - %c expected",end);
plwarn(msgbuf);
}
@@ -679,7 +679,7 @@
if (ptr == NULL) {
char buf[80];
strncpy (buf, string, 30);
- sprintf (buf, "UTF-8 string is malformed: %s%s",
+ snprintf (buf, 80, "UTF-8 string is malformed: %s%s",
buf, strlen (string) > 30 ? "[...]" : "");
plabort (buf);
return;
@@ -2258,10 +2258,10 @@
FILE* fd;
/* Open the driver's info file */
- sprintf (path, "%s/%s", drvdir, name);
+ snprintf (path, 300, "%s/%s", drvdir, name);
fd = fopen (path, "r");
if (fd == NULL) {
- sprintf (buf,
+ snprintf (buf, 300,
"plInitDispatchTable: Could not open driver info file %s\n",
name);
plabort (buf);
@@ -2554,9 +2554,9 @@
{
char drvspec[ 400 ];
#ifdef LTDL_WIN32
- sprintf( drvspec, "%s", driver->drvnam );
+ snprintf( drvspec, 400, "%s", driver->drvnam );
#else
- sprintf( drvspec, "%s/%s", plGetDrvDir (), driver->drvnam );
+ snprintf( drvspec, 400, "%s/%s", plGetDrvDir (), driver->drvnam );
#endif /* LTDL_WIN32 */
pldebug("plLoadDriver", "Trying to load %s on %s\n",
@@ -2577,7 +2577,7 @@
/* Now we are ready to ask the driver's device dispatch init function to
initialize the entries in the dispatch table. */
- sprintf( sym, "plD_dispatch_init_%s", tag );
+ snprintf( sym, 60, "plD_dispatch_init_%s", tag );
{
PLDispatchInit dispatch_init = (PLDispatchInit) lt_dlsym( driver->dlhand, sym );
if (!dispatch_init)
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plctrl.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -121,7 +121,7 @@
}
if (icol0 < 0 || icol0 >= plsc->ncol0) {
char buffer[256];
- sprintf(buffer, "plcol0: Invalid color map entry: %d", (int) icol0);
+ snprintf(buffer, 256, "plcol0: Invalid color map entry: %d", (int) icol0);
plabort(buffer);
return;
}
@@ -153,7 +153,7 @@
}
if (col1 < 0 || col1 > 1) {
char buffer[256];
- sprintf(buffer, "plcol1: Invalid color map position: %f", (PLFLT) col1);
+ snprintf(buffer, 256, "plcol1: Invalid color map position: %f", (PLFLT) col1);
plabort(buffer);
return;
}
@@ -233,13 +233,13 @@
plscmap0n(0);
if (icol0 < 0 || icol0 >= plsc->ncol0) {
char buffer[256];
- sprintf(buffer, "plscol0: Illegal color table value: %d", (int) icol0);
+ snprintf(buffer, 256, "plscol0: Illegal color table value: %d", (int) icol0);
plabort(buffer);
return;
}
if ((r < 0 || r > 255) || (g < 0 || g > 255) || (b < 0 || b > 255)) {
char buffer[256];
- sprintf(buffer, "plscol0: Invalid RGB color: %d, %d, %d",
+ snprintf(buffer, 256, "plscol0: Invalid RGB color: %d, %d, %d",
(int) r, (int) g, (int) b);
plabort(buffer);
return;
@@ -262,13 +262,13 @@
plscmap0n(0);
if (icol0 < 0 || icol0 >= plsc->ncol0) {
char buffer[256];
- sprintf(buffer, "plscol0a: Illegal color table value: %d", (int) icol0);
+ snprintf(buffer, 256, "plscol0a: Illegal color table value: %d", (int) icol0);
plabort(buffer);
return;
}
if ((r < 0 || r > 255) || (g < 0 || g > 255) || (b < 0 || b > 255) || (a < 0 || a > 1.0)) {
char buffer[256];
- sprintf(buffer, "plscol0a: Invalid RGB color: %d, %d, %d, %f",
+ snprintf(buffer, 256, "plscol0a: Invalid RGB color: %d, %d, %d, %f",
(int) r, (int) g, (int) b, (double) a);
plabort(buffer);
return;
@@ -302,7 +302,7 @@
if (icol0 < 0 || icol0 > plsc->ncol0) {
char buffer[256];
- sprintf(buffer, "plgcol0: Invalid color index: %d", (int) icol0);
+ snprintf(buffer, 256, "plgcol0: Invalid color index: %d", (int) icol0);
plabort(buffer);
return;
}
@@ -334,7 +334,7 @@
if (icol0 < 0 || icol0 > plsc->ncol0) {
char buffer[256];
- sprintf(buffer, "plgcol0: Invalid color index: %d", (int) icol0);
+ snprintf(buffer, 256, "plgcol0: Invalid color index: %d", (int) icol0);
plabort(buffer);
return;
}
@@ -367,7 +367,7 @@
(b[i] < 0 || b[i] > 255)) {
char buffer[256];
- sprintf(buffer, "plscmap0: Invalid RGB color: %d, %d, %d",
+ snprintf(buffer, 256, "plscmap0: Invalid RGB color: %d, %d, %d",
(int) r[i], (int) g[i], (int) b[i]);
plabort(buffer);
return;
@@ -404,7 +404,7 @@
(a[i] < 0.0 || a[i] > 1.0)) {
char buffer[256];
- sprintf(buffer, "plscmap0a: Invalid RGB color: %d, %d, %d, %f",
+ snprintf(buffer, 256, "plscmap0a: Invalid RGB color: %d, %d, %d, %f",
(int) r[i], (int) g[i], (int) b[i], (double) a[i]);
plabort(buffer);
return;
@@ -440,7 +440,7 @@
(b[i] < 0 || b[i] > 255)) {
char buffer[256];
- sprintf(buffer, "plscmap1: Invalid RGB color: %d, %d, %d",
+ snprintf(buffer, 256, "plscmap1: Invalid RGB color: %d, %d, %d",
(int) r[i], (int) g[i], (int) b[i]);
plabort(buffer);
return;
@@ -476,7 +476,7 @@
(a[i] < 0.0 || a[i] > 1.0)) {
char buffer[256];
- sprintf(buffer, "plscmap1a: Invalid RGB color: %d, %d, %d, %f",
+ snprintf(buffer, 256, "plscmap1a: Invalid RGB color: %d, %d, %d, %f",
(int) r[i], (int) g[i], (int) b[i], (double) a[i]);
plabort(buffer);
return;
@@ -1838,11 +1838,13 @@
char tmp[256];
char prefix[256];
char* suffix;
- char num[12];
+ char num[256];
+ int maxlen;
+ maxlen = strlen(pls->BaseName) + 10;
if (pls->FileName == NULL)
{
- if ((pls->FileName = (char *) malloc(10 + strlen(pls->BaseName)))==NULL)
+ if ((pls->FileName = (char *) malloc(maxlen))==NULL)
{
plexit("plP_getmember: Insufficient memory");
}
@@ -1850,15 +1852,15 @@
suffix = strstr (pls->BaseName, "%n");
- sprintf(tmp, "%%0%1ii", (int) pls->fflen);
- sprintf(num, tmp, pls->member);
+ snprintf(tmp, 256, "%%0%1ii", (int) pls->fflen);
+ snprintf(num, 256, tmp, pls->member);
if (suffix == NULL)
- sprintf (pls->FileName, "%s.%s", pls->BaseName, num);
+ snprintf (pls->FileName, maxlen, "%s.%s", pls->BaseName, num);
else {
strncpy (prefix, pls->BaseName, 256);
prefix [suffix - pls->BaseName] = 0;
- sprintf (pls->FileName, "%s%s%s", prefix, num, suffix + 2);
+ snprintf (pls->FileName, maxlen, "%s%s%s", prefix, num, suffix + 2);
}
}
@@ -1875,12 +1877,14 @@
{
char prefix[256];
char* suffix;
+ int maxlen;
pls->OutFile = NULL;
if (pls->FileName != NULL)
free((void *) pls->FileName);
- if ((pls->FileName = (char *) malloc(10 + strlen(fnam)))==NULL)
+ maxlen = 10 + strlen(fnam);
+ if ((pls->FileName = (char *) malloc(maxlen))==NULL)
{
plexit("plP_sfnam: Insufficient memory");
}
@@ -1888,22 +1892,22 @@
suffix = strstr (fnam, "%n");
if (suffix == NULL)
- strcpy(pls->FileName, fnam);
+ strncpy(pls->FileName, fnam, maxlen);
else {
strncpy (prefix, fnam, 256);
prefix [suffix - fnam] = 0;
- sprintf (pls->FileName, "%s%s", prefix, suffix + 2);
+ snprintf (pls->FileName, maxlen, "%s%s", prefix, suffix + 2);
}
if (pls->BaseName != NULL)
free((void *) pls->BaseName);
- if ((pls->BaseName = (char *) malloc(10 + strlen(fnam)))==NULL)
+ if ((pls->BaseName = (char *) malloc(maxlen))==NULL)
{
plexit("plP_sfnam: Insufficient memory");
}
- strcpy(pls->BaseName, fnam);
+ strncpy(pls->BaseName, fnam, maxlen);
}
/*--------------------------------------------------------------------------*\
Modified: trunk/src/plfreetype.c
===================================================================
--- trunk/src/plfreetype.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plfreetype.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -600,7 +600,7 @@
char WINDIR_PATH[255];
char *b;
b=getenv("WINDIR");
- strcpy(WINDIR_PATH,b);
+ strncpy(WINDIR_PATH,b,255);
#else
const char *default_unix_font_dir=PL_FREETYPE_FONT_DIR;
#endif
@@ -647,7 +647,7 @@
}
else
{
- strcat(WINDIR_PATH,"\\fonts\\arial.ttf");
+ strncat(WINDIR_PATH,"\\fonts\\arial.ttf",255);
if (access(WINDIR_PATH, F_OK)==0)
{
b=strrchr(WINDIR_PATH,'\\');
@@ -672,9 +672,9 @@
*/
if ((a = getenv("PLPLOT_FREETYPE_FONT_DIR")) != NULL)
- strcpy(font_dir,a);
+ strncpy(font_dir,a,1024);
else
- strcpy(font_dir,default_unix_font_dir);
+ strncpy(font_dir,default_unix_font_dir,1024);
#endif
@@ -701,23 +701,23 @@
#else
if ((a[0]=='/')||(a[0]=='~')) /* check for unix abs path */
#endif
- strcpy(FT->font_name[i],a);
+ strncpy(FT->font_name[i],a,1024);
else {
- strcpy(FT->font_name[i],font_dir);
- strcat(FT->font_name[i],a);
+ strncpy(FT->font_name[i],font_dir,1024);
+ strncat(FT->font_name[i],a,1024);
}
} else {
- strcpy(FT->font_name[i],font_dir);
- strcat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont);
+ strncpy(FT->font_name[i],font_dir,1024);
+ strncat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont,1024);
}
{
FILE *infile ;
if ( (infile=fopen(FT->font_name[i], "r"))==NULL) {
char msgbuf[1024];
- sprintf(msgbuf,
+ snprintf(msgbuf, 1024,
"plD_FreeType_init: Could not find the freetype compatible font:\n %s",
FT->font_name[i]);
plwarn(msgbuf);
Modified: trunk/src/plgridd.c
===================================================================
--- trunk/src/plgridd.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plgridd.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -759,7 +759,7 @@
/* Could pass extra args to qhull through the 'data' argument of
plgriddata() */
- sprintf(flags, "qhull d Qbb Qt");
+ strcpy(flags, "qhull d Qbb Qt", 250);
if ((points = (coordT *) malloc(npts * (dim+1) * sizeof(coordT)))==NULL)
{
Modified: trunk/src/plmap.c
===================================================================
--- trunk/src/plmap.c 2009-02-08 00:31:05 UTC (rev 9472)
+++ trunk/src/plmap.c 2009-02-08 20:44:22 UTC (rev 9473)
@@ -103,8 +103,8 @@
/*
* read map outline
*/
- strcpy(filename,type);
- strcat(filename,MAP_FILE);
+ strncpy(filename,type,100);
+ strncat(filename,MAP_FILE,100);
if ((in = plLibOpenPdfstrm(filename)) == NULL)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-02-08 22:26:50
|
Revision: 9476
http://plplot.svn.sourceforge.net/plplot/?rev=9476&view=rev
Author: andrewross
Date: 2009-02-08 22:26:44 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
strncpy does not guarantee that the destination string will be null terminated if the
source string is too long.
Modified Paths:
--------------
trunk/src/plargs.c
trunk/src/plbox.c
trunk/src/plcore.c
trunk/src/plctrl.c
trunk/src/plfreetype.c
trunk/src/plmap.c
Modified: trunk/src/plargs.c
===================================================================
--- trunk/src/plargs.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plargs.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -1668,6 +1668,7 @@
PLFLT xl, yl, xr, yr;
strncpy(opttmp, optarg, OPTMAX-1);
+ opttmp[OPTMAX-1] = '\0';
if ((field = strtok(opttmp, ",")) == NULL)
return 1;
@@ -2090,6 +2091,7 @@
/* Set up plplot dimensions */
strncpy(opttmp, optarg, OPTMAX-1);
+ opttmp[OPTMAX-1] = '\0';
if (strchr (opttmp, 'x')) {
/* -geometry WxH or -geometry WxH+Xoff+Yoff */
@@ -2162,6 +2164,7 @@
PLINT xwid = 0, ywid = 0, xoff = 0, yoff = 0;
strncpy(opttmp, optarg, OPTMAX-1);
+ opttmp[OPTMAX-1] = '\0';
if (strchr (opttmp, 'x')) {
field = strtok (opttmp, "x");
xdpi = atof (field);
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plbox.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -1428,6 +1428,7 @@
snprintf(form, FORMAT_LEN, "%%.%df", (int) prec);
snprintf(temp, TEMP_LEN, form, value);
- strncpy(string, temp, len);
+ strncpy(string, temp, len-1);
+ string[len-1] = '\0';
}
}
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plcore.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -683,6 +683,7 @@
if (ptr == NULL) {
char buf[BUFFER_SIZE];
strncpy (buf, string, 30);
+ buf[30] = '\0';
snprintf (buf, BUFFER_SIZE, "UTF-8 string is malformed: %s%s",
buf, strlen (string) > 30 ? "[...]" : "");
plabort (buf);
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plctrl.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -1619,12 +1619,12 @@
plFindName(char *p)
{
int n;
- char buf[1024], *cp;
+ char buf[PLPLOT_MAX_PATH], *cp;
extern int errno;
struct stat sbuf;
pldebug("plFindName", "Trying to find %s\n", p);
- while ((n = readlink(p, buf, 1024)) > 0) {
+ while ((n = readlink(p, buf, PLPLOT_MAX_PATH)) > 0) {
pldebug("plFindName", "Readlink read %d chars at: %s\n", n, p);
if (buf[0] == '/') {
/* Link is an absolute path */
@@ -1860,8 +1860,8 @@
if (suffix == NULL)
snprintf (pls->FileName, maxlen, "%s.%s", pls->BaseName, num);
else {
- strncpy (prefix, pls->BaseName, BUFFER_SIZE);
- prefix [suffix - pls->BaseName] = 0;
+ strncpy (prefix, pls->BaseName, BUFFER_SIZE-1);
+ prefix [(suffix - pls->BaseName<BUFFER_SIZE)?(suffix-pls->BaseName):BUFFER_SIZE-1] = '\0';
snprintf (pls->FileName, maxlen, "%s%s%s", prefix, num, suffix + 2);
}
@@ -1894,10 +1894,11 @@
suffix = strstr (fnam, "%n");
if (suffix == NULL)
- strncpy(pls->FileName, fnam, maxlen);
+ strncpy(pls->FileName, fnam, maxlen-1);
+ pls->FileName[maxlen-1] = '\0';
else {
- strncpy (prefix, fnam, BUFFER_SIZE);
- prefix [suffix - fnam] = 0;
+ strncpy (prefix, fnam, BUFFER_SIZE-1);
+ prefix [(suffix - fnam)<BUFFER_SIZE?(suffix-fnam):BUFFER_SIZE-1] = '\0';
snprintf (pls->FileName, maxlen, "%s%s", prefix, suffix + 2);
}
@@ -1909,7 +1910,8 @@
plexit("plP_sfnam: Insufficient memory");
}
- strncpy(pls->BaseName, fnam, maxlen);
+ strncpy(pls->BaseName, fnam, maxlen-1);
+ pls->BaseName[maxlen-1] = '\0';
}
/*--------------------------------------------------------------------------*\
Modified: trunk/src/plfreetype.c
===================================================================
--- trunk/src/plfreetype.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plfreetype.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -597,10 +597,11 @@
#if defined(MSDOS) || defined(WIN32)
static char *default_font_names[]={"arial.ttf","times.ttf","timesi.ttf","arial.ttf",
"symbol.ttf"};
- char WINDIR_PATH[255];
+ char WINDIR_PATH[PLPLOT_MAX_PATH];
char *b;
b=getenv("WINDIR");
- strncpy(WINDIR_PATH,b,255);
+ strncpy(WINDIR_PATH,b,PLPLOT_MAX_PATH-1);
+ WINDIR_PATH[PLPLOT_MAX_PATH-1] = '\0';
#else
const char *default_unix_font_dir=PL_FREETYPE_FONT_DIR;
#endif
@@ -647,7 +648,7 @@
}
else
{
- strncat(WINDIR_PATH,"\\fonts\\arial.ttf",255);
+ strncat(WINDIR_PATH,"\\fonts\\arial.ttf",PLPLOT_MAX_PATH);
if (access(WINDIR_PATH, F_OK)==0)
{
b=strrchr(WINDIR_PATH,'\\');
@@ -672,10 +673,11 @@
*/
if ((a = getenv("PLPLOT_FREETYPE_FONT_DIR")) != NULL)
- strncpy(font_dir,a,PLPLOT_MAX_PATH);
+ strncpy(font_dir,a,PLPLOT_MAX_PATH-1);
else
- strncpy(font_dir,default_unix_font_dir,PLPLOT_MAX_PATH);
+ strncpy(font_dir,default_unix_font_dir,PLPLOT_MAX_PATH-1);
+ font_dir[PLPLOT_MAX_PATH-1] = '\0';
#endif
/*
@@ -701,17 +703,18 @@
#else
if ((a[0]=='/')||(a[0]=='~')) /* check for unix abs path */
#endif
- strncpy(FT->font_name[i],a,PLPLOT_MAX_PATH);
+ strncpy(FT->font_name[i],a,PLPLOT_MAX_PATH-1);
else {
- strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH);
- strncat(FT->font_name[i],a,PLPLOT_MAX_PATH);
+ strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH-1);
+ strncat(FT->font_name[i],a,PLPLOT_MAX_PATH-1);
}
} else {
- strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH);
- strncat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont,PLPLOT_MAX_PATH);
+ strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH-1);
+ strncat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont,PLPLOT_MAX_PATH-1);
}
+ FT->font_name[i][PLPLOT_MAX_PATH-1] = '\0';
{
FILE *infile ;
Modified: trunk/src/plmap.c
===================================================================
--- trunk/src/plmap.c 2009-02-08 22:05:56 UTC (rev 9475)
+++ trunk/src/plmap.c 2009-02-08 22:26:44 UTC (rev 9476)
@@ -105,6 +105,7 @@
*/
strncpy(filename,type,100);
strncat(filename,MAP_FILE,100);
+ filename[99] = '\0';
if ((in = plLibOpenPdfstrm(filename)) == NULL)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-02-08 22:34:29
|
Revision: 9477
http://plplot.svn.sourceforge.net/plplot/?rev=9477&view=rev
Author: andrewross
Date: 2009-02-08 22:34:26 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
strncat specifies the maximum number of characters to add to the destination string, not
the total length of the destination string. It will be null-terminated though.
Modified Paths:
--------------
trunk/src/plcont.c
trunk/src/plfreetype.c
trunk/src/plmap.c
Modified: trunk/src/plcont.c
===================================================================
--- trunk/src/plcont.c 2009-02-08 22:26:44 UTC (rev 9476)
+++ trunk/src/plcont.c 2009-02-08 22:34:26 UTC (rev 9477)
@@ -354,7 +354,7 @@
snprintf(form, FORM_LEN, "%%.%df", prec-1);
snprintf(string, len, form, mant);
snprintf(tmpstring, TMPSTRING_LEN, "#(229)10#u%d", exponent);
- strncat(string, tmpstring, len);
+ strncat(string, tmpstring, len-strlen(string)-1);
if (abs(exponent) < limexp || value == 0.0) {
value = pow(10.0, exponent) * mant;
Modified: trunk/src/plfreetype.c
===================================================================
--- trunk/src/plfreetype.c 2009-02-08 22:26:44 UTC (rev 9476)
+++ trunk/src/plfreetype.c 2009-02-08 22:34:26 UTC (rev 9477)
@@ -648,7 +648,7 @@
}
else
{
- strncat(WINDIR_PATH,"\\fonts\\arial.ttf",PLPLOT_MAX_PATH);
+ strncat(WINDIR_PATH,"\\fonts\\arial.ttf",PLPLOT_MAX_PATH-1-strlen(WINDIR_PATH));
if (access(WINDIR_PATH, F_OK)==0)
{
b=strrchr(WINDIR_PATH,'\\');
@@ -707,12 +707,12 @@
else {
strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH-1);
- strncat(FT->font_name[i],a,PLPLOT_MAX_PATH-1);
+ strncat(FT->font_name[i],a,PLPLOT_MAX_PATH-1-strlen(FT->font_name[i]));
}
} else {
strncpy(FT->font_name[i],font_dir,PLPLOT_MAX_PATH-1);
- strncat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont,PLPLOT_MAX_PATH-1);
+ strncat(FT->font_name[i],(char *)TrueTypeLookup[i].pfont,PLPLOT_MAX_PATH-1-strlen(FT->font_name[i]));
}
FT->font_name[i][PLPLOT_MAX_PATH-1] = '\0';
Modified: trunk/src/plmap.c
===================================================================
--- trunk/src/plmap.c 2009-02-08 22:26:44 UTC (rev 9476)
+++ trunk/src/plmap.c 2009-02-08 22:34:26 UTC (rev 9477)
@@ -103,9 +103,9 @@
/*
* read map outline
*/
- strncpy(filename,type,100);
- strncat(filename,MAP_FILE,100);
+ strncpy(filename,type,99);
filename[99] = '\0';
+ strncat(filename,MAP_FILE,99-strlen(filename));
if ((in = plLibOpenPdfstrm(filename)) == NULL)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-02-21 00:32:29
|
Revision: 9568
http://plplot.svn.sourceforge.net/plplot/?rev=9568&view=rev
Author: airwin
Date: 2009-02-21 00:32:28 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
Set default time configuration for plinit and properly close qsastime library
for plend1.
Drop time configuration and closing of qsastime library from plbox.c.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/plcore.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-02-21 00:30:02 UTC (rev 9567)
+++ trunk/src/plbox.c 2009-02-21 00:32:28 UTC (rev 9568)
@@ -1251,10 +1251,8 @@
for (tn = tp; BETW(tn, vpwxmi, vpwxma); tn += xtick1) {
if (ldx) {
t = (double) tn;
- configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig));
ctimeqsas(1970,0,1,0,0,t,&tm, plsc->qsasconfig);
strfqsas(string, STRING_LEN, timefmt, tm, plsc->qsasconfig);
- closeqsas(&(plsc->qsasconfig));
}
else {
plform(tn, xscale, xprec, string, STRING_LEN, llx, lfx);
@@ -1302,10 +1300,8 @@
for (tn = tp; BETW(tn, vpwymi, vpwyma); tn += ytick1) {
if (ldy) {
t = (double) tn;
- configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig));
ctimeqsas(1970,0,1,0,0,t,&tm, plsc->qsasconfig);
strfqsas(string, STRING_LEN, timefmt, tm, plsc->qsasconfig);
- closeqsas(&(plsc->qsasconfig));
}
else {
plform(tn, yscale, yprec, string, STRING_LEN, lly, lfy);
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-21 00:30:02 UTC (rev 9567)
+++ trunk/src/plcore.c 2009-02-21 00:32:28 UTC (rev 9568)
@@ -1716,8 +1716,14 @@
plsc->zdigmax = 3;
if (plsc->timefmt == NULL)
- pltimefmt("%c");
+ c_pltimefmt("%c");
+ /* Default transformation between continuous and broken-down time
+ (and vice versa) defined here for PLplot. */
+ /* Temporarily the default is defined to be seconds past the Unix epoch. */
+ if (plsc->qsasconfig == NULL)
+ c_plconfigtime(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0.);
+
/* Switch to graphics mode and set color and arrow style*/
plgra();
@@ -1848,6 +1854,11 @@
if (plsc->timefmt) free_mem(plsc->timefmt);
+ /* Close qsastime library for this stream that was opened by
+ plconfigtime call in plinit. */
+
+ closeqsas(&(plsc->qsasconfig));
+
/* Free malloc'ed stream if not in initial stream, else clear it out */
if (ipls > 0) {
@@ -2957,17 +2968,6 @@
*p_prec = plsc->precis;
}
-void
-c_pltimefmt(const char *fmt)
-{
- if (plsc->timefmt)
- free_mem(plsc->timefmt);
-
- plsc->timefmt = (char *) malloc((size_t) (strlen(fmt)+1));
- strcpy(plsc->timefmt, fmt);
-
-}
-
const char *
plP_gtimefmt()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-02-21 16:20:21
|
Revision: 9572
http://plplot.svn.sourceforge.net/plplot/?rev=9572&view=rev
Author: airwin
Date: 2009-02-21 16:20:17 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
Handle default time transformation for PLplot in a more centralized
way.
Modified Paths:
--------------
trunk/src/plcore.c
trunk/src/pltime.c
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-21 07:48:29 UTC (rev 9571)
+++ trunk/src/plcore.c 2009-02-21 16:20:17 UTC (rev 9572)
@@ -1718,11 +1718,11 @@
if (plsc->timefmt == NULL)
c_pltimefmt("%c");
- /* Default transformation between continuous and broken-down time
- (and vice versa) defined here for PLplot. */
- /* Temporarily the default is defined to be seconds past the Unix epoch. */
+ /* Use default transformation between continuous and broken-down time
+ (and vice versa) if the transformation has not yet been defined
+ for this stream. */
if (plsc->qsasconfig == NULL)
- c_plconfigtime(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0.);
+ c_plconfigtime(0., 0., 0., 0x0, 0, 0, 0, 0, 0, 0, 0.);
/* Switch to graphics mode and set color and arrow style*/
Modified: trunk/src/pltime.c
===================================================================
--- trunk/src/pltime.c 2009-02-21 07:48:29 UTC (rev 9571)
+++ trunk/src/pltime.c 2009-02-21 16:20:17 UTC (rev 9572)
@@ -35,7 +35,15 @@
void
c_plconfigtime(PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec)
{
- configqsas(scale, offset1, offset2, ccontrol, ifbtime_offset, year, month, day, hour, min, sec, &(plsc->qsasconfig));
+ if(scale == 0.) {
+ /* Default transformation between continuous and broken-down time
+ (and vice versa) defined here for PLplot. */
+ /* Note the PLplot default is not necessarily the same as the
+ libqsastime default. */
+ configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig));
+ } else {
+ configqsas(scale, offset1, offset2, ccontrol, ifbtime_offset, year, month, day, hour, min, sec, &(plsc->qsasconfig));
+ }
}
/* Calculate continuous time from broken-down time for current stream. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-02-23 18:45:02
|
Revision: 9589
http://plplot.svn.sourceforge.net/plplot/?rev=9589&view=rev
Author: andrewross
Date: 2009-02-23 18:44:56 +0000 (Mon, 23 Feb 2009)
Log Message:
-----------
Correctly declare some global variables as static and remove other obsolete global
variables.
Thanks to Tony Allen for spotting these - apparently it caused problems on some Macs.
Modified Paths:
--------------
trunk/src/plcore.c
trunk/src/plctrl.c
trunk/src/plstripc.c
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-23 16:52:54 UTC (rev 9588)
+++ trunk/src/plcore.c 2009-02-23 18:44:56 UTC (rev 9589)
@@ -469,7 +469,7 @@
return(0);
}
-PLUNICODE unicode_buffer[1024];
+static PLUNICODE unicode_buffer[1024];
void
plP_text(PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y,
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2009-02-23 16:52:54 UTC (rev 9588)
+++ trunk/src/plctrl.c 2009-02-23 18:44:56 UTC (rev 9589)
@@ -69,7 +69,7 @@
static int
(*exit_handler) (const char *errormsg);
-void
+static void
(*abort_handler) (const char *errormsg);
static void
Modified: trunk/src/plstripc.c
===================================================================
--- trunk/src/plstripc.c 2009-02-23 16:52:54 UTC (rev 9588)
+++ trunk/src/plstripc.c 2009-02-23 18:44:56 UTC (rev 9589)
@@ -168,7 +168,6 @@
* during rescaling.
\*--------------------------------------------------------------------------*/
-PLFLT oxm,oxM, oym,oyM;
static void plstrip_gen( PLStrip *strip )
{
int i;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <sm...@us...> - 2009-03-16 15:29:17
|
Revision: 9747
http://plplot.svn.sourceforge.net/plplot/?rev=9747&view=rev
Author: smekal
Date: 2009-03-16 15:29:08 +0000 (Mon, 16 Mar 2009)
Log Message:
-----------
To get rid of Visual C++ warnings explicit type casts were added, unreferenced variables removed.
In addition hershey_to_unicode_lookup_table[jmid].Hershey was converted to signed integer in if clauses since we don't loose information - the number range is from 1 and 2932 at the moment.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/plcore.c
trunk/src/plline.c
trunk/src/plsym.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-03-16 15:25:43 UTC (rev 9746)
+++ trunk/src/plbox.c 2009-03-16 15:29:08 UTC (rev 9747)
@@ -389,8 +389,8 @@
/* Draw the horizontal axis */
if (lax) {
- plP_movphy(vppxmi, yp0);
- plP_draphy(vppxma, yp0);
+ plP_movphy(vppxmi, (PLINT)yp0);
+ plP_draphy(vppxma, (PLINT)yp0);
if (ltx) {
tp = xtick1 * floor(vpwxmi / xtick1);
for (;;) {
@@ -400,20 +400,20 @@
for (i = 0; i <= 7; i++) {
temp = tp + xlog[i];
if (BETW(temp, vpwxmi, vpwxma))
- plxtik(plP_wcpcx(temp), yp0, xminor, xminor);
+ plxtik(plP_wcpcx(temp), (PLINT)yp0, xminor, xminor);
}
}
else {
for (i = 1; i <= nxsub1 - 1; i++) {
temp = tp + i * xtick1 / nxsub1;
if (BETW(temp, vpwxmi, vpwxma))
- plxtik(plP_wcpcx(temp), yp0, xminor, xminor);
+ plxtik(plP_wcpcx(temp), (PLINT)yp0, xminor, xminor);
}
}
}
if (!BETW(tn, vpwxmi, vpwxma))
break;
- plxtik(plP_wcpcx(tn), yp0, xmajor, xmajor);
+ plxtik(plP_wcpcx(tn), (PLINT)yp0, xmajor, xmajor);
tp = tn;
}
}
@@ -422,8 +422,8 @@
/* Draw the vertical axis */
if (lay) {
- plP_movphy(xp0, vppymi);
- plP_draphy(xp0, vppyma);
+ plP_movphy((PLINT)xp0, vppymi);
+ plP_draphy((PLINT)xp0, vppyma);
if (lty) {
tp = ytick1 * floor(vpwymi / ytick1);
for (;;) {
@@ -433,20 +433,20 @@
for (i = 0; i <= 7; i++) {
temp = tp + xlog[i];
if (BETW(temp, vpwymi, vpwyma))
- plytik(xp0, plP_wcpcy(temp), yminor, yminor);
+ plytik((PLINT)xp0, plP_wcpcy(temp), yminor, yminor);
}
}
else {
for (i = 1; i <= nysub1 - 1; i++) {
temp = tp + i * ytick1 / nysub1;
if (BETW(temp, vpwymi, vpwyma))
- plytik(xp0, plP_wcpcy(temp), yminor, yminor);
+ plytik((PLINT)xp0, plP_wcpcy(temp), yminor, yminor);
}
}
}
if (!BETW(tn, vpwymi, vpwyma))
break;
- plytik(xp0, plP_wcpcy(tn), ymajor, ymajor);
+ plytik((PLINT)xp0, plP_wcpcy(tn), ymajor, ymajor);
tp = tn;
}
}
@@ -1203,7 +1203,6 @@
PLFLT pos, tn, tp, offset, height;
PLFLT factor, tstart;
const char *timefmt;
- double t;
/* Set plot options from input */
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-03-16 15:25:43 UTC (rev 9746)
+++ trunk/src/plcore.c 2009-03-16 15:29:08 UTC (rev 9747)
@@ -921,8 +921,8 @@
if (plsc->difilt & PLDI_MAP) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->dimxax * xscl[i] + plsc->dimxb;
- yscl[i] = plsc->dimyay * yscl[i] + plsc->dimyb;
+ xscl[i] = (PLINT)(plsc->dimxax * xscl[i] + plsc->dimxb);
+ yscl[i] = (PLINT)(plsc->dimyay * yscl[i] + plsc->dimyb);
}
}
@@ -930,8 +930,8 @@
if (plsc->difilt & PLDI_ORI) {
for (i = 0; i < npts; i++) {
- x = plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb;
- y = plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb;
+ x = (PLINT)(plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb);
+ y = (PLINT)(plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb);
xscl[i] = x;
yscl[i] = y;
}
@@ -941,8 +941,8 @@
if (plsc->difilt & PLDI_PLT) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->dipxax * xscl[i] + plsc->dipxb;
- yscl[i] = plsc->dipyay * yscl[i] + plsc->dipyb;
+ xscl[i] = (PLINT)(plsc->dipxax * xscl[i] + plsc->dipxb);
+ yscl[i] = (PLINT)(plsc->dipyay * yscl[i] + plsc->dipyb);
}
}
@@ -951,8 +951,8 @@
if (plsc->difilt & PLDI_DEV) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->didxax * xscl[i] + plsc->didxb;
- yscl[i] = plsc->didyay * yscl[i] + plsc->didyb;
+ xscl[i] = (PLINT)(plsc->didxax * xscl[i] + plsc->didxb);
+ yscl[i] = (PLINT)(plsc->didyay * yscl[i] + plsc->didyb);
}
*clpxmi = plsc->diclpxmi;
*clpxma = plsc->diclpxma;
@@ -978,8 +978,8 @@
if (plsc->difilt & PLDI_MAP) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->dimxax * xscl[i] + plsc->dimxb;
- yscl[i] = plsc->dimyay * yscl[i] + plsc->dimyb;
+ xscl[i] = (PLINT)(plsc->dimxax * xscl[i] + plsc->dimxb);
+ yscl[i] = (PLINT)(plsc->dimyay * yscl[i] + plsc->dimyb);
}
}
@@ -987,8 +987,8 @@
if (plsc->difilt & PLDI_ORI) {
for (i = 0; i < npts; i++) {
- x = plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb;
- y = plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb;
+ x = (PLINT)(plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb);
+ y = (PLINT)(plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb);
xscl[i] = x;
yscl[i] = y;
}
@@ -998,8 +998,8 @@
if (plsc->difilt & PLDI_PLT) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->dipxax * xscl[i] + plsc->dipxb;
- yscl[i] = plsc->dipyay * yscl[i] + plsc->dipyb;
+ xscl[i] = (PLINT)(plsc->dipxax * xscl[i] + plsc->dipxb);
+ yscl[i] = (PLINT)(plsc->dipyay * yscl[i] + plsc->dipyb);
}
}
@@ -1008,13 +1008,13 @@
if (plsc->difilt & PLDI_DEV) {
for (i = 0; i < npts; i++) {
- xscl[i] = plsc->didxax * xscl[i] + plsc->didxb;
- yscl[i] = plsc->didyay * yscl[i] + plsc->didyb;
+ xscl[i] = (PLINT)(plsc->didxax * xscl[i] + plsc->didxb);
+ yscl[i] = (PLINT)(plsc->didyay * yscl[i] + plsc->didyb);
}
- *clpxmi = plsc->diclpxmi;
- *clpxma = plsc->diclpxma;
- *clpymi = plsc->diclpymi;
- *clpyma = plsc->diclpyma;
+ *clpxmi = (PLINT)(plsc->diclpxmi);
+ *clpxma = (PLINT)(plsc->diclpxma);
+ *clpymi = (PLINT)(plsc->diclpymi);
+ *clpyma = (PLINT)(plsc->diclpyma);
}
else {
*clpxmi = plsc->phyxmi;
@@ -1111,10 +1111,10 @@
sxmax = (pxmax - plsc->didxb) / plsc->didxax;
symax = (pymax - plsc->didyb) / plsc->didyay;
- rxmin = plP_pcdcx(sxmin);
- rymin = plP_pcdcy(symin);
- rxmax = plP_pcdcx(sxmax);
- rymax = plP_pcdcy(symax);
+ rxmin = plP_pcdcx((PLINT)sxmin);
+ rymin = plP_pcdcy((PLINT)symin);
+ rxmax = plP_pcdcx((PLINT)sxmax);
+ rymax = plP_pcdcy((PLINT)symax);
*xmin = (rxmin < 0) ? 0 : rxmin;
*xmax = (rxmax > 1) ? 1 : rxmax;
@@ -1157,10 +1157,10 @@
sxmax = pxmax * plsc->didxax + plsc->didxb;
symax = pymax * plsc->didyay + plsc->didyb;
- rxmin = plP_pcdcx(sxmin);
- rymin = plP_pcdcy(symin);
- rxmax = plP_pcdcx(sxmax);
- rymax = plP_pcdcy(symax);
+ rxmin = plP_pcdcx((PLINT)sxmin);
+ rymin = plP_pcdcy((PLINT)symin);
+ rxmax = plP_pcdcx((PLINT)sxmax);
+ rymax = plP_pcdcy((PLINT)symax);
*xmin = (rxmin < 0) ? 0 : rxmin;
*xmax = (rxmax > 1) ? 1 : rxmax;
@@ -1377,10 +1377,10 @@
/* Set clip limits to conform to new page size */
- plsc->diclpxmi = plsc->didxax * plsc->phyxmi + plsc->didxb;
- plsc->diclpxma = plsc->didxax * plsc->phyxma + plsc->didxb;
- plsc->diclpymi = plsc->didyay * plsc->phyymi + plsc->didyb;
- plsc->diclpyma = plsc->didyay * plsc->phyyma + plsc->didyb;
+ plsc->diclpxmi = (PLINT)(plsc->didxax * plsc->phyxmi + plsc->didxb);
+ plsc->diclpxma = (PLINT)(plsc->didxax * plsc->phyxma + plsc->didxb);
+ plsc->diclpymi = (PLINT)(plsc->didyay * plsc->phyymi + plsc->didyb);
+ plsc->diclpyma = (PLINT)(plsc->didyay * plsc->phyyma + plsc->didyb);
}
/*--------------------------------------------------------------------------*\
@@ -3362,8 +3362,8 @@
{
plsc->xpmm = xpmm;
plsc->ypmm = ypmm;
- plsc->umx = 1000.0 / plsc->xpmm;
- plsc->umy = 1000.0 / plsc->ypmm;
+ plsc->umx = (PLINT)(1000.0 / plsc->xpmm);
+ plsc->umy = (PLINT)(1000.0 / plsc->ypmm);
}
/* Sets up physical limits of plotting device. */
Modified: trunk/src/plline.c
===================================================================
--- trunk/src/plline.c 2009-03-16 15:25:43 UTC (rev 9746)
+++ trunk/src/plline.c 2009-03-16 15:29:08 UTC (rev 9747)
@@ -177,8 +177,8 @@
v0 = plP_wcpcy(plP_w3wcy( p0[0], p0[1], p0[2] ));
u1 = plP_wcpcx(plP_w3wcx( p1[0], p1[1], p1[2] ));
v1 = plP_wcpcy(plP_w3wcy( p1[0], p1[1], p1[2] ));
- plP_movphy(u0,v0);
- plP_draphy(u1,v1);
+ plP_movphy((PLINT)u0,(PLINT)v0);
+ plP_draphy((PLINT)u1,(PLINT)v1);
}
}
return;
@@ -315,8 +315,8 @@
v0 = plP_wcpcy(plP_w3wcy( p0[0], p0[1], p0[2] ));
u1 = plP_wcpcx(plP_w3wcx( p1[0], p1[1], p1[2] ));
v1 = plP_wcpcy(plP_w3wcy( p1[0], p1[1], p1[2] ));
- plP_movphy(u0,v0);
- plP_draphy(u1,v1);
+ plP_movphy((PLINT)u0,(PLINT)v0);
+ plP_draphy((PLINT)u1,(PLINT)v1);
}
}
return;
@@ -1251,7 +1251,7 @@
nxstep = nxp * plsc->umx;
nystep = nyp * plsc->umy;
- tstep = sqrt( nxstep * nxstep + nystep * nystep ) / modulo;
+ tstep = (PLINT)(sqrt( nxstep * nxstep + nystep * nystep ) / modulo);
if (tstep < 1) tstep = 1;
/* tstep is distance per pixel moved */
Modified: trunk/src/plsym.c
===================================================================
--- trunk/src/plsym.c 2009-03-16 15:25:43 UTC (rev 9746)
+++ trunk/src/plsym.c 2009-03-16 15:29:08 UTC (rev 9747)
@@ -176,8 +176,8 @@
z[i] >= zmin && z[i] <= zmax) {
u = plP_wcpcx(plP_w3wcx( x[i], y[i], z[i] ));
v = plP_wcpcy(plP_w3wcy( x[i], y[i], z[i] ));
- plP_movphy(u,v);
- plP_draphy(u,v);
+ plP_movphy((PLINT)u,(PLINT)v);
+ plP_draphy((PLINT)u,(PLINT)v);
}
}
}
@@ -192,7 +192,7 @@
z[i] >= zmin && z[i] <= zmax) {
u = plP_wcpcx(plP_w3wcx( x[i], y[i], z[i] ));
v = plP_wcpcy(plP_w3wcy( x[i], y[i], z[i] ));
- plhrsh(sym, u, v);
+ plhrsh(sym, (PLINT)u, (PLINT)v);
}
}
}
@@ -1174,9 +1174,12 @@
* jlo < jmid < jhi and jmid must be in valid range.
*/
jmid = (jlo+jhi)/2;
- if (in > hershey_to_unicode_lookup_table[jmid].Hershey)
+ /* convert hershey_to_unicode_lookup_table[jmid].Hershey to signed
+ integer since we don't loose information - the number range
+ is from 1 and 2932 at the moment */
+ if (in > (int)(hershey_to_unicode_lookup_table[jmid].Hershey))
jlo = jmid;
- else if (in < hershey_to_unicode_lookup_table[jmid].Hershey)
+ else if (in < (int)(hershey_to_unicode_lookup_table[jmid].Hershey))
jhi = jmid;
else
/* We have found it!
@@ -1370,8 +1373,8 @@
* The calculation is also dependent of the orientation
* (perpendicular or parallel) of the text. */
- xpc = plP_dcmmx(plP_pcdcx(xpc));
- ypc = plP_dcmmy(plP_pcdcy(ypc)) - dispy;
+ xpc = plP_dcmmx(plP_pcdcx((PLINT)xpc));
+ ypc = plP_dcmmy(plP_pcdcy((PLINT)ypc)) - dispy;
shift = plstrl(text) * just;
@@ -1397,7 +1400,7 @@
xform[1] = -cos(theta);
xform[2] = 1.0;
xform[3] = -sin(theta);
- plP_text(0, just, xform, xpc, ypc, xrefpc, yrefpc, text);
+ plP_text(0, just, xform, (PLINT)xpc, (PLINT)ypc, (PLINT)xrefpc, (PLINT)yrefpc, text);
}
/* parallel, rotate & shear by angle */
@@ -1407,7 +1410,7 @@
xform[2] = sin(theta);
xform[3] = 1.0;
- plP_text(0, just, xform, xpc, ypc, xrefpc, yrefpc, text);
+ plP_text(0, just, xform, (PLINT)xpc, (PLINT)ypc, (PLINT)xrefpc, (PLINT)yrefpc, text);
}
}
@@ -1532,8 +1535,8 @@
/* 4. Compute the reference point. */
- xpc = plP_dcmmx(plP_pcdcx(xpc)) + dispx;
- ypc = plP_dcmmy(plP_pcdcy(ypc)) + dispy;
+ xpc = plP_dcmmx(plP_pcdcx((PLINT)xpc)) + dispx;
+ ypc = plP_dcmmy(plP_pcdcy((PLINT)ypc)) + dispy;
shift = plstrl(text) * just;
@@ -1558,7 +1561,7 @@
xform[2] = sin(theta);
xform[3] = 1.0;
- plP_text(0, just, xform, xpc, ypc, xrefpc, yrefpc, text);
+ plP_text(0, just, xform, (PLINT)xpc, (PLINT)ypc, (PLINT)xrefpc, (PLINT)yrefpc, text);
}
else {
@@ -1567,7 +1570,7 @@
xform[2] = 1.0;
xform[3] = -sin(theta);
- plP_text(0, just, xform, xpc, ypc, xrefpc, yrefpc, text);
+ plP_text(0, just, xform, (PLINT)xpc, (PLINT)ypc, (PLINT)xrefpc, (PLINT)yrefpc, text);
}
}
@@ -1655,8 +1658,8 @@
stride = stride/sqrt(x_dx*x_dx + y_dy*y_dy + z_dz*z_dz);
/* compute the reference point */
- xpc = plP_dcmmx(plP_pcdcx(xpc));
- ypc = plP_dcmmy(plP_pcdcy(ypc));
+ xpc = plP_dcmmx(plP_pcdcx((PLINT)xpc));
+ ypc = plP_dcmmy(plP_pcdcy((PLINT)ypc));
shift = plstrl(text) * just;
xrefpc = xpc - cos(theta) * shift;
@@ -1673,7 +1676,7 @@
xform[2] = sin(theta) * stride;
xform[3] = sin(theta) * sin(phi) + cos(theta) * cos(phi);
- plP_text(0, just, xform, xpc, ypc, xrefpc, yrefpc, text);
+ plP_text(0, just, xform, (PLINT)xpc, (PLINT)ypc, (PLINT)xrefpc, (PLINT)yrefpc, text);
}
/*------------------------------------------------------------------------*\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2009-03-19 12:10:18
|
Revision: 9757
http://plplot.svn.sourceforge.net/plplot/?rev=9757&view=rev
Author: smekal
Date: 2009-03-19 12:10:17 +0000 (Thu, 19 Mar 2009)
Log Message:
-----------
Borland C++ needs a '_' in front of a symbol. ltdl_win32 takes care of that automatically.
To get rid of Visual C++ warnings explicit type casts were added in pdfutils.c.
Modified Paths:
--------------
trunk/src/ltdl_win32.c
trunk/src/pdfutils.c
Modified: trunk/src/ltdl_win32.c
===================================================================
--- trunk/src/ltdl_win32.c 2009-03-19 12:08:53 UTC (rev 9756)
+++ trunk/src/ltdl_win32.c 2009-03-19 12:10:17 UTC (rev 9757)
@@ -89,9 +89,22 @@
/* load symbol from library */
void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol )
{
- if( dlhandle->hinstLib )
+ if( dlhandle->hinstLib ) {
+#ifdef __BORLANDC__
+ unsigned int bufferLength = strlen(symbol)+2;
+ char* buffer = (char*)malloc(bufferLength);
+ void* retPointer;
+
+ buffer[0]='_';
+ strncpy( &buffer[1], symbol, bufferLength-2 );
+ buffer[bufferLength-1]='\0';
+ retPointer=GetProcAddress( dlhandle->hinstLib, buffer );
+ free(buffer);
+ return retPointer;
+#else
return GetProcAddress( dlhandle->hinstLib, symbol );
- else
+#endif
+ } else
return NULL;
}
Modified: trunk/src/pdfutils.c
===================================================================
--- trunk/src/pdfutils.c 2009-03-19 12:08:53 UTC (rev 9756)
+++ trunk/src/pdfutils.c 2009-03-19 12:10:17 UTC (rev 9757)
@@ -723,7 +723,8 @@
value = 0;
return (pdf_wr_4bytes(pdfs, value));
}
- fsgl = fdbl = f;
+ fdbl = f;
+ fsgl = (float)fdbl;
fmant = frexp(fdbl, &exp);
if (fmant < 0)
@@ -738,13 +739,13 @@
if (e_new < 1 - bias) {
e_off = e_new - (1 - bias);
e_ieee = 0;
- f_tmp = f_new * pow((double) 2.0, (double) e_off);
+ f_tmp = (float)(f_new * pow((double) 2.0, (double) e_off));
}
else {
e_ieee = e_new + bias;
- f_tmp = f_new - 1;
+ f_tmp = (float)(f_new - 1);
}
- f_ieee = f_tmp * 8388608; /* multiply by 2^23 */
+ f_ieee = (U_LONG)(f_tmp * 8388608); /* multiply by 2^23 */
if (e_ieee > 255) {
if (debug)
@@ -800,7 +801,7 @@
f_new = 1.0 + f_tmp;
}
- fsgl = f_new * pow(2.0, (double) exp);
+ fsgl = (float)(f_new * pow(2.0, (double) exp));
if (s_ieee == 1)
fsgl = -fsgl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hba...@us...> - 2009-04-26 20:01:34
|
Revision: 9856
http://plplot.svn.sourceforge.net/plplot/?rev=9856&view=rev
Author: hbabcock
Date: 2009-04-26 20:01:32 +0000 (Sun, 26 Apr 2009)
Log Message:
-----------
Added the new unicode text handling esc codes to the list of esc codes that are buffered by plbuf. Changed plysm to use the new unicode text handling pathway when requested by the driver.
Modified Paths:
--------------
trunk/src/plbuf.c
trunk/src/plsym.c
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2009-04-26 19:15:03 UTC (rev 9855)
+++ trunk/src/plbuf.c 2009-04-26 20:01:32 UTC (rev 9856)
@@ -308,6 +308,49 @@
}
/*--------------------------------------------------------------------------*\
+ * plbuf_text_unicode()
+ *
+ * Handle text buffering for the new unicode pathway.
+\*--------------------------------------------------------------------------*/
+
+static void
+plbuf_text_unicode(PLStream *pls, EscText *text)
+{
+ PLUNICODE fci;
+
+ dbug_enter("plbuf_text");
+
+ /* Retrieve the font characterization integer */
+ plgfci(&fci);
+
+ /* Write the text information */
+
+ wr_data(pls, &fci, sizeof(PLUNICODE));
+
+ wr_data(pls, &pls->chrht, sizeof(PLFLT));
+ wr_data(pls, &pls->diorot, sizeof(PLFLT));
+ wr_data(pls, &pls->clpxmi, sizeof(PLFLT));
+ wr_data(pls, &pls->clpxma, sizeof(PLFLT));
+ wr_data(pls, &pls->clpymi, sizeof(PLFLT));
+ wr_data(pls, &pls->clpyma, sizeof(PLFLT));
+
+ wr_data(pls, &text->base, sizeof(PLINT));
+ wr_data(pls, &text->just, sizeof(PLFLT));
+ wr_data(pls, text->xform, sizeof(PLFLT) * 4);
+ wr_data(pls, &text->x, sizeof(PLINT));
+ wr_data(pls, &text->y, sizeof(PLINT));
+ wr_data(pls, &text->refx, sizeof(PLINT));
+ wr_data(pls, &text->refy, sizeof(PLINT));
+
+ wr_data(pls, &text->n_fci, sizeof(PLUNICODE));
+ wr_data(pls, &text->n_char, sizeof(PLUNICODE));
+ wr_data(pls, &text->n_ctrl_char, sizeof(PLINT));
+
+ wr_data(pls, &text->unicode_array_len, sizeof(PLINT));
+}
+
+
+/*--------------------------------------------------------------------------*\
* plbuf_esc()
*
* Escape function. Note that any data written must be in device
@@ -344,6 +387,12 @@
if(ptr!=NULL) /* Check required by GCW driver, please don't remove */
plbuf_text(pls, (EscText *) ptr);
break;
+ case PLESC_BEGIN_TEXT:
+ case PLESC_TEXT_CHAR:
+ case PLESC_CONTROL_CHAR:
+ case PLESC_END_TEXT:
+ plbuf_text_unicode(pls, (EscText *) ptr);
+ break;
}
}
@@ -568,8 +617,12 @@
*
* PLESC_FILL Fill polygon
* PLESC_SWIN Set plot window parameters
- * PLESC_IMAGE Draw image
- * PLESC_HAS_TEXT Draw PostScript text
+ * PLESC_IMAGE Draw image
+ * PLESC_HAS_TEXT Draw PostScript text
+ * PLESC_BEGIN_TEXT Commands for the alternative unicode text handling path
+ * PLESC_TEXT_CHAR
+ * PLESC_CONTROL_CHAR
+ * PLESC_END_TEXT
* PLESC_CLEAR Clear Background
\*--------------------------------------------------------------------------*/
@@ -580,6 +633,9 @@
rdbuf_text(PLStream *pls);
static void
+rdbuf_text_unicode(PLINT op, PLStream *pls);
+
+static void
rdbuf_esc(PLStream *pls)
{
U_CHAR op;
@@ -601,10 +657,16 @@
case PLESC_HAS_TEXT:
rdbuf_text(pls);
break;
+ case PLESC_BEGIN_TEXT:
+ case PLESC_TEXT_CHAR:
+ case PLESC_CONTROL_CHAR:
+ case PLESC_END_TEXT:
+ rdbuf_text_unicode(op, pls);
+ break;
case PLESC_CLEAR:
plP_esc(PLESC_CLEAR,NULL);
break;
- }
+ }
}
/*--------------------------------------------------------------------------*\
@@ -762,6 +824,54 @@
}
/*--------------------------------------------------------------------------*\
+ * rdbuf_text_unicode()
+ *
+ * Draw text for the new unicode handling pathway.
+\*--------------------------------------------------------------------------*/
+
+static void
+rdbuf_text_unicode(PLINT op, PLStream *pls)
+{
+ PLUNICODE(fci);
+ EscText text;
+ PLFLT xform[4];
+ PLUNICODE* unicode;
+
+ text.xform = xform;
+
+
+ /* Read in the data */
+
+ rd_data(pls, &fci, sizeof(PLUNICODE));
+
+ rd_data(pls, &pls->chrht, sizeof(PLFLT));
+ rd_data(pls, &pls->diorot, sizeof(PLFLT));
+ rd_data(pls, &pls->clpxmi, sizeof(PLFLT));
+ rd_data(pls, &pls->clpxma, sizeof(PLFLT));
+ rd_data(pls, &pls->clpymi, sizeof(PLFLT));
+ rd_data(pls, &pls->clpyma, sizeof(PLFLT));
+
+ rd_data(pls, &text.base, sizeof(PLINT));
+ rd_data(pls, &text.just, sizeof(PLFLT));
+ rd_data(pls, text.xform, sizeof(PLFLT) * 4);
+ rd_data(pls, &text.x, sizeof(PLINT));
+ rd_data(pls, &text.y, sizeof(PLINT));
+ rd_data(pls, &text.refx, sizeof(PLINT));
+ rd_data(pls, &text.refy, sizeof(PLINT));
+
+ rd_data(pls, &text.n_fci, sizeof(PLUNICODE));
+ rd_data(pls, &text.n_char, sizeof(PLUNICODE));
+ rd_data(pls, &text.n_ctrl_char, sizeof(PLINT));
+
+ rd_data(pls, &text.unicode_array_len, sizeof(PLINT));
+
+ if(pls->dev_unicode) {
+ plsfci(fci);
+ plP_esc(op,&text);
+ }
+}
+
+/*--------------------------------------------------------------------------*\
* plRemakePlot()
*
* Rebuilds plot from plot buffer, usually in response to a window
Modified: trunk/src/plsym.c
===================================================================
--- trunk/src/plsym.c 2009-04-26 19:15:03 UTC (rev 9855)
+++ trunk/src/plsym.c 2009-04-26 20:01:32 UTC (rev 9856)
@@ -285,7 +285,15 @@
plsc->chrht=plsc->symht;
plsc->chrdef=plsc->symdef;
- plP_esc(PLESC_HAS_TEXT, &args);
+ if (plsc->alt_unicode){
+ args.n_fci = fci;
+ args.n_char = unicode_char;
+ plP_esc(PLESC_BEGIN_TEXT, &args);
+ plP_esc(PLESC_TEXT_CHAR, &args);
+ plP_esc(PLESC_END_TEXT, &args);
+ } else {
+ plP_esc(PLESC_HAS_TEXT, &args);
+ }
plsc->chrht=plsc->original_chrht;
plsc->chrdef=plsc->original_chrdef;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-09-23 09:36:55
|
Revision: 10457
http://plplot.svn.sourceforge.net/plplot/?rev=10457&view=rev
Author: andrewross
Date: 2009-09-23 09:36:41 +0000 (Wed, 23 Sep 2009)
Log Message:
-----------
Large patch to standardise the coding style in src/ using uncrustify. This is entirely cosmetic with no code changes.
This required a small amount of hand editing of multi-line #define statements. Now this has been done you can safely run uncrustify again without upsetting the results.
Modified Paths:
--------------
trunk/src/ltdl_win32.c
trunk/src/mt19937ar.c
trunk/src/mt19937ar.h
trunk/src/pdfutils.c
trunk/src/plarc.c
trunk/src/plargs.c
trunk/src/plbox.c
trunk/src/plbuf.c
trunk/src/plcont.c
trunk/src/plcore.c
trunk/src/plctrl.c
trunk/src/plcvt.c
trunk/src/pldeprecated.c
trunk/src/pldtik.c
trunk/src/plfill.c
trunk/src/plfreetype.c
trunk/src/plgridd.c
trunk/src/plhist.c
trunk/src/plimage.c
trunk/src/plline.c
trunk/src/plmap.c
trunk/src/plot3d.c
trunk/src/plsdef.c
trunk/src/plshade.c
trunk/src/plstdio.c
trunk/src/plstripc.c
trunk/src/plsym.c
trunk/src/pltick.c
trunk/src/pltime.c
trunk/src/plvect.c
trunk/src/plvpor.c
trunk/src/plwind.c
Modified: trunk/src/ltdl_win32.c
===================================================================
--- trunk/src/ltdl_win32.c 2009-09-22 14:37:18 UTC (rev 10456)
+++ trunk/src/ltdl_win32.c 2009-09-23 09:36:41 UTC (rev 10457)
@@ -1,34 +1,34 @@
/* $Id$
+ *
+ * Contains all prototypes for driver functions.
+ *
+ * Copyright (C) 2008 Werner Smekal
+ *
+ * This file is part of PLplot.
+ *
+ * PLplot is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PLplot is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with PLplot; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
- Contains all prototypes for driver functions.
-
- Copyright (C) 2008 Werner Smekal
-
- This file is part of PLplot.
-
- PLplot is free software; you can redistribute it and/or modify
- it under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PLplot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with PLplot; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-*/
-
#include <windows.h>
#include <stdlib.h>
#include "ltdl_win32.h"
/* (static) pointer to the last handle, which contains a pointer
- to a possible previous handle */
-lt_dlhandle lastHandle=NULL;
+ * to a possible previous handle */
+lt_dlhandle lastHandle = NULL;
/* buffer for error messages */
char errortext[512];
@@ -37,74 +37,77 @@
/* initialise variables */
void lt_dlinit( void )
{
- lastHandle=NULL;
+ lastHandle = NULL;
}
/* on exit free library handles and release allocate memory */
void lt_dlexit( void )
{
- lt_dlhandle prev;
-
- while( lastHandle!=NULL ) {
- if( lastHandle->hinstLib )
- FreeLibrary( lastHandle->hinstLib );
- prev=lastHandle->previousHandle;
- free( lastHandle );
- lastHandle=prev;
- }
+ lt_dlhandle prev;
+
+ while ( lastHandle != NULL )
+ {
+ if ( lastHandle->hinstLib )
+ FreeLibrary( lastHandle->hinstLib );
+ prev = lastHandle->previousHandle;
+ free( lastHandle );
+ lastHandle = prev;
+ }
}
/* try to open shared library with given dllname. If there is
- no extension given LoadLibrary() assumes .dll. The library
- must be somewhere in the path or in the current directory. */
+ * no extension given LoadLibrary() assumes .dll. The library
+ * must be somewhere in the path or in the current directory. */
lt_dlhandle lt_dlopenext( char* dllname )
{
- lt_dlhandle dlhandle=malloc( sizeof(struct __dlhandle) );
- memset( dlhandle, '\0', sizeof(struct __dlhandle) );
+ lt_dlhandle dlhandle = malloc( sizeof ( struct __dlhandle ));
+ memset( dlhandle, '\0', sizeof ( struct __dlhandle ));
- dlhandle->hinstLib = LoadLibrary( dllname );
- if( !dlhandle->hinstLib ) {
- free( dlhandle );
- return NULL;
- }
+ dlhandle->hinstLib = LoadLibrary( dllname );
+ if ( !dlhandle->hinstLib )
+ {
+ free( dlhandle );
+ return NULL;
+ }
- dlhandle->previousHandle = lastHandle;
- lastHandle = dlhandle;
-
- return dlhandle;
+ dlhandle->previousHandle = lastHandle;
+ lastHandle = dlhandle;
+
+ return dlhandle;
}
/* return last error occured. Needs some work :). */
const char* lt_dlerror()
{
- strncpy( errortext, "No error information", 512 );
-
- return errortext;
+ strncpy( errortext, "No error information", 512 );
+
+ return errortext;
}
/* load symbol from library */
void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol )
{
- if( dlhandle->hinstLib ) {
-#ifdef __BORLANDC__
- unsigned int bufferLength = strlen(symbol)+2;
- char* buffer = (char*)malloc(bufferLength);
- void* retPointer;
-
- buffer[0]='_';
- strncpy( &buffer[1], symbol, bufferLength-2 );
- buffer[bufferLength-1]='\0';
- retPointer=GetProcAddress( dlhandle->hinstLib, buffer );
- free(buffer);
- return retPointer;
+ if ( dlhandle->hinstLib )
+ {
+#ifdef __BORLANDC__
+ unsigned int bufferLength = strlen( symbol ) + 2;
+ char * buffer = (char*) malloc( bufferLength );
+ void * retPointer;
+
+ buffer[0] = '_';
+ strncpy( &buffer[1], symbol, bufferLength - 2 );
+ buffer[bufferLength - 1] = '\0';
+ retPointer = GetProcAddress( dlhandle->hinstLib, buffer );
+ free( buffer );
+ return retPointer;
#else
- return GetProcAddress( dlhandle->hinstLib, symbol );
+ return GetProcAddress( dlhandle->hinstLib, symbol );
#endif
- } else
- return NULL;
-
+ }
+ else
+ return NULL;
}
Modified: trunk/src/mt19937ar.c
===================================================================
--- trunk/src/mt19937ar.c 2009-09-22 14:37:18 UTC (rev 10456)
+++ trunk/src/mt19937ar.c 2009-09-23 09:36:41 UTC (rev 10457)
@@ -1,68 +1,69 @@
-/*
- A C-program for MT19937, with initialization improved 2002/1/26.
- Coded by Takuji Nishimura and Makoto Matsumoto.
+/*
+ * A C-program for MT19937, with initialization improved 2002/1/26.
+ * Coded by Takuji Nishimura and Makoto Matsumoto.
+ *
+ * Before using, initialize the state by using init_genrand(seed)
+ * or init_by_array(init_key, key_length).
+ *
+ * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+ * All rights reserved.
+ * Copyright (C) 2005, Mutsuo Saito,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. The names of its contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Any feedback is very welcome.
+ * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+ */
- Before using, initialize the state by using init_genrand(seed)
- or init_by_array(init_key, key_length).
-
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
- Copyright (C) 2005, Mutsuo Saito,
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
- Any feedback is very welcome.
- http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
- email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
-*/
-
#include <stdio.h>
#include "mt19937ar.h"
-/* Period parameters */
-#define N 624
-#define M 397
-#define MATRIX_A 0x9908b0dfUL /* constant vector a */
-#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
-#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
+/* Period parameters */
+#define N 624
+#define M 397
+#define MATRIX_A 0x9908b0dfUL /* constant vector a */
+#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
+#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
-static unsigned long mt[N]; /* the array for the state vector */
-static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
+static unsigned long mt[N]; /* the array for the state vector */
+static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */
/* initializes mt[N] with a seed */
-void init_genrand(unsigned long s)
+void init_genrand( unsigned long s )
{
- mt[0]= s & 0xffffffffUL;
- for (mti=1; mti<N; mti++) {
- mt[mti] =
- (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
+ mt[0] = s & 0xffffffffUL;
+ for ( mti = 1; mti < N; mti++ )
+ {
+ mt[mti] =
+ ( 1812433253UL * ( mt[mti - 1] ^ ( mt[mti - 1] >> 30 )) + mti );
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array mt[]. */
@@ -76,100 +77,111 @@
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
-void init_by_array(unsigned long init_key[], int key_length)
+void init_by_array( unsigned long init_key[], int key_length )
{
int i, j, k;
- init_genrand(19650218UL);
- i=1; j=0;
- k = (N>key_length ? N : key_length);
- for (; k; k--) {
- mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
- + init_key[j] + j; /* non linear */
- mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
+ init_genrand( 19650218UL );
+ i = 1; j = 0;
+ k = ( N > key_length ? N : key_length );
+ for (; k; k-- )
+ {
+ mt[i] = ( mt[i] ^ (( mt[i - 1] ^ ( mt[i - 1] >> 30 )) * 1664525UL ))
+ + init_key[j] + j; /* non linear */
+ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++; j++;
- if (i>=N) { mt[0] = mt[N-1]; i=1; }
- if (j>=key_length) j=0;
+ if ( i >= N )
+ {
+ mt[0] = mt[N - 1]; i = 1;
+ }
+ if ( j >= key_length ) j = 0;
}
- for (k=N-1; k; k--) {
- mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
- - i; /* non linear */
+ for ( k = N - 1; k; k-- )
+ {
+ mt[i] = ( mt[i] ^ (( mt[i - 1] ^ ( mt[i - 1] >> 30 )) * 1566083941UL ))
+ - i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
- if (i>=N) { mt[0] = mt[N-1]; i=1; }
+ if ( i >= N )
+ {
+ mt[0] = mt[N - 1]; i = 1;
+ }
}
- mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
+ mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0,0xffffffff]-interval */
-unsigned long genrand_int32(void)
+unsigned long genrand_int32( void )
{
- unsigned long y;
- static unsigned long mag01[2]={0x0UL, MATRIX_A};
+ unsigned long y;
+ static unsigned long mag01[2] = { 0x0UL, MATRIX_A };
/* mag01[x] = x * MATRIX_A for x=0,1 */
- if (mti >= N) { /* generate N words at one time */
+ if ( mti >= N ) /* generate N words at one time */
+ {
int kk;
- if (mti == N+1) /* if init_genrand() has not been called, */
- init_genrand(5489UL); /* a default initial seed is used */
+ if ( mti == N + 1 ) /* if init_genrand() has not been called, */
+ init_genrand( 5489UL ); /* a default initial seed is used */
- for (kk=0;kk<N-M;kk++) {
- y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
- mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ for ( kk = 0; kk < N - M; kk++ )
+ {
+ y = ( mt[kk] & UPPER_MASK ) | ( mt[kk + 1] & LOWER_MASK );
+ mt[kk] = mt[kk + M] ^ ( y >> 1 ) ^ mag01[y & 0x1UL];
}
- for (;kk<N-1;kk++) {
- y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
- mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ for (; kk < N - 1; kk++ )
+ {
+ y = ( mt[kk] & UPPER_MASK ) | ( mt[kk + 1] & LOWER_MASK );
+ mt[kk] = mt[kk + ( M - N )] ^ ( y >> 1 ) ^ mag01[y & 0x1UL];
}
- y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
- mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ y = ( mt[N - 1] & UPPER_MASK ) | ( mt[0] & LOWER_MASK );
+ mt[N - 1] = mt[M - 1] ^ ( y >> 1 ) ^ mag01[y & 0x1UL];
mti = 0;
}
-
+
y = mt[mti++];
/* Tempering */
- y ^= (y >> 11);
- y ^= (y << 7) & 0x9d2c5680UL;
- y ^= (y << 15) & 0xefc60000UL;
- y ^= (y >> 18);
+ y ^= ( y >> 11 );
+ y ^= ( y << 7 ) & 0x9d2c5680UL;
+ y ^= ( y << 15 ) & 0xefc60000UL;
+ y ^= ( y >> 18 );
return y;
}
/* generates a random number on [0,0x7fffffff]-interval */
-long genrand_int31(void)
+long genrand_int31( void )
{
- return (long)(genrand_int32()>>1);
+ return (long) ( genrand_int32() >> 1 );
}
/* generates a random number on [0,1]-real-interval */
-double genrand_real1(void)
+double genrand_real1( void )
{
- return genrand_int32()*(1.0/4294967295.0);
- /* divided by 2^32-1 */
+ return genrand_int32() * ( 1.0 / 4294967295.0 );
+ /* divided by 2^32-1 */
}
/* generates a random number on [0,1)-real-interval */
-double genrand_real2(void)
+double genrand_real2( void )
{
- return genrand_int32()*(1.0/4294967296.0);
+ return genrand_int32() * ( 1.0 / 4294967296.0 );
/* divided by 2^32 */
}
/* generates a random number on (0,1)-real-interval */
-double genrand_real3(void)
+double genrand_real3( void )
{
- return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0);
+ return (((double) genrand_int32()) + 0.5 ) * ( 1.0 / 4294967296.0 );
/* divided by 2^32 */
}
/* generates a random number on [0,1) with 53-bit resolution*/
-double genrand_res53(void)
-{
- unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6;
- return(a*67108864.0+b)*(1.0/9007199254740992.0);
-}
+double genrand_res53( void )
+{
+ unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
+ return ( a * 67108864.0 + b ) * ( 1.0 / 9007199254740992.0 );
+}
/* These real versions are due to Isaku Wada, 2002/01/09 added */
Modified: trunk/src/mt19937ar.h
===================================================================
--- trunk/src/mt19937ar.h 2009-09-22 14:37:18 UTC (rev 10456)
+++ trunk/src/mt19937ar.h 2009-09-23 09:36:41 UTC (rev 10457)
@@ -1,72 +1,72 @@
-/*
- A C-program for MT19937, with initialization improved 2002/1/26.
- Coded by Takuji Nishimura and Makoto Matsumoto.
+/*
+ * A C-program for MT19937, with initialization improved 2002/1/26.
+ * Coded by Takuji Nishimura and Makoto Matsumoto.
+ *
+ * Before using, initialize the state by using init_genrand(seed)
+ * or init_by_array(init_key, key_length).
+ *
+ * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+ * All rights reserved.
+ * Copyright (C) 2005, Mutsuo Saito
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. The names of its contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Any feedback is very welcome.
+ * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+ */
- Before using, initialize the state by using init_genrand(seed)
- or init_by_array(init_key, key_length).
-
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
- Copyright (C) 2005, Mutsuo Saito
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
- Any feedback is very welcome.
- http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
- email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
-*/
-
/* initializes mt[N] with a seed */
-void init_genrand(unsigned long s);
+void init_genrand( unsigned long s );
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
-void init_by_array(unsigned long init_key[], int key_length);
+void init_by_array( unsigned long init_key[], int key_length );
/* generates a random number on [0,0xffffffff]-interval */
-unsigned long genrand_int32(void);
+unsigned long genrand_int32( void );
/* generates a random number on [0,0x7fffffff]-interval */
-long genrand_int31(void);
+long genrand_int31( void );
/* These real versions are due to Isaku Wada, 2002/01/09 added */
/* generates a random number on [0,1]-real-interval */
-double genrand_real1(void);
+double genrand_real1( void );
/* generates a random number on [0,1)-real-interval */
-double genrand_real2(void);
+double genrand_real2( void );
/* generates a random number on (0,1)-real-interval */
-double genrand_real3(void);
+double genrand_real3( void );
/* generates a random number on [0,1) with 53-bit resolution*/
-double genrand_res53(void);
+double genrand_res53( void );
Modified: trunk/src/pdfutils.c
===================================================================
--- trunk/src/pdfutils.c 2009-09-22 14:37:18 UTC (rev 10456)
+++ trunk/src/pdfutils.c 2009-09-23 09:36:41 UTC (rev 10457)
@@ -1,42 +1,42 @@
/* $Id$
+ *
+ * pdf_utils.c
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Maurice LeBrun mj...@di...
+ * Institute for Fusion Studies University of Texas at Austin
+ *
+ * Copyright (C) 2004 Joao Cardoso
+ * Copyright (C) 2004 Alan W. Irwin
+ * Copyright (C) 2004 Andrew Ross
+ *
+ * This file is part of PLplot.
+ *
+ * PLplot is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Library Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PLplot is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with PLplot; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * These functions do the low-level reading/writing of portable data files.
+ * Data can be written to/read from either a file handle or memory buffer.
+ */
- pdf_utils.c
-
- Copyright (C) 1992, 1993, 1994, 1995
- Maurice LeBrun mj...@di...
- Institute for Fusion Studies University of Texas at Austin
-
- Copyright (C) 2004 Joao Cardoso
- Copyright (C) 2004 Alan W. Irwin
- Copyright (C) 2004 Andrew Ross
-
- This file is part of PLplot.
-
- PLplot is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Library Public License as published
- by the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PLplot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with PLplot; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
- These functions do the low-level reading/writing of portable data files.
- Data can be written to/read from either a file handle or memory buffer.
-*/
-
#define NEED_PLDEBUG
#include "plplotP.h"
-static void print_ieeef (void *, void *);
-static int pdf_wrx (const U_CHAR *x, long nitems, PDFstrm *pdfs);
+static void print_ieeef( void *, void * );
+static int pdf_wrx( const U_CHAR *x, long nitems, PDFstrm *pdfs );
static int debug = 0;
@@ -44,13 +44,13 @@
* void pdf_set (string, value)
*
* Set an option. Pretty sparse right now but you never know.
-\*--------------------------------------------------------------------------*/
+ \*--------------------------------------------------------------------------*/
void
-pdf_set(char *option, int value)
+pdf_set( char *option, int value )
{
- if ( ! strcmp(option, "debug"))
- debug = value;
+ if ( !strcmp( option, "debug" ))
+ debug = value;
}
/*--------------------------------------------------------------------------*\
@@ -58,56 +58,67 @@
*
* Initializes a PDFstrm for a file oriented device.
* Used exactly like fopen().
-\*--------------------------------------------------------------------------*/
+ \*--------------------------------------------------------------------------*/
PDFstrm *
-pdf_fopen(const char *filename, const char *mode)
+pdf_fopen( const char *filename, const char *mode )
{
PDFstrm *pdfs;
- dbug_enter("pdf_fopen");
+ dbug_enter( "pdf_fopen" );
- pdfs = (PDFstrm *) malloc(sizeof(PDFstrm));
+ pdfs = (PDFstrm *) malloc( sizeof ( PDFstrm ));
- if (pdfs != NULL) {
- pdfs->buffer = NULL;
- pdfs->file = NULL;
- pdfs->bp = 0;
+ if ( pdfs != NULL )
+ {
+ pdfs->buffer = NULL;
+ pdfs->file = NULL;
+ pdfs->bp = 0;
#ifdef PLPLOT_USE_TCL_CHANNELS
- pdfs->tclChan = NULL;
- if (1) {
- char new_mode[3];
- int binary = 0;
- char *m, *p;
+ pdfs->tclChan = NULL;
+ if ( 1 )
+ {
+ char new_mode[3];
+ int binary = 0;
+ char *m, *p;
- /* Copy over the mode, removing 'b' if needed */
- for (m = mode, p = new_mode; *m != 0; m++) {
- if (*m == 'b') {
- binary = 1;
- } else {
- *p = *m;
- p++;
- }
- }
- *p = 0;
+ /* Copy over the mode, removing 'b' if needed */
+ for ( m = mode, p = new_mode; *m != 0; m++ )
+ {
+ if ( *m == 'b' )
+ {
+ binary = 1;
+ }
+ else
+ {
+ *p = *m;
+ p++;
+ }
+ }
+ *p = 0;
- pdfs->tclChan = Tcl_OpenFileChannel(NULL, filename, new_mode, 0);
- if (pdfs->tclChan == NULL) {
- pdf_close(pdfs);
- pdfs = NULL;
- } else {
- if (binary) {
- Tcl_SetChannelOption(NULL, pdfs->tclChan, "-translation",
- "binary");
- }
- }
- }
+ pdfs->tclChan = Tcl_OpenFileChannel( NULL, filename, new_mode, 0 );
+ if ( pdfs->tclChan == NULL )
+ {
+ pdf_close( pdfs );
+ pdfs = NULL;
+ }
+ else
+ {
+ if ( binary )
+ {
+ Tcl_SetChannelOption( NULL, pdfs->tclChan, "-translation",
+ "binary" );
+ }
+ }
+ }
#else
- pdfs->file = fopen(filename, mode);
- if (pdfs->file == NULL) {
- pdf_close(pdfs);
- pdfs = NULL;
- }
+ pdfs->file = fopen( filename, mode );
+ if ( pdfs->file == NULL )
+ {
+ pdf_close( pdfs );
+ pdfs = NULL;
+ }
#endif
}
@@...
[truncated message content] |
|
From: <ai...@us...> - 2009-09-23 22:25:59
|
Revision: 10465
http://plplot.svn.sourceforge.net/plplot/?rev=10465&view=rev
Author: airwin
Date: 2009-09-23 22:25:49 +0000 (Wed, 23 Sep 2009)
Log Message:
-----------
Result of applying uncrustify version 0.53 again on top of Andrew's result
with the svn/trunk version of uncrustify.cfg. Andrew is also using 0.53
so this is an attempt to see whether one more uncrustify run from him will
cause any further differences.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/plbuf.c
trunk/src/plcore.c
trunk/src/plot3d.c
trunk/src/plstripc.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-09-23 20:57:49 UTC (rev 10464)
+++ trunk/src/plbox.c 2009-09-23 22:25:49 UTC (rev 10465)
@@ -1613,7 +1613,7 @@
{
plwarn(
"Custom axis labels requested without a labeling function \
- - using default." );
+ - using default." );
}
if ( ll )
{
Modified: trunk/src/plbuf.c
===================================================================
--- trunk/src/plbuf.c 2009-09-23 20:57:49 UTC (rev 10464)
+++ trunk/src/plbuf.c 2009-09-23 22:25:49 UTC (rev 10465)
@@ -759,7 +759,8 @@
(unsigned short *) malloc(( nptsX -
1 ) *
( nptsY -
- 1 ) * sizeof ( unsigned short ))) == NULL ))
+ 1 ) * sizeof ( unsigned short ))) ==
+ NULL ))
plexit( "rdbuf_image: Insufficient memory" );
rd_data( pls, dev_ix, sizeof ( short ) * npts );
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-09-23 20:57:49 UTC (rev 10464)
+++ trunk/src/plcore.c 2009-09-23 22:25:49 UTC (rev 10465)
@@ -535,16 +535,16 @@
*/
#define N_TextLookupTable 10
const TextLookupTable lookup[N_TextLookupTable] = {
- { "<sans-serif/>", PL_FCI_SANS, PL_FCI_FAMILY },
- { "<serif/>", PL_FCI_SERIF, PL_FCI_FAMILY },
- { "<monospace/>", PL_FCI_MONO, PL_FCI_FAMILY },
- { "<script/>", PL_FCI_SCRIPT, PL_FCI_FAMILY },
- { "<symbol/>", PL_FCI_SYMBOL, PL_FCI_FAMILY },
- { "<upright/>", PL_FCI_UPRIGHT, PL_FCI_STYLE },
- { "<italic/>", PL_FCI_ITALIC, PL_FCI_STYLE },
- { "<oblique/>", PL_FCI_OBLIQUE, PL_FCI_STYLE },
- { "<medium/>", PL_FCI_MEDIUM, PL_FCI_WEIGHT },
- { "<bold/>", PL_FCI_BOLD, PL_FCI_WEIGHT }
+ { "<sans-serif/>", PL_FCI_SANS, PL_FCI_FAMILY },
+ { "<serif/>", PL_FCI_SERIF, PL_FCI_FAMILY },
+ { "<monospace/>", PL_FCI_MONO, PL_FCI_FAMILY },
+ { "<script/>", PL_FCI_SCRIPT, PL_FCI_FAMILY },
+ { "<symbol/>", PL_FCI_SYMBOL, PL_FCI_FAMILY },
+ { "<upright/>", PL_FCI_UPRIGHT, PL_FCI_STYLE },
+ { "<italic/>", PL_FCI_ITALIC, PL_FCI_STYLE },
+ { "<oblique/>", PL_FCI_OBLIQUE, PL_FCI_STYLE },
+ { "<medium/>", PL_FCI_MEDIUM, PL_FCI_WEIGHT },
+ { "<bold/>", PL_FCI_BOLD, PL_FCI_WEIGHT }
};
int i, length;
for ( i = 0; i < N_TextLookupTable; i++ )
Modified: trunk/src/plot3d.c
===================================================================
--- trunk/src/plot3d.c 2009-09-23 20:57:49 UTC (rev 10464)
+++ trunk/src/plot3d.c 2009-09-23 22:25:49 UTC (rev 10465)
@@ -762,7 +762,7 @@
}
if ( opt & DRAW_SIDES ) /* the sides look ugly !!! */
- { /* draw one more row with all the Z's set to zmin */
+ { /* draw one more row with all the Z's set to zmin */
PLFLT zscale, zmin, zmax;
plP_grange( &zscale, &zmin, &zmax );
@@ -1046,7 +1046,8 @@
_z[i][0] = z[ixmin][iymin] *
( 1 -
ty0 ) *
- ( 1 - tx0 ) + z[ixmin][iymin + 1] * ( 1 - tx0 ) * ty0
+ ( 1 -
+ tx0 ) + z[ixmin][iymin + 1] * ( 1 - tx0 ) * ty0
+ z[ixmin +
1][iymin] * tx0 *
( 1 - ty0 ) + z[ixmin + 1][iymin + 1] * tx0 * ty0;
Modified: trunk/src/plstripc.c
===================================================================
--- trunk/src/plstripc.c 2009-09-23 20:57:49 UTC (rev 10464)
+++ trunk/src/plstripc.c 2009-09-23 22:25:49 UTC (rev 10465)
@@ -112,7 +112,7 @@
stripc->legline[i] = plstrdup( legline[i] );
stripc->x[i] = (PLFLT *) malloc(
(size_t) sizeof ( PLFLT ) * stripc->nptsmax[i] );;
- stripc->y[i] = (PLFLT *) malloc(
+ stripc->y[i] = (PLFLT *) malloc(
(size_t) sizeof ( PLFLT ) * stripc->nptsmax[i] );;
if ( stripc->x[i] == NULL || stripc->y[i] == NULL )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2009-09-24 19:38:33
|
Revision: 10473
http://plplot.svn.sourceforge.net/plplot/?rev=10473&view=rev
Author: andrewross
Date: 2009-09-24 19:38:19 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
Update indenting of function prototypes and definitions to align on brackets.
Modified Paths:
--------------
trunk/src/plargs.c
trunk/src/plbox.c
trunk/src/plcont.c
trunk/src/plcore.c
trunk/src/plctrl.c
trunk/src/pldeprecated.c
trunk/src/pldtik.c
trunk/src/plfill.c
trunk/src/plfreetype.c
trunk/src/plgridd.c
trunk/src/plhist.c
trunk/src/plimage.c
trunk/src/plline.c
trunk/src/plmap.c
trunk/src/plot3d.c
trunk/src/plshade.c
trunk/src/plstripc.c
trunk/src/plsym.c
trunk/src/plvect.c
trunk/src/plvpor.c
trunk/src/plwind.c
Modified: trunk/src/plargs.c
===================================================================
--- trunk/src/plargs.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plargs.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -940,7 +940,7 @@
static int
ParseOpt( int *p_myargc, const char ***p_argv, int *p_argc, const char ***p_argsave,
- PLOptionTable *option_table )
+ PLOptionTable *option_table )
{
PLOptionTable *tab;
const char *opt;
@@ -992,7 +992,7 @@
static int
ProcessOpt( const char *opt, PLOptionTable *tab, int *p_myargc, const char ***p_argv,
- int *p_argc )
+ int *p_argc )
{
int need_arg, res;
const char *optarg = NULL;
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plbox.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -38,28 +38,28 @@
static void
plxybx( const char *opt, const char *label, PLINT axis, PLFLT wx1, PLFLT wy1,
- PLFLT wx2, PLFLT wy2, PLFLT vmin, PLFLT vmax,
- PLFLT tick, PLINT nsub, PLINT nolast, PLINT *digits );
+ PLFLT wx2, PLFLT wy2, PLFLT vmin, PLFLT vmax,
+ PLFLT tick, PLINT nsub, PLINT nolast, PLINT *digits );
static void
plzbx( const char *opt, const char *label, PLINT right, PLFLT dx, PLFLT dy,
- PLFLT wx, PLFLT wy1, PLFLT wy2, PLFLT vmin, PLFLT vmax,
- PLFLT tick, PLINT nsub, PLINT *digits );
+ PLFLT wx, PLFLT wy1, PLFLT wy2, PLFLT vmin, PLFLT vmax,
+ PLFLT tick, PLINT nsub, PLINT *digits );
static void
plxytx( PLFLT wx1, PLFLT wy1, PLFLT wx2, PLFLT wy2,
- PLFLT disp, PLFLT pos, PLFLT just, const char *text );
+ PLFLT disp, PLFLT pos, PLFLT just, const char *text );
static void
plztx( const char *opt, PLFLT dx, PLFLT dy, PLFLT wx, PLFLT wy1,
- PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text );
+ PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text );
static void
plform( PLINT axis, PLFLT value, PLINT scale, PLINT prec, char *result, PLINT len, PLBOOL ll, PLBOOL lf, PLBOOL lo );
static void
grid_box( const char *xopt, PLFLT xtick1, PLINT nxsub1,
- const char *yopt, PLFLT ytick1, PLINT nysub1 );
+ const char *yopt, PLFLT ytick1, PLINT nysub1 );
static void
label_box( const char *xopt, PLFLT xtick1, const char *yopt, PLFLT ytick1 );
@@ -76,7 +76,7 @@
void
c_plbox( const char *xopt, PLFLT xtick, PLINT nxsub,
- const char *yopt, PLFLT ytick, PLINT nysub )
+ const char *yopt, PLFLT ytick, PLINT nysub )
{
c_plaxes( 0.0, 0.0, xopt, xtick, nxsub, yopt, ytick, nysub );
}
@@ -116,8 +116,8 @@
void
c_plaxes( PLFLT x0, PLFLT y0,
- const char *xopt, PLFLT xtick, PLINT nxsub,
- const char *yopt, PLFLT ytick, PLINT nysub )
+ const char *xopt, PLFLT xtick, PLINT nxsub,
+ const char *yopt, PLFLT ytick, PLINT nysub )
{
PLBOOL lax, lbx, lcx, ldx, lgx, lix, llx, lsx, ltx;
PLBOOL lay, lby, lcy, ldy, lgy, liy, lly, lsy, lty;
@@ -531,8 +531,8 @@
void
c_plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx,
- const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby,
- const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz )
+ const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby,
+ const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz )
{
PLFLT dx, dy, tx, ty, ux, uy;
PLFLT xmin, xmax, ymin, ymax, zmin, zmax, zscale;
@@ -721,8 +721,8 @@
static void
plxybx( const char *opt, const char *label, PLINT axis, PLFLT wx1, PLFLT wy1,
- PLFLT wx2, PLFLT wy2, PLFLT vmin_in, PLFLT vmax_in,
- PLFLT tick, PLINT nsub, PLINT nolast, PLINT *digits )
+ PLFLT wx2, PLFLT wy2, PLFLT vmin_in, PLFLT vmax_in,
+ PLFLT tick, PLINT nsub, PLINT nolast, PLINT *digits )
{
static char string[STRING_LEN];
PLINT lb, ld, lf, li, ll, ln, ls, lt, lu, lo;
@@ -881,7 +881,7 @@
static void
plxytx( PLFLT wx1, PLFLT wy1, PLFLT wx2, PLFLT wy2,
- PLFLT disp, PLFLT pos, PLFLT just, const char *text )
+ PLFLT disp, PLFLT pos, PLFLT just, const char *text )
{
PLINT x, y, refx, refy;
PLFLT shift, cc, ss, wx, wy;
@@ -949,8 +949,8 @@
static void
plzbx( const char *opt, const char *label, PLINT right, PLFLT dx, PLFLT dy,
- PLFLT wx, PLFLT wy1, PLFLT wy2, PLFLT vmin_in, PLFLT vmax_in,
- PLFLT tick, PLINT nsub, PLINT *digits )
+ PLFLT wx, PLFLT wy1, PLFLT wy2, PLFLT vmin_in, PLFLT vmax_in,
+ PLFLT tick, PLINT nsub, PLINT *digits )
{
static char string[STRING_LEN];
PLINT lb, lc, ld, lf, li, ll, lm, ln, ls, lt, lu, lv, lo;
@@ -1127,7 +1127,7 @@
static void
plztx( const char *opt, PLFLT dx, PLFLT dy, PLFLT wx, PLFLT wy1,
- PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text )
+ PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text )
{
PLINT refx = 0, refy = 0, x = 0, y = 0, vert = 0;
PLFLT shift, cc, ss, wy;
@@ -1196,7 +1196,7 @@
static void
grid_box( const char *xopt, PLFLT xtick1, PLINT nxsub1,
- const char *yopt, PLFLT ytick1, PLINT nysub1 )
+ const char *yopt, PLFLT ytick1, PLINT nysub1 )
{
PLINT lgx, lhx, llx;
PLINT lgy, lhy, lly;
Modified: trunk/src/plcont.c
===================================================================
--- trunk/src/plcont.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plcont.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -34,21 +34,21 @@
static void
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,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data );
+ PLPointer plf2eval_data,
+ PLINT nx, PLINT ny, PLINT kx, PLINT lx,
+ PLINT ky, PLINT ly, PLFLT flev, PLINT **ipts,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data );
static void
pldrawcn( PLFLT ( *plf2eval )( PLINT, PLINT, PLPointer ),
- PLPointer plf2eval_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 *distance, PLINT *lastindex,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data );
+ PLPointer plf2eval_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 *distance, PLINT *lastindex,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data );
static void
plfloatlabel( PLFLT value, char *string, PLINT len );
@@ -474,10 +474,10 @@
void
cont_store( PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx,
- PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data,
- CONT_LEVEL **contour )
+ PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data,
+ CONT_LEVEL **contour )
{
cont3d = 1;
@@ -497,9 +497,9 @@
void
c_plcont( PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx,
- PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
PLfGrid2 grid;
@@ -535,11 +535,11 @@
void
plfcont( PLFLT ( *f2eval )( PLINT, PLINT, PLPointer ),
- PLPointer f2eval_data,
- PLINT nx, PLINT ny, PLINT kx, PLINT lx,
- PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ PLPointer f2eval_data,
+ PLINT nx, PLINT ny, PLINT kx, PLINT lx,
+ PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
PLINT i, **ipts;
@@ -597,11 +597,11 @@
static void
plcntr( PLFLT ( *f2eval )( PLINT, PLINT, PLPointer ),
- PLPointer f2eval_data,
- PLINT nx, PLINT ny, PLINT kx, PLINT lx,
- PLINT ky, PLINT ly, PLFLT flev, PLINT **ipts,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ PLPointer f2eval_data,
+ PLINT nx, PLINT ny, PLINT kx, PLINT lx,
+ PLINT ky, PLINT ly, PLFLT flev, PLINT **ipts,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
PLINT kcol, krow, lastindex;
PLFLT distance;
@@ -655,13 +655,13 @@
static void
pldrawcn( PLFLT ( *f2eval )( PLINT, PLINT, PLPointer ),
- 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 *distance, PLINT *lastindex,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ 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 *distance, PLINT *lastindex,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
PLFLT f[4];
PLFLT px[4], py[4], locx[4], locy[4];
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plcore.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -553,7 +553,7 @@
void
plP_text( PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y,
- PLINT refx, PLINT refy, const char *string )
+ PLINT refx, PLINT refy, const char *string )
{
if ( plsc->dev_text ) /* Does the device render it's own text ? */
{
@@ -588,8 +588,8 @@
{
len = strlen( string ); /* this length is only used in the loop
- * counter, we will work out the length of
- * the unicode string as we go */
+ * counter, we will work out the length of
+ * the unicode string as we go */
plgesc( &esc );
/* At this stage we will do some translations into unicode, like
@@ -610,7 +610,7 @@
plP_esc( PLESC_BEGIN_TEXT, &args );
}
for ( j = i = 0; i < len; i++ ) /* Walk through the string, and convert
- * some stuff to unicode on the fly */
+ * some stuff to unicode on the fly */
{
skip = 0;
@@ -818,7 +818,7 @@
(PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode;
i += 2;
skip = 1; /* skip is set if we have copied something
- * into the unicode table */
+ * into the unicode table */
if ( plsc->alt_unicode )
{
@@ -834,7 +834,7 @@
unicode_buffer[j++] = (PLUNICODE) 0x00;
i += 2;
skip = 1; /* skip is set if we have copied something
- * into the unicode table */
+ * into the unicode table */
if ( plsc->alt_unicode )
{
@@ -920,11 +920,11 @@
if ( j > 0 )
{
args.unicode_array_len = j; /* Much easier to set the length than
- * work it out later :-) */
+ * work it out later :-) */
args.unicode_array = &unicode_buffer[0]; /* Get address of the
- * unicode buffer (even
- * though it is
- * currently static) */
+ * unicode buffer (even
+ * though it is
+ * currently static) */
}
else
/* Don't print anything, if there is no unicode to print! */
@@ -1136,7 +1136,7 @@
void
difilt( PLINT *xscl, PLINT *yscl, PLINT npts,
- PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma )
+ PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma )
{
PLINT i, x, y;
@@ -1201,7 +1201,7 @@
void
sdifilt( short *xscl, short *yscl, PLINT npts,
- PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma )
+ PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma )
{
int i;
short x, y;
@@ -1794,7 +1794,7 @@
void
c_plsdimap( PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax,
- PLFLT dimxpmm, PLFLT dimypmm )
+ PLFLT dimxpmm, PLFLT dimypmm )
{
plsetvar( plsc->dimxmin, dimxmin );
plsetvar( plsc->dimxmax, dimxmax );
@@ -3079,7 +3079,7 @@
void
c_plgpage( PLFLT *p_xp, PLFLT *p_yp,
- PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff )
+ PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff )
{
*p_xp = plsc->xdpi;
*p_yp = plsc->ydpi;
@@ -3203,7 +3203,7 @@
void
plsKeyEH( void ( *KeyEH )( PLGraphicsIn *, void *, int * ),
- void *KeyEH_data )
+ void *KeyEH_data )
{
plsc->KeyEH = KeyEH;
plsc->KeyEH_data = KeyEH_data;
@@ -3213,7 +3213,7 @@
void
plsButtonEH( void ( *ButtonEH )( PLGraphicsIn *, void *, int * ),
- void *ButtonEH_data )
+ void *ButtonEH_data )
{
plsc->ButtonEH = ButtonEH;
plsc->ButtonEH_data = ButtonEH_data;
@@ -3810,7 +3810,7 @@
PLINT ret = 0; /* set up return code to 0, the value if no devices match*/
buff = (char *) malloc((size_t) PL_NSTREAMS * 8 ); /* Allocate enough memory for 8
- * characters for each possible stream */
+ * characters for each possible stream */
if ( buff != NULL )
{
@@ -3847,7 +3847,7 @@
void
plP_image( PLFLT *z, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data )
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data )
{
plsc->page_status = DRAWING;
Modified: trunk/src/plctrl.c
===================================================================
--- trunk/src/plctrl.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plctrl.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -88,7 +88,7 @@
static void
cmap0_palette_read( const char *filename,
- int *number_colors, int **r, int **g, int **b, double **a );
+ int *number_colors, int **r, int **g, int **b, double **a );
/* An additional hardwired location for lib files. */
/* I have no plans to change these again, ever. */
@@ -568,7 +568,7 @@
void
c_plscmap1l( PLINT itype, PLINT npts, PLFLT *pos,
- PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev )
+ PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev )
{
int n;
PLFLT h, l, s, r, g, b;
@@ -642,7 +642,7 @@
void
c_plscmap1la( PLINT itype, PLINT npts, PLFLT *pos,
- PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLINT *rev )
+ PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLINT *rev )
{
int n;
PLFLT h, l, s, r, g, b;
@@ -1241,7 +1241,7 @@
void
cmap0_palette_read( const char *filename,
- int *number_colors, int **r, int **g, int **b, double **a )
+ int *number_colors, int **r, int **g, int **b, double **a )
{
int i, err = 0;
char color_info[30];
@@ -2453,7 +2453,7 @@
void
plRotPhy( PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax,
- PLINT *px, PLINT *py )
+ PLINT *px, PLINT *py )
{
int x, y;
Modified: trunk/src/pldeprecated.c
===================================================================
--- trunk/src/pldeprecated.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/pldeprecated.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -90,7 +90,7 @@
void
plarrows( PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n,
- PLFLT scale, PLFLT dx, PLFLT dy )
+ PLFLT scale, PLFLT dx, PLFLT dy )
{
PLFLT uu, vv;
PLINT i, j, npts = 4;
Modified: trunk/src/pldtik.c
===================================================================
--- trunk/src/pldtik.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/pldtik.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -252,7 +252,7 @@
void
pldprec( PLFLT vmin, PLFLT vmax, PLFLT tick, PLINT lf,
- PLINT *mode, PLINT *prec, PLINT digmax, PLINT *scale )
+ PLINT *mode, PLINT *prec, PLINT digmax, PLINT *scale )
{
PLFLT chosen, notchosen, vmod, t0;
PLINT msd, notmsd, np, digmin, digfix;
Modified: trunk/src/plfill.c
===================================================================
--- trunk/src/plfill.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plfill.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -289,7 +289,7 @@
static void
buildlist( PLINT xp1, PLINT yp1, PLINT xp2, PLINT yp2, PLINT xp3, PLINT yp3,
- PLINT dinc )
+ PLINT dinc )
{
PLINT min_y, max_y;
PLINT dx, dy, cstep, nstep, ploty, plotx;
Modified: trunk/src/plfreetype.c
===================================================================
--- trunk/src/plfreetype.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plfreetype.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -382,7 +382,7 @@
FT_Load_Char( FT->face, text[i], ( FT->smooth_text == 0 ) ? FT_LOAD_MONOCHROME + FT_LOAD_RENDER : FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT );
FT_PlotChar( pls, FT, FT->face->glyph,
- ROUND( x / 64.0 ), ROUND( y / 64.0 ), 2 ); /* render the text */
+ ROUND( x / 64.0 ), ROUND( y / 64.0 ), 2 ); /* render the text */
x += FT->face->glyph->advance.x;
y -= FT->face->glyph->advance.y;
@@ -401,7 +401,7 @@
void
FT_PlotChar( PLStream *pls, FT_Data *FT, FT_GlyphSlot slot,
- int x, int y, short colour )
+ int x, int y, short colour )
{
unsigned char bittest;
short i, k, j;
Modified: trunk/src/plgridd.c
===================================================================
--- trunk/src/plgridd.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plgridd.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -38,33 +38,33 @@
/* forward declarations */
static void
grid_nnaidw( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
static void
grid_nnli( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- PLFLT threshold );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ PLFLT threshold );
static void
grid_nnidw( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- int knn_order );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ int knn_order );
#ifdef WITH_CSA
static void
grid_csa( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
#endif
#ifdef HAVE_QHULL
static void
grid_nni( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- PLFLT wmin );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ PLFLT wmin );
static void
grid_dtli( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg );
#endif
static void
@@ -109,8 +109,8 @@
void
c_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, PLINT npts,
- PLFLT *xg, PLINT nptsx, PLFLT *yg, PLINT nptsy,
- PLFLT **zg, PLINT type, PLFLT data )
+ PLFLT *xg, PLINT nptsx, PLFLT *yg, PLINT nptsy,
+ PLFLT **zg, PLINT type, PLFLT data )
{
int i, j;
@@ -199,7 +199,7 @@
static void
grid_csa( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
{
PLFLT *xt, *yt, *zt;
point *pin, *pgrid, *pt;
@@ -269,8 +269,8 @@
static void
grid_nnidw( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- int knn_order )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ int knn_order )
{
int i, j, k;
PLFLT wi, nt;
@@ -332,8 +332,8 @@
static void
grid_nnli( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- PLFLT threshold )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ PLFLT threshold )
{
PLFLT xx[4], yy[4], zz[4], t, A, B, C, D, d1, d2, d3, max_thick;
int i, j, ii, excl, cnt, excl_item;
@@ -510,7 +510,7 @@
static void
grid_nnaidw( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
{
PLFLT d, nt;
int i, j, k;
@@ -553,7 +553,7 @@
static void
grid_dtli( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
{
point *pin, *pgrid, *pt;
PLFLT *xt, *yt, *zt;
@@ -622,8 +622,8 @@
static void
grid_nni( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
- PLFLT wmin )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg,
+ PLFLT wmin )
{
PLFLT *xt, *yt, *zt;
point *pin, *pgrid, *pt;
@@ -787,7 +787,7 @@
#ifdef NONN /* another DTLI, based only on QHULL, not nn */
static void
grid_adtli( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
- PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
+ PLFLT *xg, int nptsx, PLFLT *yg, int nptsy, PLFLT **zg )
{
coordT *points; /* array of coordinates for each point */
boolT ismalloc = False; /* True if qhull should free points */
Modified: trunk/src/plhist.c
===================================================================
--- trunk/src/plhist.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plhist.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -41,7 +41,7 @@
void
c_plhist( PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax,
- PLINT nbin, PLINT flags )
+ PLINT nbin, PLINT flags )
{
PLINT i, bin;
PLFLT *x, *y, dx, ymax;
Modified: trunk/src/plimage.c
===================================================================
--- trunk/src/plimage.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plimage.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -86,9 +86,9 @@
*/
void
plimageslow( PLFLT *idata, PLINT nx, PLINT ny,
- PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
/* Indices */
PLINT ix, iy, i;
@@ -189,10 +189,10 @@
\*-------------------------------------------------------------------------*/
void
c_plimagefr( PLFLT **idata, PLINT nx, PLINT ny,
- PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax,
- PLFLT valuemin, PLFLT valuemax,
- void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
- PLPointer pltr_data )
+ PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax,
+ PLFLT valuemin, PLFLT valuemax,
+ void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ),
+ PLPointer pltr_data )
{
PLINT ix, iy;
PLFLT dx, dy;
@@ -309,8 +309,8 @@
\*-------------------------------------------------------------------------*/
void
c_plimage( PLFLT **idata, PLINT nx, PLINT ny,
- PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax,
- PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax )
+ PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax,
+ PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax )
{
PLINT ix, iy, ixx, iyy, xm, ym, nnx, nny;
PLFLT data_min, data_max, dx, dy;
Modified: trunk/src/plline.c
===================================================================
--- trunk/src/plline.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plline.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -41,7 +41,7 @@
static int
clipline( PLINT *p_x1, PLINT *p_y1, PLINT *p_x2, PLINT *p_y2,
- PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax );
+ PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax );
/* General line-drawing routine. Takes line styles into account. */
@@ -560,8 +560,8 @@
void
plP_pllclp( PLINT *x, PLINT *y, PLINT npts,
- PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax,
- void ( *draw )( short *, short *, PLINT ))
+ PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax,
+ void ( *draw )( short *, short *, PLINT ))
{
PLINT x1, x2, y1, y2;
PLINT i, iclp = 0;
@@ -705,8 +705,8 @@
void
plP_plfclp( PLINT *x, PLINT *y, PLINT npts,
- PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax,
- void ( *draw )( short *, short *, PLINT ))
+ PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax,
+ void ( *draw )( short *, short *, PLINT ))
{
PLINT i, x1, x2, y1, y2;
int iclp = 0, iout = 2;
@@ -1160,7 +1160,7 @@
static int
clipline( PLINT *p_x1, PLINT *p_y1, PLINT *p_x2, PLINT *p_y2,
- PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax )
+ PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax )
{
PLINT t, dx, dy, flipx, flipy;
double dydx = 0, dxdy = 0;
Modified: trunk/src/plmap.c
===================================================================
--- trunk/src/plmap.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plmap.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -87,7 +87,7 @@
void
plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type,
- PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat )
+ PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat )
{
PLINT wrap, sign;
int i, j;
@@ -266,8 +266,8 @@
void
plmeridians( void ( *mapform )( PLINT, PLFLT *, PLFLT * ),
- PLFLT dlong, PLFLT dlat,
- PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat )
+ PLFLT dlong, PLFLT dlat,
+ PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat )
{
PLFLT yy, xx, temp, x[2], y[2], dx, dy;
Modified: trunk/src/plot3d.c
===================================================================
--- trunk/src/plot3d.c 2009-09-24 19:29:38 UTC (rev 10472)
+++ trunk/src/plot3d.c 2009-09-24 19:38:19 UTC (rev 10473)
@@ -57,8 +57,8 @@
static void plnxtv( PLINT *, PLINT *, PLFLT*, PLINT, PLINT );
static void plside3( PLFLT *, PLFLT *, PLFLT **, PLINT, PLINT, PLINT );
static void plt3zz( PLINT, PLINT, PLINT, PLINT,
- PLINT, PLINT *, PLFLT *, PLFLT *, PLFLT **,
- PLINT, PLINT, PLINT *, PLINT *, PLFLT* );
+ PLINT, PLINT *, PLFLT *, PLFLT *, PLFLT **,
+ PLINT, PLINT, PLINT *, PLINT *, PLFLT* );
static void plnxtvhi( PLINT *, PLINT *, PLFLT*, PLINT, PLINT );
static void plnxtvlo( PLINT *, PLINT *, PLFLT*, PLINT, PLINT );
static void plnxtvhi_draw( PLINT *u, PLINT *v, PLFLT* c, PLINT n );
@@ -72,21 +72,21 @@
static void freework( void );
static int plabv( PLINT, PLINT, PLINT, PLINT, PLINT, PLINT );
static void pl3cut( PLINT, PLINT, PLINT, PLINT, PLINT,
- PLINT, PLINT, PLINT, PLINT *, PLINT * );
+ PLINT, PLINT, PLINT, PLINT *, PLINT * );
static PLFLT plGetAngleToLight( PLFLT* x, PLFLT* y, PLFLT* z );
static void plP_draw3d( PLINT x, PLINT y, PLFLT *c...
[truncated message content] |
|
From: <arj...@us...> - 2010-02-21 10:48:15
|
Revision: 10807
http://plplot.svn.sourceforge.net/plplot/?rev=10807&view=rev
Author: arjenmarkus
Date: 2010-02-21 10:48:08 +0000 (Sun, 21 Feb 2010)
Log Message:
-----------
Consistent signature for two static functions
Modified Paths:
--------------
trunk/src/plfill.c
trunk/src/plgradient.c
Modified: trunk/src/plfill.c
===================================================================
--- trunk/src/plfill.c 2010-02-18 22:55:28 UTC (rev 10806)
+++ trunk/src/plfill.c 2010-02-21 10:48:08 UTC (rev 10807)
@@ -1178,8 +1178,8 @@
/* Temporary until get rid of old code altogether. */
#define NEW_NOTPOINTINPOLYGON_CODE
-int
-notpointinpolygon( int n, const PLINT *x, const PLINT *y, PLINT xp, PLINT yp )
+static int
+notpointinpolygon( PLINT n, const PLINT *x, const PLINT *y, PLINT xp, PLINT yp )
{
#ifdef NEW_NOTPOINTINPOLYGON_CODE
int i, im1, ifnotcrossed;
Modified: trunk/src/plgradient.c
===================================================================
--- trunk/src/plgradient.c 2010-02-18 22:55:28 UTC (rev 10806)
+++ trunk/src/plgradient.c 2010-02-21 10:48:08 UTC (rev 10807)
@@ -34,7 +34,7 @@
/* define where plshades plots gradient for software fallback for
* gradient. */
-static int
+static PLINT
gradient_defined( PLFLT x, PLFLT y );
/*----------------------------------------------------------------------*\
@@ -240,7 +240,7 @@
plFree2dGrid( z, NX, NY );
}
-PLINT
+static PLINT
gradient_defined( PLFLT x, PLFLT y )
{
return plP_pointinpolygon( plsc->n_polygon, plsc->x_polygon, plsc->y_polygon,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-04-19 16:23:34
|
Revision: 10926
http://plplot.svn.sourceforge.net/plplot/?rev=10926&view=rev
Author: airwin
Date: 2010-04-19 16:23:26 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
TEST_FOR_MISSING_GLYPHS ==> PL_TEST_FOR_MISSING_GLYPHS
Modified Paths:
--------------
trunk/src/CMakeLists.txt
trunk/src/plsym.c
Modified: trunk/src/CMakeLists.txt
===================================================================
--- trunk/src/CMakeLists.txt 2010-04-19 02:37:25 UTC (rev 10925)
+++ trunk/src/CMakeLists.txt 2010-04-19 16:23:26 UTC (rev 10926)
@@ -74,7 +74,7 @@
endif(NOT PLSYM_COMPILE_PROPS)
set_source_files_properties(
plsym.c
- PROPERTIES COMPILE_FLAGS "${PLSYM_COMPILE_PROPS} -DTEST_FOR_MISSING_GLYPHS"
+ PROPERTIES COMPILE_FLAGS "${PLSYM_COMPILE_PROPS} -DPL_TEST_FOR_MISSING_GLYPHS"
)
endif(NOT HERSHEY_FALLBACK)
Modified: trunk/src/plsym.c
===================================================================
--- trunk/src/plsym.c 2010-04-19 02:37:25 UTC (rev 10925)
+++ trunk/src/plsym.c 2010-04-19 16:23:26 UTC (rev 10926)
@@ -239,7 +239,7 @@
* If the function KNOWS there isn't a unicode equivalent, then it will
* try to render it as a hershey font. Understandably, this might make
* testing out the unicode functions a little tricky, so if you want
- * to disable this behaviour, recompile with TEST_FOR_MISSING_GLYPHS
+ * to disable this behaviour, recompile with PL_TEST_FOR_MISSING_GLYPHS
* defined.
\*--------------------------------------------------------------------------*/
@@ -267,7 +267,7 @@
if ( ( unicode_char == 0 ) || ( idx == -1 ) )
{
-#ifndef TEST_FOR_MISSING_GLYPHS
+#ifndef PL_TEST_FOR_MISSING_GLYPHS
plhrsh2( ch, x, y );
#endif
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-01-11 01:52:14
|
Revision: 11473
http://plplot.svn.sourceforge.net/plplot/?rev=11473&view=rev
Author: airwin
Date: 2011-01-11 01:52:06 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
Doxygen style change following what was done in plot3d.c. Drop the
colon starting the description of each parameter. There is no need
for such a separator because all parameter names are italicized in
the html. However, we do also capitalize the first word of the
description (where that is appropriate) to strengthen the separation between
parameter name and description when viewing the doxygen results by
browser.
Modified Paths:
--------------
trunk/src/pllegend.c
trunk/src/plpage.c
trunk/src/plsym.c
Modified: trunk/src/pllegend.c
===================================================================
--- trunk/src/pllegend.c 2011-01-11 00:44:15 UTC (rev 11472)
+++ trunk/src/pllegend.c 2011-01-11 01:52:06 UTC (rev 11473)
@@ -32,23 +32,23 @@
//! Calculate parameters that help determine the position of the top left
//! of the legend in normalized viewport coordinates.
//!
-//! @param opt : control variable containing valid combinations of the
+//! @param opt Control variable containing valid combinations of the
//! following control bits that specify the 16 standard positions of
//! the legend: PL_LEGEND_LEFT, PL_LEGEND_RIGHT, PL_LEGEND_UPPER,
//! PL_LEGEND_LOWER, PL_LEGEND_INSIDE, and PL_LEGEND_OUTSIDE.
-//! @param legend_width : total legend width in normalized viewport
+//! @param legend_width Total legend width in normalized viewport
//! coordinates.
-//! @param legend_height : total legend height in normalized viewport
+//! @param legend_height Total legend height in normalized viewport
//! coordinates.
-//! @param x_legend_position : pointer to a location that contains
+//! @param x_legend_position Pointer to a location that contains
//! (after the call) the X value of one of the 16 standard legend
//! positions specified by opt.
-//! @param y_legend_position : pointer to a location that contains
+//! @param y_legend_position Pointer to a location that contains
//! (after the call) the Y equivalent of x_legend_position.
-//! @param xsign : pointer to a location that contains (after the call)
+//! @param xsign Pointer to a location that contains (after the call)
//! the sign of the X offset relative to the standard legend position
//! specified by opt.
-//! @param ysign : pointer to a location that contains (after the call)
+//! @param ysign Pointer to a location that contains (after the call)
//! the Y equivalent to xsign.
//!
@@ -256,8 +256,8 @@
//--------------------------------------------------------------------------
//! Obtain ratio of normalized subpage to mm coordinates in both x and y.
//!
-//! @param x_subpage_per_mm : pointer to a location that contains (after the call) the x ratio.
-//! @param y_subpage_per_mm : pointer to a location that contains (after the call) the y ratio.
+//! @param x_subpage_per_mm Pointer to a location that contains (after the call) the x ratio.
+//! @param y_subpage_per_mm Pointer to a location that contains (after the call) the y ratio.
//!
static void get_subpage_per_mm( PLFLT *x_subpage_per_mm, PLFLT *y_subpage_per_mm )
@@ -278,7 +278,7 @@
//--------------------------------------------------------------------------
//! Obtain character or symbol height in (y) subpage coordinates.
//!
-//! @param ifcharacter : TRUE obtain character height, FALSE obtain symbol
+//! @param ifcharacter TRUE obtain character height, FALSE obtain symbol
//! height.
//! @return character or symbol height.
//!
@@ -306,7 +306,7 @@
//! Convert from external normalized viewport X coordinate to normalized
//! subpage X coordinate.
//!
-//! @param nx : external normalized viewport X coordinate.
+//! @param nx External normalized viewport X coordinate.
//!
#define viewport_to_subpage_x( nx ) ( ( xdmin_save ) + ( nx ) * ( ( xdmax_save ) - ( xdmin_save ) ) )
@@ -315,7 +315,7 @@
//! Convert from normalized subpage X coordinate to external normalized
//! viewport X coordinate.
//!
-//! @param nx : normalized subpage X coordinate.
+//! @param nx Normalized subpage X coordinate.
//!
#define subpage_to_viewport_x( nx ) ( ( nx - xdmin_save ) / ( ( xdmax_save ) - ( xdmin_save ) ) )
@@ -324,7 +324,7 @@
//! Convert from external normalized viewport Y coordinate to normalized
//! subpage Y coordinate.
//!
-//! @param ny : external normalized viewport Y coordinate.
+//! @param ny External normalized viewport Y coordinate.
//!
#define viewport_to_subpage_y( ny ) ( ( ydmin_save ) + ( ny ) * ( ( ydmax_save ) - ( ydmin_save ) ) )
@@ -333,7 +333,7 @@
//! Convert from normalized subpage Y coordinate to external normalized
//! viewport Y coordinate.
//!
-//! @param ny : normalized subpage Y coordinate.
+//! @param ny Normalized subpage Y coordinate.
//!
#define subpage_to_viewport_y( ny ) ( ( ny - ydmin_save ) / ( ( ydmax_save ) - ( ydmin_save ) ) )
@@ -341,18 +341,18 @@
//--------------------------------------------------------------------------
//! Plot discrete annotated legend using filled boxes, lines, and/or symbols.
//!
-//! @param p_legend_width : pointer to a location which contains
+//! @param p_legend_width Pointer to a location which contains
//! (after the call) the legend width in normalized viewport
//! coordinates. This quantity is calculated from the plot_width and
//! text_offset arguments, the ncolumn argument (possibly modified
//! inside the routine depending on the nlegend and nrow arguments),
//! and the length (calculated internally) of the longest text string.
-//! @param p_legend_height : pointer to a location which contains (after
+//! @param p_legend_height Pointer to a location which contains (after
//! the call) the legend height in normalized viewport coordinates.
//! This quantity is calculated from the text_scale and text_spacing arguments
//! and the nrow argument (possibly modified inside the routine depending
//! on the nlegend and ncolum arguments).
-//! @param opt : this variable contains bits which control the overall
+//! @param opt This variable contains bits which control the overall
//! legend. If the PL_LEGEND_TEXT_LEFT bit is set, put the text area
//! on the left of the legend and the plotted area on the right.
//! Otherwise, put the text area on the right of the legend and the
@@ -367,7 +367,7 @@
//! PL_LEGEND_OUTSIDE position bits specifies one of the 16 possible
//! standard positions (the 4 corners and 4 side centers for both the
//! inside and outside cases) of the legend relative to the viewport.
-//! @param x : X offset of the legend position in normalized viewport
+//! @param x X offset of the legend position in normalized viewport
//! coordinates from the specified standard position of the legend.
//! For positive x, the direction of motion away from the standard
//! position is inward/outward from the standard corner positions or
@@ -375,7 +375,7 @@
//! PL_LEGEND_INSIDE/PL_LEGEND_OUTSIDE bit is set in opt. For the
//! center-upper or center-lower cases, the direction of motion is
//! toward positive X.
-//! @param y : Y offset of the legend position in normalized viewport
+//! @param y Y offset of the legend position in normalized viewport
//! coordinates from the specified standard position of the legend.
//! For positive y, the direction of motion away from the standard
//! position is inward/outward from the standard corner positions or
@@ -383,22 +383,22 @@
//! PL_LEGEND_INSIDE/PL_LEGEND_OUTSIDE bit is set in opt. For the
//! center-left or center-right cases, the direction of motion is
//! toward positive Y.
-//! @param plot_width : horizontal width in normalized viewport units
+//! @param plot_width Horizontal width in normalized viewport units
//! of the plot area (where colored boxes, lines, and/or symbols are
//! drawn in the legend).
-//! @param bg_color : cmap0 index of the background color for the legend
+//! @param bg_color Cmap0 index of the background color for the legend
//! (PL_LEGEND_BACKGROUND).
-//! @param bb_color : cmap0 index of the color of the bounding-box
+//! @param bb_color Cmap0 index of the color of the bounding-box
//! line for the legend (PL_LEGEND_BOUNDING_BOX).
-//! @param bb_style : pllsty style number for the bounding-box line
+//! @param bb_style pllsty style number for the bounding-box line
//! for the legend (PL_LEGEND_BOUNDING_BOX).
-//! @param nrow : number of rows in the matrix used to render the
+//! @param nrow Number of rows in the matrix used to render the
//! nlegend legend entries. For internal transformations of nrow, see
//! further remarks under nlegend.
-//! @param ncolumn : number of columns in the matrix used to render the
+//! @param ncolumn Number of columns in the matrix used to render the
//! nlegend legend entries. For internal transformations of ncolumn,
//! see further remarks under nlegend.
-//! @param nlegend : number of legend entries. The above nrow and
+//! @param nlegend Number of legend entries. The above nrow and
//! ncolumn values are transformed internally to be consistent with
//! nlegend. If either nrow or ncolumn is non-positive it is replaced
//! by 1. If the resulting product of nrow and ncolumn is less than
@@ -407,49 +407,49 @@
//! common nrow = 0, ncolumn = 0 case is transformed internally to
//! nrow = nlegend, ncolumn = 1; i.e., the usual case of a legend
//! rendered as a single column.
-//! @param opt_array : array of nlegend values of options to control
+//! @param opt_array Array of nlegend values of options to control
//! each individual plotted area corresponding to a legend entry. If
//! the PL_LEGEND_NONE bit is set, then nothing is plotted in the
//! plotted area. If the PL_LEGEND_COLOR_BOX, PL_LEGEND_LINE, and/or
//! PL_LEGEND_SYMBOL bits are set, the plotted area corresponding to a
//! legend entry is specified with a colored box; a line; and/or a
//! line of symbols.
-//! @param text_offset : offset of the text area from the plot area in
+//! @param text_offset Offset of the text area from the plot area in
//! units of character width.
-//! @param text_scale : character height scale for text annotations.
-//! @param text_spacing : vertical spacing in units of the character
+//! @param text_scale Character height scale for text annotations.
+//! @param text_spacing Vertical spacing in units of the character
//! height from one legend entry to the next.
-//! @param text_justification : justification parameter used for text
+//! @param text_justification Justification parameter used for text
//! justification. The most common values of text_justification are
//! 0., 0.5, or 1. corresponding to a text that is left justified,
//! centred, or right justified within the text area, but other values
//! are allowed as well.
-//! @param text_colors : array of nlegend text colors (cmap0 indices).
-//! @param text : array of nlegend pointers to null-terminated text
+//! @param text_colors Array of nlegend text colors (cmap0 indices).
+//! @param text Array of nlegend pointers to null-terminated text
//! annotation strings. Like other PLplot strings specified by the
//! user, UTF-8 or its ascii subset may be used in the strings, and
//! the strings may include any of the PLplot text escapes.
-//! @param box_colors : array of nlegend colors (cmap0 indices) for
+//! @param box_colors Array of nlegend colors (cmap0 indices) for
//! the discrete colored boxes (PL_LEGEND_COLOR_BOX).
-//! @param box_patterns : array of nlegend patterns (plpsty indices)
+//! @param box_patterns Array of nlegend patterns (plpsty indices)
//! for the discrete colored boxes (PL_LEGEND_COLOR_BOX).
-//! @param box_scales : array of nlegend scales (units of fraction of
+//! @param box_scales Array of nlegend scales (units of fraction of
//! character height) for the height of the discrete colored boxes
//! (PL_LEGEND_COLOR_BOX).
-//! @param box_line_widths : array of nlegend line widths for the
+//! @param box_line_widths Array of nlegend line widths for the
//! patterns specified by box_patterns (PL_LEGEND_COLOR_BOX).
-//! @param line_colors : array of nlegend line colors (cmap0 indices)
+//! @param line_colors Array of nlegend line colors (cmap0 indices)
//! (PL_LEGEND_LINE).
-//! @param line_styles : array of nlegend line styles (pllsty indices)
+//! @param line_styles Array of nlegend line styles (pllsty indices)
//! (PL_LEGEND_LINE).
-//! @param line_widths : array of nlegend line widths (PL_LEGEND_LINE).
-//! @param symbol_colors : array of nlegend symbol colors (cmap0
+//! @param line_widths Array of nlegend line widths (PL_LEGEND_LINE).
+//! @param symbol_colors Array of nlegend symbol colors (cmap0
//! indices) (PL_LEGEND_SYMBOL).
-//! @param symbol_scales : array of nlegend scale values for the
+//! @param symbol_scales Array of nlegend scale values for the
//! symbol height (PL_LEGEND_SYMBOL).
-//! @param symbol_numbers : array of nlegend numbers of symbols to be
+//! @param symbol_numbers Array of nlegend numbers of symbols to be
//! drawn across the width of the plotted area (PL_LEGEND_SYMBOL).
-//! @param symbols : array of nlegend pointers to null-terminated
+//! @param symbols Array of nlegend pointers to null-terminated
//! strings which represent the glyph for the symbol to be plotted
//! (PL_LEGEND_SYMBOL). Like other PLplot strings specified by the
//! user, UTF-8 or its ascii subset may be used in the strings, and
Modified: trunk/src/plpage.c
===================================================================
--- trunk/src/plpage.c 2011-01-11 00:44:15 UTC (rev 11472)
+++ trunk/src/plpage.c 2011-01-11 01:52:06 UTC (rev 11473)
@@ -29,7 +29,7 @@
//--------------------------------------------------------------------------
//! Advance to subpage "page" or to the next page if "page" = 0.
//!
-//! @param page : subpage identifier or 0
+//! @param page Subpage identifier or 0
//!
void
c_pladv( PLINT page )
@@ -209,10 +209,10 @@
//! Get subpage boundaries in absolute coordinates (mm from bottom
//! left-hand corner of page).
//!
-//! @param xmin : pointer to PLFLT containing minimum x boundary after call
-//! @param xmax : pointer to PLFLT containing maximum x boundary after call
-//! @param ymin : pointer to PLFLT containing minimum y boundary after call
-//! @param ymax : pointer to PLFLT containing maximum y boundary after call
+//! @param xmin Pointer to PLFLT containing minimum x boundary after call
+//! @param xmax Pointer to PLFLT containing maximum x boundary after call
+//! @param ymin Pointer to PLFLT containing minimum y boundary after call
+//! @param ymax Pointer to PLFLT containing maximum y boundary after call
//!
void
c_plgspa( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
@@ -232,7 +232,7 @@
//! Wait for graphics input event and translate to world coordinates.
//!
//! @author Paul Casteels.
-//! @param plg : pointer to PLGraphicsIn
+//! @param plg Pointer to PLGraphicsIn
//! @return 0 if no translation to world coordinates is possible.
//! @see PLGraphicsIn
//!
@@ -248,7 +248,7 @@
//! coordinates.
//!
//! @author Paul Casteels, modified by Alan W. Irwin
-//! @param plg : pointer to PLGraphicsIn
+//! @param plg Pointer to PLGraphicsIn
//! @return 0 if no translation to world coordinates is possible.
//!
int
@@ -274,11 +274,11 @@
//! for any currently existing window.
//!
//! @author Paul Casteels, modified by Alan W. Irwin.
-//! @param rx : relative x device coordinates
-//! @param ry : relative y device coordinates
-//! @param wx : Pointer to x world coordinate (after call)
-//! @param wy : Pointer to y world coordinate (after call)
-//! @param window : Pointer index of window for which the world coordinates
+//! @param rx Relative x device coordinates
+//! @param ry Relative y device coordinates
+//! @param wx Pointer to x world coordinate (after call)
+//! @param wy Pointer to y world coordinate (after call)
+//! @param window Pointer index of window for which the world coordinates
//! are valid
//!
void
Modified: trunk/src/plsym.c
===================================================================
--- trunk/src/plsym.c 2011-01-11 00:44:15 UTC (rev 11472)
+++ trunk/src/plsym.c 2011-01-11 01:52:06 UTC (rev 11473)
@@ -90,10 +90,10 @@
//! plptex, the user string can contain FCI escapes to determine the
//! font, UTF-8 code to determine the glyph or else PLplot escapes for
//! Hershey or unicode text to determine the glyph.
-//! @param n : number of points in x and y arrays.
-//! @param x : array of X coordinates of points.
-//! @param y : array of Y coordinates of points.
-//! @param string : PLplot user string corresponding to the glyph to
+//! @param n Number of points in x and y arrays.
+//! @param x Array of X coordinates of points.
+//! @param y Array of Y coordinates of points.
+//! @param string PLplot user string corresponding to the glyph to
//! be plotted at each of the n points.
//--------------------------------------------------------------------------
@@ -110,10 +110,10 @@
//--------------------------------------------------------------------------
//! Plot a glyph at the specified points. This function is largely
//! superseded by plstring which gives access to many(!) more glyphs.
-//! @param n : number of points in x and y arrays.
-//! @param x : pointer to an array with X coordinates of points.
-//! @param y : pointer to an array with Y coordinates of points.
-//! @param code : Hershey symbol code corresponding to a glyph to be
+//! @param n Number of points in x and y arrays.
+//! @param x Pointer to an array with X coordinates of points.
+//! @param y Pointer to an array with Y coordinates of points.
+//! @param code Hershey symbol code corresponding to a glyph to be
//! plotted at each of the n points.
//--------------------------------------------------------------------------
@@ -153,10 +153,10 @@
//! draw). If 0 < code < 32, then a useful (but small subset) of
//! Hershey symbols is plotted. If 32 <= code <= 127 the
//! corresponding printable ASCII character is plotted.
-//! @param n : number of points in x and y arrays.
-//! @param x : pointer to an array with X coordinates of points.
-//! @param y : pointer to an array with Y coordinates of points.
-//! @param code : Hershey symbol code (in "ascii-indexed" form with
+//! @param n Number of points in x and y arrays.
+//! @param x Pointer to an array with X coordinates of points.
+//! @param y Pointer to an array with Y coordinates of points.
+//! @param code Hershey symbol code (in "ascii-indexed" form with
//! -1 <= code <= 127) corresponding to a glyph to be plotted at each
//! of the n points.
//--------------------------------------------------------------------------
@@ -215,11 +215,11 @@
//! If 0 < code < 32, then a useful (but small subset) of Hershey
//! symbols is plotted. If 32 <= code <= 127 the corresponding
//! printable ASCII character is plotted.
-//! @param n : number of points in x, y, and z arrays.
-//! @param x : pointer to an array with X coordinates of points.
-//! @param y : pointer to an array with Y coordinates of points.
-//! @param z : pointer to an array with Z coordinates of points.
-//! @param code : Hershey symbol code (in "ascii-indexed" form with
+//! @param n Number of points in x, y, and z arrays.
+//! @param x Pointer to an array with X coordinates of points.
+//! @param y Pointer to an array with Y coordinates of points.
+//! @param z Pointer to an array with Z coordinates of points.
+//! @param code Hershey symbol code (in "ascii-indexed" form with
//! -1 <= code <= 127) corresponding to a glyph to be plotted at each
//! of the n points.
//--------------------------------------------------------------------------
@@ -289,11 +289,11 @@
//! plptex, the user string can contain FCI escapes to determine the
//! font, UTF-8 code to determine the glyph or else PLplot escapes for
//! Hershey or unicode text to determine the glyph.
-//! @param n : number of points in x, y, and z arrays.
-//! @param x : array of X coordinates of points.
-//! @param y : array of Y coordinates of points.
-//! @param z : array of Z coordinates of points.
-//! @param string : PLplot user string corresponding to the glyph to
+//! @param n Number of points in x, y, and z arrays.
+//! @param x Array of X coordinates of points.
+//! @param y Array of Y coordinates of points.
+//! @param z Array of Z coordinates of points.
+//! @param string PLplot user string corresponding to the glyph to
//! be plotted at each of the n points.
//--------------------------------------------------------------------------
@@ -534,14 +534,14 @@
// (may be inside or outside)
//
// side String which is one of the following:
-// B or b : Bottom of viewport
-// T or t : Top of viewport
-// BV or bv : Bottom of viewport, vertical text
-// TV or tv : Top of viewport, vertical text
-// L or l : Left of viewport
-// R or r : Right of viewport
-// LV or lv : Left of viewport, vertical text
-// RV or rv : Right of viewport, vertical text
+// B or b : Bottom of viewport
+// T or t : Top of viewport
+// BV or bv : Bottom of viewport, vertical text
+// TV or tv : Top of viewport, vertical text
+// L or l : Left of viewport
+// R or r : Right of viewport
+// LV or lv : Left of viewport, vertical text
+// RV or rv : Right of viewport, vertical text
//
// disp Displacement from specified edge of viewport, measured outwards from
// the viewport in units of the current character height. The
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hez...@us...> - 2011-04-17 22:00:59
|
Revision: 11709
http://plplot.svn.sourceforge.net/plplot/?rev=11709&view=rev
Author: hezekiahcarty
Date: 2011-04-17 22:00:53 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
The plshades and plimage families now support color ranges
These functions and their relatives (plimagefr, plfshades, etc.) now
respect the color map 1 range specified by plscmap1_range.
plgradient still needs to be updated, but it will be somewhat more tricky
because it involves adjustments to plot device code.
Modified Paths:
--------------
trunk/src/plimage.c
trunk/src/plshade.c
Modified: trunk/src/plimage.c
===================================================================
--- trunk/src/plimage.c 2011-04-17 22:00:13 UTC (rev 11708)
+++ trunk/src/plimage.c 2011-04-17 22:00:53 UTC (rev 11709)
@@ -215,6 +215,8 @@
PLFLT datum;
// Color palette 0 color in use before the plimage* call
PLINT init_color;
+ // Color range
+ PLFLT color_min, color_max, color_range;
if ( plsc->level < 3 )
{
@@ -244,6 +246,11 @@
idataops->minmax( idatap, nx, ny, &zmin, &zmax );
}
+ // Calculate the size of the color range to use
+ color_min = plsc->cmap1_min;
+ color_max = plsc->cmap1_max;
+ color_range = color_max - color_min;
+
// Go through the image values and scale them to fit in
// the COLOR_MIN to COLOR_MAX range.
// Any values greater than valuemax are set to valuemax,
@@ -257,7 +264,7 @@
if ( valuemin == valuemax )
{
// If valuemin == valuemax, avoid dividing by zero.
- z[ix * ny + iy] = ( COLOR_MAX + COLOR_MIN ) / 2.0;
+ z[ix * ny + iy] = ( color_max + color_min ) / 2.0;
}
else
{
@@ -277,9 +284,9 @@
{
datum = valuemax;
}
- // Set to a value scaled between COLOR_MIN and COLOR_MAX.
+ // Set to a value scaled between color_min and color_max.
z[ix * ny + iy] =
- ( datum - valuemin + COLOR_MIN ) / ( valuemax - valuemin ) * COLOR_MAX;
+ color_min + ( datum - valuemin + COLOR_MIN ) / ( valuemax - valuemin ) * COLOR_MAX * color_range;
}
}
}
Modified: trunk/src/plshade.c
===================================================================
--- trunk/src/plshade.c 2011-04-17 22:00:13 UTC (rev 11708)
+++ trunk/src/plshade.c 2011-04-17 22:00:53 UTC (rev 11709)
@@ -248,12 +248,18 @@
{
PLFLT shade_min, shade_max, shade_color;
PLINT i, init_color, init_width;
+ PLFLT color_min, color_max, color_range;
+ // Color range to use
+ color_min = plsc->cmap1_min;
+ color_max = plsc->cmap1_max;
+ color_range = color_max - color_min;
+
for ( i = 0; i < nlevel - 1; i++ )
{
shade_min = clevel[i];
shade_max = clevel[i + 1];
- shade_color = i / (PLFLT) ( nlevel - 2 );
+ shade_color = color_min + i / (PLFLT) ( nlevel - 2 ) * color_range;
// The constants in order mean
// (1) color map1,
// (0, 0, 0, 0) all edge effects will be done with plcont rather
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-06-21 16:43:42
|
Revision: 11775
http://plplot.svn.sourceforge.net/plplot/?rev=11775&view=rev
Author: airwin
Date: 2011-06-21 16:43:35 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
Implement bounding box that includes both vertical and horizontal
components of numerical labelling for horizontal axes. Example 33
confirms this improvement is working properly.
ToDo: Need to implement similar functionality for exponent of
numerical label (where present), custom labels, vertical axes, and
overall colorbar label.
Modified Paths:
--------------
trunk/src/plbox.c
trunk/src/pllegend.c
Modified: trunk/src/plbox.c
===================================================================
--- trunk/src/plbox.c 2011-06-20 22:09:33 UTC (rev 11774)
+++ trunk/src/plbox.c 2011-06-21 16:43:35 UTC (rev 11775)
@@ -1369,7 +1369,11 @@
PLFLT pos, tn, tp, offset, height, just;
PLFLT factor, tstart;
const char *timefmt;
+ PLFLT default_mm, char_height_mm, height_mm;
+ PLFLT string_length_mm, pos_mm;
+ plgchr( &default_mm, &char_height_mm );
+
// Set plot options from input
ldx = plP_stsearch( xopt, 'd' );
@@ -1402,110 +1406,201 @@
vpwyma = ( vpwymax > vpwymin ) ? vpwymax : vpwymin;
// Write horizontal label(s)
- if ( plsc->if_boxbb )
+ if ( ( lmx || lnx ) && ( ltx || lxx ) )
{
- }
- else
- {
- if ( ( lmx || lnx ) && ( ltx || lxx ) )
+ PLINT xmode, xprec, xdigmax, xdigits, xscale;
+
+ plgxax( &xdigmax, &xdigits );
+ pldprec( vpwxmi, vpwxma, xtick1, lfx, &xmode, &xprec, xdigmax, &xscale );
+ timefmt = plP_gtimefmt();
+
+ if ( ldx )
{
- PLINT xmode, xprec, xdigmax, xdigits, xscale;
+ pldtfac( vpwxmi, vpwxma, &factor, &tstart );
+ tp = xtick1 * ( 1. + floor( ( vpwxmi - tstart ) / xtick1 ) ) + tstart;
+ }
+ else
+ {
+ tp = xtick1 * ( 1. + floor( vpwxmi / xtick1 ) );
+ }
+ height = lix ? 1.75 : 1.5;
+ if ( plsc->if_boxbb )
+ {
+ // Height of zero corresponds to character centred on edge
+ // so should add 0.5 to height to obtain bounding box edge
+ // in direction away from edge. However, experimentally
+ // found 0.7 gave a better looking result.
+ height_mm = ( height + 0.7 ) * char_height_mm;
+ if ( lnx )
+ plsc->boxbb_ymin = MIN( plsc->boxbb_ymin, plsc->vppymi /
+ plsc->ypmm - height_mm );
+ if ( lmx )
+ plsc->boxbb_ymax = MAX( plsc->boxbb_ymax, plsc->vppyma /
+ plsc->ypmm + height_mm );
+ }
- plgxax( &xdigmax, &xdigits );
- pldprec( vpwxmi, vpwxma, xtick1, lfx, &xmode, &xprec, xdigmax, &xscale );
- timefmt = plP_gtimefmt();
-
+ for ( tn = tp; BETW( tn, vpwxmi, vpwxma ); tn += xtick1 )
+ {
if ( ldx )
{
- pldtfac( vpwxmi, vpwxma, &factor, &tstart );
- tp = xtick1 * ( 1. + floor( ( vpwxmi - tstart ) / xtick1 ) ) + tstart;
+ strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig );
}
else
- tp = xtick1 * ( 1. + floor( vpwxmi / xtick1 ) );
- for ( tn = tp; BETW( tn, vpwxmi, vpwxma ); tn += xtick1 )
{
- if ( ldx )
+ plform( PL_X_AXIS, tn, xscale, xprec, string, STRING_LEN, llx, lfx, lox );
+ }
+ pos = ( vpwxmax > vpwxmin ) ?
+ ( tn - vpwxmi ) / ( vpwxma - vpwxmi ) :
+ ( vpwxma - tn ) / ( vpwxma - vpwxmi );
+ if ( plsc->if_boxbb )
+ {
+ string_length_mm = plstrl( string );
+ pos_mm = ( plsc->vppxmi + pos * ( plsc->vppxma - plsc->vppxmi ) ) /
+ plsc->xpmm;
+ }
+ if ( lnx )
+ {
+ // Bottom axis.
+ if ( plsc->if_boxbb )
{
- strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig );
+ plsc->boxbb_xmin = MIN( plsc->boxbb_xmin,
+ pos_mm - 0.5 * string_length_mm );
+ plsc->boxbb_xmax = MAX( plsc->boxbb_xmax,
+ pos_mm + 0.5 * string_length_mm );
}
else
{
- plform( PL_X_AXIS, tn, xscale, xprec, string, STRING_LEN, llx, lfx, lox );
+ plmtex( "b", height, pos, 0.5, string );
}
- height = lix ? 1.75 : 1.5;
- pos = ( vpwxmax > vpwxmin ) ?
- ( tn - vpwxmi ) / ( vpwxma - vpwxmi ) :
- ( vpwxma - tn ) / ( vpwxma - vpwxmi );
- if ( lnx )
- plmtex( "b", height, pos, 0.5, string );
- if ( lmx )
+ }
+ if ( lmx )
+ {
+ // Top axis.
+ if ( plsc->if_boxbb )
+ {
+ plsc->boxbb_xmin = MIN( plsc->boxbb_xmin,
+ pos_mm - 0.5 * string_length_mm );
+ plsc->boxbb_xmax = MAX( plsc->boxbb_xmax,
+ pos_mm + 0.5 * string_length_mm );
+ }
+ else
+ {
plmtex( "t", height, pos, 0.5, string );
+ }
}
- xdigits = 2;
- plsxax( xdigmax, xdigits );
+ }
+ xdigits = 2;
+ plsxax( xdigmax, xdigits );
- // Write separate exponential label if mode = 1.
+ // Write separate exponential label if mode = 1.
- if ( !llx && !ldx && !lox && xmode )
+ if ( !llx && !ldx && !lox && xmode )
+ {
+ // Assume label data is for placement of exponents if no custom
+ // label function is provided.
+ if ( plsc->label_data )
{
- // Assume label data is for placement of exponents if no custom
- // label function is provided.
- if ( plsc->label_data )
+ height = ( (PLLabelDefaults *) plsc->label_data )->exp_label_disp;
+ pos = ( (PLLabelDefaults *) plsc->label_data )->exp_label_pos;
+ just = ( (PLLabelDefaults *) plsc->label_data )->exp_label_just;
+ }
+ else
+ {
+ height = 3.2;
+ pos = 1.0;
+ just = 0.5;
+ }
+ snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) xscale );
+ if ( lnx )
+ {
+ // Bottom axis exponent.
+ if ( plsc->if_boxbb )
{
- height = ( (PLLabelDefaults *) plsc->label_data )->exp_label_disp;
- pos = ( (PLLabelDefaults *) plsc->label_data )->exp_label_pos;
- just = ( (PLLabelDefaults *) plsc->label_data )->exp_label_just;
+ // FIXME: Add Y bounding box calculations for
+ // exponent.
+ // FIXME: Add X bounding box calculations for
+ // exponent that slops over the end of the axis.
}
else
{
- height = 3.2;
- pos = 1.0;
- just = 0.5;
+ plmtex( "b", height, pos, just, string );
}
- snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) xscale );
- if ( lnx )
- plmtex( "b", height, pos, just, string );
- if ( lmx )
+ }
+ if ( lmx )
+ {
+ // Top axis exponent.
+ if ( plsc->if_boxbb )
+ {
+ // FIXME: Add Y bounding box calculations for
+ // exponent.
+ // FIXME: Add X bounding box calculations for
+ // exponent that slops over the end of the axis.
+ }
+ else
+ {
plmtex( "t", height, pos, just, string );
+ }
}
}
+ }
// Write vertical label(s)
- if ( ( lmy || lny ) && ( lty || lxy ) )
- {
- PLINT ymode, yprec, ydigmax, ydigits, yscale;
+ if ( ( lmy || lny ) && ( lty || lxy ) )
+ {
+ PLINT ymode, yprec, ydigmax, ydigits, yscale;
- plgyax( &ydigmax, &ydigits );
- pldprec( vpwymi, vpwyma, ytick1, lfy, &ymode, &yprec, ydigmax, &yscale );
+ plgyax( &ydigmax, &ydigits );
+ pldprec( vpwymi, vpwyma, ytick1, lfy, &ymode, &yprec, ydigmax, &yscale );
- ydigits = 0;
+ ydigits = 0;
+ if ( ldy )
+ {
+ pldtfac( vpwymi, vpwyma, &factor, &tstart );
+ tp = ytick1 * ( 1. + floor( ( vpwymi - tstart ) / ytick1 ) ) + tstart;
+ }
+ else
+ {
+ tp = ytick1 * ( 1. + floor( vpwymi / ytick1 ) );
+ }
+ for ( tn = tp; BETW( tn, vpwymi, vpwyma ); tn += ytick1 )
+ {
if ( ldy )
{
- pldtfac( vpwymi, vpwyma, &factor, &tstart );
- tp = ytick1 * ( 1. + floor( ( vpwymi - tstart ) / ytick1 ) ) + tstart;
+ strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig );
}
else
- tp = ytick1 * ( 1. + floor( vpwymi / ytick1 ) );
- for ( tn = tp; BETW( tn, vpwymi, vpwyma ); tn += ytick1 )
{
- if ( ldy )
+ plform( PL_Y_AXIS, tn, yscale, yprec, string, STRING_LEN, lly, lfy, loy );
+ }
+ pos = ( vpwymax > vpwymin ) ?
+ ( tn - vpwymi ) / ( vpwyma - vpwymi ) :
+ ( vpwyma - tn ) / ( vpwyma - vpwymi );
+ if ( lny )
+ {
+ if ( lvy )
{
- strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig );
+ // Left axis with text written perpendicular to edge.
+ if ( plsc->if_boxbb )
+ {
+ // FIXME: Add X bounding box calculations for
+ // numerical labels that slop over the end of the
+ // axis.
+ }
+ else
+ {
+ height = liy ? 1.0 : 0.5;
+ plmtex( "lv", height, pos, 1.0, string );
+ }
}
else
{
- plform( PL_Y_AXIS, tn, yscale, yprec, string, STRING_LEN, lly, lfy, loy );
- }
- pos = ( vpwymax > vpwymin ) ?
- ( tn - vpwymi ) / ( vpwyma - vpwymi ) :
- ( vpwyma - tn ) / ( vpwyma - vpwymi );
- if ( lny )
- {
- if ( lvy )
+ // Top axis.
+ if ( plsc->if_boxbb )
{
- height = liy ? 1.0 : 0.5;
- plmtex( "lv", height, pos, 1.0, string );
+ // FIXME: Add X bounding box calculations for
+ // numerical labels that slop over the end of the
+ // axis.
}
else
{
@@ -1513,52 +1608,82 @@
plmtex( "l", height, pos, 0.5, string );
}
}
- if ( lmy )
+ }
+ if ( lmy )
+ {
+ if ( lvy )
{
- if ( lvy )
+ // Top axis.
+ if ( plsc->if_boxbb )
{
+ // FIXME: Add X bounding box calculations for
+ // numerical labels that slop over the end of the
+ // axis.
+ }
+ else
+ {
height = liy ? 1.0 : 0.5;
plmtex( "rv", height, pos, 0.0, string );
}
+ }
+ else
+ {
+ // Top axis.
+ if ( plsc->if_boxbb )
+ {
+ // FIXME: Add X bounding box calculations for
+ // numerical labels that slop over the end of the
+ // axis.
+ }
else
{
height = liy ? 1.75 : 1.5;
plmtex( "r", height, pos, 0.5, string );
}
}
- ydigits = MAX( ydigits, (PLINT) strlen( string ) );
}
- if ( !lvy )
- ydigits = 2;
+ ydigits = MAX( ydigits, (PLINT) strlen( string ) );
+ }
+ if ( !lvy )
+ ydigits = 2;
- plsyax( ydigmax, ydigits );
+ plsyax( ydigmax, ydigits );
- // Write separate exponential label if mode = 1.
+ // Write separate exponential label if mode = 1.
- if ( !lly && !ldy && !loy && ymode )
+ if ( !lly && !ldy && !loy && ymode )
+ {
+ snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) yscale );
+ if ( plsc->label_data )
{
- snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) yscale );
- if ( plsc->label_data )
+ height = ( (PLLabelDefaults *) plsc->label_data )->exp_label_disp;
+ pos = ( (PLLabelDefaults *) plsc->label_data )->exp_label_pos;
+ just = ( (PLLabelDefaults *) plsc->label_data )->exp_label_just;
+ }
+ else
+ {
+ offset = 0.02;
+ height = 2.0;
+ if ( lny )
{
- height = ( (PLLabelDefaults *) plsc->label_data )->exp_label_disp;
- pos = ( (PLLabelDefaults *) plsc->label_data )->exp_label_pos;
- just = ( (PLLabelDefaults *) plsc->label_data )->exp_label_just;
+ pos = 0.0 - offset;
+ just = 1.0;
}
- else
+ if ( lmy )
{
- offset = 0.02;
- height = 2.0;
- if ( lny )
- {
- pos = 0.0 - offset;
- just = 1.0;
- }
- if ( lmy )
- {
- pos = 1.0 + offset;
- just = 0.0;
- }
+ pos = 1.0 + offset;
+ just = 0.0;
}
+ }
+ // Top axis.
+ if ( plsc->if_boxbb )
+ {
+ // FIXME: Add X bounding box calculations for
+ // numerical labels that slop over the end of the
+ // axis.
+ }
+ else
+ {
plmtex( "t", height, pos, just, string );
}
}
Modified: trunk/src/pllegend.c
===================================================================
--- trunk/src/pllegend.c 2011-06-20 22:09:33 UTC (rev 11774)
+++ trunk/src/pllegend.c 2011-06-21 16:43:35 UTC (rev 11775)
@@ -1177,7 +1177,7 @@
// direction of the orientation of the cap. In other words,
// cap_angle completely controls the shape of the triangle, but
// not its scale.
- PLFLT cap_angle = 90.;
+ PLFLT cap_angle = 45.;
// Ratio of length of cap in orientation direction
// to the width of the bar (and cap) in the direction
// perpendicular to the orientation in physical coordinates
@@ -1218,7 +1218,7 @@
// undecorated colorbar (where the decorations consist of external
// tick marks, numerical tick labels, or text if any of those
// exist) and the bounding box.
- PLFLT dx_subpage = 0., dy_subpage = 0.;
+ PLFLT dx_subpage, dy_subpage;
// Normalized subpage coordinates of the top left of undecorated
// colorbar,
PLFLT plot_x_subpage, plot_y_subpage;
@@ -1252,8 +1252,11 @@
// Ratio of normalized subpage coordinates to mm coordinates in
// x and y.
- PLFLT ncxpmm, ncypmm;
+ PLFLT sbxpmm, sbypmm;
+ // Decorated colorbox bounding box limits in subpage coordinates.
+ PLFLT bb_xmin, bb_xmax, bb_ymin, bb_ymax;
+
// Default position flags and sanity checks for position flags.
if ( !( position & PL_POSITION_RIGHT ) && !( position & PL_POSITION_LEFT ) && !( position & PL_POSITION_TOP ) && !( position & PL_POSITION_BOTTOM ) )
{
@@ -1342,8 +1345,8 @@
adopted_to_subpage_x( 0. );
colorbar_height = adopted_to_subpage_y( y_length ) -
adopted_to_subpage_y( 0. );
- // width and height of colorbar bounding box in normalized subpage
- // coordinates. Caps taken care of.
+ // Extent of cap in normalized subpage coordinates in either X or Y
+ // direction as appropriate.
if ( opt & PL_COLORBAR_ORIENT_RIGHT || opt & PL_COLORBAR_ORIENT_LEFT )
{
cap_extent = cap_ratio * colorbar_height / aspspp;
@@ -1397,56 +1400,40 @@
// marks + numerical tick labels) box.
draw_box( TRUE, opt, axis_opts, if_edge,
ticks, sub_ticks, n_values, values );
- ncxpmm = plsc->xpmm / ( plsc->sppxma - plsc->sppxmi );
- ncypmm = plsc->ypmm / ( plsc->sppyma - plsc->sppymi );
- colorbar_width_bb = ( plsc->boxbb_xmax - plsc->boxbb_xmin ) * ncxpmm;
- colorbar_height_bb = ( plsc->boxbb_ymax - plsc->boxbb_ymin ) * ncypmm;
- // Offsets of upper left corner relative to plvpor coordinates of that
- // point which are (0., colorbar_height), see above.
- dx_subpage += -plsc->boxbb_xmin * ncxpmm;
- dy_subpage -= plsc->boxbb_ymax * ncypmm - colorbar_height;
+ sbxpmm = plsc->xpmm / ( plsc->sppxma - plsc->sppxmi );
+ sbypmm = plsc->ypmm / ( plsc->sppyma - plsc->sppymi );
+ bb_xmin = plsc->boxbb_xmin * sbxpmm;
+ bb_xmax = plsc->boxbb_xmax * sbxpmm;
+ bb_ymin = plsc->boxbb_ymin * sbypmm;
+ bb_ymax = plsc->boxbb_ymax * sbypmm;
if ( opt & PL_COLORBAR_CAP_LOW )
{
if ( opt & PL_COLORBAR_ORIENT_RIGHT )
- {
- colorbar_width_bb += cap_extent;
- dx_subpage += cap_extent;
- }
+ bb_xmin = MIN( bb_xmin, -cap_extent );
if ( opt & PL_COLORBAR_ORIENT_TOP )
- {
- colorbar_height_bb += cap_extent;
- }
+ bb_ymin = MIN( bb_ymin, -cap_extent );
if ( opt & PL_COLORBAR_ORIENT_LEFT )
- {
- colorbar_width_bb += cap_extent;
- }
+ bb_xmax = MAX( bb_xmax, colorbar_width + cap_extent );
if ( opt & PL_COLORBAR_ORIENT_BOTTOM )
- {
- colorbar_height_bb += cap_extent;
- dy_subpage -= cap_extent;
- }
+ bb_ymax = MAX( bb_ymax, colorbar_height + cap_extent );
}
if ( opt & PL_COLORBAR_CAP_HIGH )
{
if ( opt & PL_COLORBAR_ORIENT_RIGHT )
- {
- colorbar_width_bb += cap_extent;
- }
+ bb_xmax = MAX( bb_xmax, colorbar_width + cap_extent );
if ( opt & PL_COLORBAR_ORIENT_TOP )
- {
- colorbar_height_bb += cap_extent;
- dy_subpage -= cap_extent;
- }
+ bb_ymax = MAX( bb_ymax, colorbar_height + cap_extent );
if ( opt & PL_COLORBAR_ORIENT_LEFT )
- {
- colorbar_width_bb += cap_extent;
- dx_subpage += cap_extent;
- }
+ bb_xmin = MIN( bb_xmin, -cap_extent );
if ( opt & PL_COLORBAR_ORIENT_BOTTOM )
- {
- colorbar_height_bb += cap_extent;
- }
+ bb_ymin = MIN( bb_ymin, -cap_extent );
}
+ colorbar_width_bb = bb_xmax - bb_xmin;
+ colorbar_height_bb = bb_ymax - bb_ymin;
+ // Offsets of upper left corner relative to plvpor coordinates of that
+ // point which are (0., colorbar_height), see above.
+ dx_subpage = -bb_xmin;
+ dy_subpage = colorbar_height - bb_ymax;
// Total width and height of colorbar bounding box in adopted subpage
// coordinates.
colorbar_width_vc = subpage_to_adopted_x( colorbar_width_bb ) -
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|