[GRASS-SVN] r32393 - in grass/trunk: include lib/g3d

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 30 19:57:49 EDT 2008


Author: glynn
Date: 2008-07-30 19:57:49 -0400 (Wed, 30 Jul 2008)
New Revision: 32393

Modified:
   grass/trunk/include/G3d.h
   grass/trunk/lib/g3d/g3drange.c
   grass/trunk/lib/g3d/g3dwindowio.c
Log:
Add format, noreturn __attribute__s to G3d functions.
Some GPATH_MAX and G3d_error clean-ups which were missed last time


Modified: grass/trunk/include/G3d.h
===================================================================
--- grass/trunk/include/G3d.h	2008-07-30 23:46:11 UTC (rev 32392)
+++ grass/trunk/include/G3d.h	2008-07-30 23:57:49 UTC (rev 32393)
@@ -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/trunk/lib/g3d/g3drange.c
===================================================================
--- grass/trunk/lib/g3d/g3drange.c	2008-07-30 23:46:11 UTC (rev 32392)
+++ grass/trunk/lib/g3d/g3drange.c	2008-07-30 23:57:49 UTC (rev 32393)
@@ -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/trunk/lib/g3d/g3dwindowio.c
===================================================================
--- grass/trunk/lib/g3d/g3dwindowio.c	2008-07-30 23:46:11 UTC (rev 32392)
+++ grass/trunk/lib/g3d/g3dwindowio.c	2008-07-30 23:57:49 UTC (rev 32393)
@@ -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