From: <and...@us...> - 2012-10-22 21:05:52
|
Revision: 12247 http://plplot.svn.sourceforge.net/plplot/?rev=12247&view=rev Author: andrewross Date: 2012-10-22 21:05:46 +0000 (Mon, 22 Oct 2012) Log Message: ----------- Style last commit. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2012-10-22 19:43:39 UTC (rev 12246) +++ trunk/src/plmap.c 2012-10-22 21:05:46 UTC (rev 12247) @@ -111,7 +111,7 @@ plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ) { - int i, j; + int i, j; char *filename; char *warning; int n = 200; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-24 21:20:05
|
Revision: 12252 http://plplot.svn.sourceforge.net/plplot/?rev=12252&view=rev Author: andrewross Date: 2012-10-24 21:19:59 +0000 (Wed, 24 Oct 2012) Log Message: ----------- Only compile in support for the old plplot map file format is PL_DEPRECATED is set. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2012-10-24 14:51:30 UTC (rev 12251) +++ trunk/src/plmap.c 2012-10-24 21:19:59 UTC (rev 12252) @@ -111,6 +111,7 @@ plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ) { +#if defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) int i, j; char *filename; char *warning; @@ -345,6 +346,9 @@ free( bufy ); free( filename ); free( warning ); +#else // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) + plwarn( "Use of the old plplot map file format is deprecated.\nIt is recommended that the shapelib library is used to provide map support.\n" ); +#endif // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) } //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-10-27 05:34:20
|
Revision: 12257 http://plplot.svn.sourceforge.net/plplot/?rev=12257&view=rev Author: airwin Date: 2012-10-27 05:34:13 +0000 (Sat, 27 Oct 2012) Log Message: ----------- Tweak wording. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2012-10-25 17:36:06 UTC (rev 12256) +++ trunk/src/plmap.c 2012-10-27 05:34:13 UTC (rev 12257) @@ -347,7 +347,7 @@ free( filename ); free( warning ); #else // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) - plwarn( "Use of the old plplot map file format is deprecated.\nIt is recommended that the shapelib library is used to provide map support.\n" ); + plwarn( "Use of the old plplot map file format is deprecated.\nIt is recommended that the shapelib library be used to provide map support.\n" ); #endif // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-26 06:45:49
|
Revision: 12752 http://sourceforge.net/p/plplot/code/12752 Author: airwin Date: 2013-11-26 06:45:44 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Make pldebug work. Slightly improve commentary and debug messages. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-11-25 23:36:23 UTC (rev 12751) +++ trunk/src/plmap.c 2013-11-26 06:45:44 UTC (rev 12752) @@ -39,7 +39,8 @@ // // -#define NEED_PLDEBUG 1 +#define DEBUG +#define NEED_PLDEBUG #include "plplotP.h" @@ -544,7 +545,7 @@ return NULL; done: - pldebug( "OpenShapeFile", "Found file %s\n", fs ); + pldebug( "OpenShapeFile", "SHPOpen successfully opened two files with basename %s\n", fs ); free_mem( fs ); return ( file ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-27 06:09:51
|
Revision: 12758 http://sourceforge.net/p/plplot/code/12758 Author: airwin Date: 2013-11-27 06:09:46 +0000 (Wed, 27 Nov 2013) Log Message: ----------- Use an approach suggested by Frank Warmerdam <war...@po...>, the developer of shapelib to quiet the misleading "Unable to open" error messages generated by shapelib due to our method of searching several directories until the shapelib routine SHPOpenLL returns a non-NULL result indicating shapelib has found shapefiles with the correct basename. Tested by Alan W. Irwin <ai...@us...> with variants of the final CustomErrors to prove this function was being called and was correctly suppressing "Unable to open" error messages. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-11-26 20:59:05 UTC (rev 12757) +++ trunk/src/plmap.c 2013-11-27 06:09:46 UTC (rev 12758) @@ -50,6 +50,9 @@ SHPHandle OpenShapeFile( const char *fn ); +static void +CustomErrors(const char *message); + #endif //-------------------------------------------------------------------------- @@ -470,19 +473,32 @@ //! found //-------------------------------------------------------------------------- #ifdef HAVE_SHAPELIB +// Our thanks to Frank Warmerdam, the developer of shapelib for suggesting +// this approach for quieting shapelib "Unable to open" error messages. +static +void CustomErrors(const char *message) +{ + if (strstr(message,"Unable to open") == NULL) + fprintf( stderr, "%s\n", message ); +} + SHPHandle OpenShapeFile( const char *fn ) { SHPHandle file; char *fs = NULL, *dn = NULL; + SAHooks sHooks; + SASetupDefaultHooks( &sHooks ); + sHooks.Error = CustomErrors; + //*** search build tree *** if ( plInBuildTree() == 1 ) { plGetName( SOURCE_DIR, "data", fn, &fs ); - if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fs, "rb", &sHooks ) ) != NULL ) goto done; } @@ -493,7 +509,7 @@ { plGetName( dn, "", fn, &fs ); - if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fs, "rb", &sHooks ) ) != NULL ) goto done; fprintf( stderr, PLPLOT_LIB_ENV "=\"%s\"\n", dn ); // what IS set? } @@ -501,7 +517,7 @@ //*** search current directory *** - if ( ( file = SHPOpen( fn, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fn, "rb", &sHooks ) ) != NULL ) { pldebug( "OpenShapeFile", "Found file %s in current directory.\n", fn ); free_mem( fs ); @@ -515,7 +531,7 @@ { plGetName( dn, "lib", fn, &fs ); - if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fs, "rb", &sHooks ) ) != NULL ) goto done; fprintf( stderr, PLPLOT_HOME_ENV "=\"%s\"\n", dn ); // what IS set? } @@ -526,7 +542,7 @@ #if defined ( DATA_DIR ) plGetName( DATA_DIR, "", fn, &fs ); - if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fs, "rb", &sHooks ) ) != NULL ) goto done; #endif // DATA_DIR @@ -535,7 +551,7 @@ #ifdef PLLIBDEV plGetName( PLLIBDEV, "", fn, &fs ); - if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + if ( ( file = SHPOpenLL( fs, "rb", &sHooks ) ) != NULL ) goto done; #endif // PLLIBDEV This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-27 18:16:38
|
Revision: 12770 http://sourceforge.net/p/plplot/code/12770 Author: airwin Date: 2013-11-27 18:16:31 +0000 (Wed, 27 Nov 2013) Log Message: ----------- Solve recently introduced build issue for the majority of Debian-based distribution users who are still using an ancient version of shapelib. If the HAVE_SAHOOKS macro is not defined (always in the present case because I haven't yet created the test to #define HAVE_SAHOOKS) drop back to using SHPOpen with no SAHooks argument) rather than SHPOpenLL. Tested by Alan W. Irwin <ai...@us...> on Linux by building and running (using valgrind) standard C example 19, which produced good results (completely clean valgrind run and good plots) along with the misleading but expected Unable to open usaglobe.shp or usaglobe.SHP. Unable to open usaglobe.shp or usaglobe.SHP. Unable to open globe.shp or globe.SHP. Unable to open globe.shp or globe.SHP. messages from SHPOpen. ToDo: implement a CMake-based test that will #define the HAVE_SAHOOKS C macro (or not) for plmap.c. This will get rid of the above misleading messages if the shapelib library is modern enough to include SAHooks. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-11-27 15:37:50 UTC (rev 12769) +++ trunk/src/plmap.c 2013-11-27 18:16:31 UTC (rev 12770) @@ -487,10 +487,18 @@ { SHPHandle file; char *fs = NULL, *dn = NULL; +#ifdef HAVE_SAHOOKS SAHooks sHooks; SASetupDefaultHooks( &sHooks ); sHooks.Error = CustomErrors; +#else + // Using ancient version of shapelib without SAHooks or SHPOpenLL. + // For this case live with the misleading "Unable to open" error + // messages. + int sHooks; +#define SHPOpenLL(a, b, c) SHPOpen(a, b) +#endif //*** search build tree *** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-27 18:22:42
|
Revision: 12771 http://sourceforge.net/p/plplot/code/12771 Author: airwin Date: 2013-11-27 18:22:39 +0000 (Wed, 27 Nov 2013) Log Message: ----------- Style previous commit. Modified Paths: -------------- trunk/src/plmap.c Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-11-27 18:16:31 UTC (rev 12770) +++ trunk/src/plmap.c 2013-11-27 18:22:39 UTC (rev 12771) @@ -51,7 +51,7 @@ OpenShapeFile( const char *fn ); static void -CustomErrors(const char *message); +CustomErrors( const char *message ); #endif @@ -476,9 +476,9 @@ // Our thanks to Frank Warmerdam, the developer of shapelib for suggesting // this approach for quieting shapelib "Unable to open" error messages. static -void CustomErrors(const char *message) +void CustomErrors( const char *message ) { - if (strstr(message,"Unable to open") == NULL) + if ( strstr( message, "Unable to open" ) == NULL ) fprintf( stderr, "%s\n", message ); } @@ -487,8 +487,8 @@ { SHPHandle file; char *fs = NULL, *dn = NULL; -#ifdef HAVE_SAHOOKS - SAHooks sHooks; +#ifdef HAVE_SAHOOKS + SAHooks sHooks; SASetupDefaultHooks( &sHooks ); sHooks.Error = CustomErrors; @@ -497,7 +497,7 @@ // For this case live with the misleading "Unable to open" error // messages. int sHooks; -#define SHPOpenLL(a, b, c) SHPOpen(a, b) +#define SHPOpenLL( a, b, c ) SHPOpen( a, b ) #endif //*** search build tree *** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |