[GRASS-SVN] r32397 - in grass/branches/develbranch_6: include
lib/g3d
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 31 01:59:03 EDT 2008
Author: martinl
Date: 2008-07-31 01:59:03 -0400 (Thu, 31 Jul 2008)
New Revision: 32397
Modified:
grass/branches/develbranch_6/include/G3d.h
grass/branches/develbranch_6/lib/g3d/g3drange.c
grass/branches/develbranch_6/lib/g3d/g3dwindowio.c
Log:
glynn: Add format, noreturn __attribute__s to G3d functions.
Some GPATH_MAX and G3d_error clean-ups which were missed last time
(merged from trunk, r32393)
Modified: grass/branches/develbranch_6/include/G3d.h
===================================================================
--- grass/branches/develbranch_6/include/G3d.h 2008-07-31 05:57:23 UTC (rev 32396)
+++ grass/branches/develbranch_6/include/G3d.h 2008-07-31 05:59:03 UTC (rev 32397)
@@ -321,9 +321,9 @@
/* grass/src/libes/g3d/g3derror.c */
void G3d_skipError(const char *);
void G3d_printError(const char *);
-void G3d_fatalError(const char *, ...);
-void G3d_fatalError_noargs(const char *);
-void G3d_error(const char *, ...);
+void G3d_fatalError(const char *, ...) __attribute__((format(printf,1,2))) __attribute__((noreturn));
+void G3d_fatalError_noargs(const char *) __attribute__((noreturn));
+void G3d_error(const char *, ...) __attribute__((format(printf,1,2)));
/* grass/src/libes/g3d/g3dfpxdr.c */
int G3d_isXdrNullNum(const void *, int);
int G3d_isXdrNullFloat(const float *);
Modified: grass/branches/develbranch_6/lib/g3d/g3drange.c
===================================================================
--- grass/branches/develbranch_6/lib/g3d/g3drange.c 2008-07-31 05:57:23 UTC (rev 32396)
+++ grass/branches/develbranch_6/lib/g3d/g3drange.c 2008-07-31 05:59:03 UTC (rev 32397)
@@ -207,7 +207,7 @@
G3d_range_write (G3D_Map *map)
{
- char path[4096];
+ char path[GPATH_MAX];
G3d_filename (path, G3D_RANGE_ELEMENT, map->fileName, map->mapset);
remove ( path );
Modified: grass/branches/develbranch_6/lib/g3d/g3dwindowio.c
===================================================================
--- grass/branches/develbranch_6/lib/g3d/g3dwindowio.c 2008-07-31 05:57:23 UTC (rev 32396)
+++ grass/branches/develbranch_6/lib/g3d/g3dwindowio.c 2008-07-31 05:59:03 UTC (rev 32397)
@@ -138,7 +138,7 @@
{
struct Cell_head win;
struct Key_Value *windowKeys;
- char path[1024], msg[1024];
+ char path[GPATH_MAX];
int status;
@@ -169,8 +169,7 @@
windowKeys = G_read_key_value_file (path, &status);
if (status != 0) {
- sprintf (msg, "G3d_readWindow: Unable to open %s", path);
- G3d_error (msg);
+ G3d_error ("G3d_readWindow: Unable to open %s", path);
return 0;
}
@@ -182,8 +181,7 @@
&(window->cols), &(window->depths),
&(window->ew_res), &(window->ns_res),
&(window->tb_res))) {
- sprintf (msg, "G3d_readWindow: error extracting window key(s) of file %s", path);
- G3d_error (msg);
+ G3d_error ("G3d_readWindow: error extracting window key(s) of file %s", path);
return 0;
}
@@ -276,7 +274,7 @@
*/
void
-G3d_useWindowParams ()
+G3d_useWindowParams (void)
{
G3d_setWindowParams ();
More information about the grass-commit
mailing list