[GRASS-SVN] r56982 - in grass/trunk: display/d.font general/g.access general/g.mkfontcap include include/defs include/iostream lib/db/dbmi_base lib/gis lib/init lib/vector/Vlib lib/vector/dglib/examples lib/vector/diglib raster/r.li/r.li.daemon vector/v.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jul 2 07:37:38 PDT 2013


Author: mmetz
Date: 2013-07-02 07:37:37 -0700 (Tue, 02 Jul 2013)
New Revision: 56982

Modified:
   grass/trunk/display/d.font/main.c
   grass/trunk/general/g.access/get_perms.c
   grass/trunk/general/g.mkfontcap/freetype_fonts.c
   grass/trunk/include/config.h.in
   grass/trunk/include/defs/gis.h
   grass/trunk/include/iostream/ami_stream.h
   grass/trunk/lib/db/dbmi_base/isdir.c
   grass/trunk/lib/gis/copy_dir.c
   grass/trunk/lib/gis/mapset_msc.c
   grass/trunk/lib/gis/mapset_nme.c
   grass/trunk/lib/gis/paths.c
   grass/trunk/lib/gis/remove.c
   grass/trunk/lib/gis/user_config.c
   grass/trunk/lib/init/clean_temp.c
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/dglib/examples/parse.c
   grass/trunk/lib/vector/diglib/file.c
   grass/trunk/raster/r.li/r.li.daemon/daemon.c
   grass/trunk/vector/v.mapcalc/map.c
Log:
simplify wingrass LFS

Modified: grass/trunk/display/d.font/main.c
===================================================================
--- grass/trunk/display/d.font/main.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/display/d.font/main.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -17,7 +17,6 @@
  *               for details.
  *
  *****************************************************************************/
-#include <grass/config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -99,7 +98,7 @@
     }
 
     if (opt2->answer) {		/* Full path to freetype font */
-	STRUCT_STAT info;
+	struct stat info;
 
 	/* Check a valid filename has been supplied */
 	if (stat(opt2->answer, &info) != 0)

Modified: grass/trunk/general/g.access/get_perms.c
===================================================================
--- grass/trunk/general/g.access/get_perms.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/general/g.access/get_perms.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -1,11 +1,11 @@
-#include <grass/config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <grass/config.h>
 #include "access.h"
 
 int get_perms(char *path, int *perms, int *group, int *other)
 {
-    STRUCT_STAT buf;
+    struct stat buf;
 
     if (stat(path, &buf) != 0)
 	return -1;

Modified: grass/trunk/general/g.mkfontcap/freetype_fonts.c
===================================================================
--- grass/trunk/general/g.mkfontcap/freetype_fonts.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/general/g.mkfontcap/freetype_fonts.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -14,7 +14,6 @@
  *
  *****************************************************************************/
 
-#include <grass/config.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -84,7 +83,7 @@
     char filepath[GPATH_MAX];
     DIR *curdir;
     struct dirent *cur_entry;
-    STRUCT_STAT info;
+    struct stat info;
 
     curdir = opendir(dirpath);
     if (curdir == NULL)

Modified: grass/trunk/include/config.h.in
===================================================================
--- grass/trunk/include/config.h.in	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/include/config.h.in	2013-07-02 14:37:37 UTC (rev 56982)
@@ -297,20 +297,12 @@
 #include <sys/stat.h>
 #define stat _stati64
 #define fstat _fstati64
-#define _STRUCT_STAT_
-typedef struct _stati64 STRUCT_STAT;
 
 #endif /* MINGW32 LFS */
 
 #endif	/* HAVE_LARGEFILES */
 
 
-#ifndef _STRUCT_STAT_
-#define _STRUCT_STAT_
-#include <sys/stat.h>
-typedef struct stat STRUCT_STAT;
-#endif
-
 /* define if langinfo.h exists */
 #undef HAVE_LANGINFO_H
 

Modified: grass/trunk/include/defs/gis.h
===================================================================
--- grass/trunk/include/defs/gis.h	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/include/defs/gis.h	2013-07-02 14:37:37 UTC (rev 56982)
@@ -498,8 +498,8 @@
 int G_is_absolute_path(const char *);
 char *G_convert_dirseps_to_host(char *);
 char *G_convert_dirseps_from_host(char *);
-int G_lstat(const char *, STRUCT_STAT *);
-int G_stat(const char *, STRUCT_STAT *);
+int G_lstat(const char *, struct stat *);
+int G_stat(const char *, struct stat *);
 int G_owner(const char *);
 
 /* percent.c */

Modified: grass/trunk/include/iostream/ami_stream.h
===================================================================
--- grass/trunk/include/iostream/ami_stream.h	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/include/iostream/ami_stream.h	2013-07-02 14:37:37 UTC (rev 56982)
@@ -412,7 +412,7 @@
 
   return (st_size / sizeof(T));
 #else
-  STRUCT_STAT buf;
+  struct stat buf;
   if (stat(path, &buf) == -1) {
     perror("AMI_STREAM::stream_len(): fstat failed ");
     DEBUG_ASSERT assert(0);

Modified: grass/trunk/lib/db/dbmi_base/isdir.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/isdir.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/db/dbmi_base/isdir.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -28,7 +28,7 @@
 */
 int db_isdir(const char *path)
 {
-    STRUCT_STAT x;
+    struct stat x;
 
     if (stat(path, &x) != 0)
 	return DB_FAILED;

Modified: grass/trunk/lib/gis/copy_dir.c
===================================================================
--- grass/trunk/lib/gis/copy_dir.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/copy_dir.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -63,7 +63,7 @@
 int G_recursive_copy(const char *src, const char *dst)
 {
     DIR *dirp;
-    STRUCT_STAT sb;
+    struct stat sb;
 
     if (G_lstat(src, &sb) < 0)
 	return 1;

Modified: grass/trunk/lib/gis/mapset_msc.c
===================================================================
--- grass/trunk/lib/gis/mapset_msc.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/mapset_msc.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -88,7 +88,7 @@
     return G__make_mapset_element(buf);
 }
 
-static int check_owner(const STRUCT_STAT *info)
+static int check_owner(const struct stat *info)
 {
 #if defined(__MINGW32__) || defined(SKIP_MAPSET_OWN_CHK)
     return 1;
@@ -116,7 +116,7 @@
 int G__mapset_permissions(const char *mapset)
 {
     char path[GPATH_MAX];
-    STRUCT_STAT info;
+    struct stat info;
 
     G_file_name(path, "", "", mapset);
 
@@ -146,7 +146,7 @@
 			   const char *mapset)
 {
     char path[GPATH_MAX];
-    STRUCT_STAT info;
+    struct stat info;
 
     sprintf(path, "%s/%s/%s", gisdbase, location, mapset);
 

Modified: grass/trunk/lib/gis/mapset_nme.c
===================================================================
--- grass/trunk/lib/gis/mapset_nme.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/mapset_nme.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -159,7 +159,7 @@
 
     while ((ent = readdir(dir))) {
 	char buf[GPATH_MAX];
-	STRUCT_STAT st;
+	struct stat st;
 
 	sprintf(buf, "%s/%s/WIND", G_location_path(), ent->d_name);
 

Modified: grass/trunk/lib/gis/paths.c
===================================================================
--- grass/trunk/lib/gis/paths.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/paths.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -120,12 +120,12 @@
  * Returns information about the specified file.
  *
  * \param file_name file name
- * \param stat
+ * \param stat pointer to structure filled with file information
  *
  * \return Return value from system lstat function
  **/
 
-int G_stat(const char *file_name, STRUCT_STAT *buf)
+int G_stat(const char *file_name, struct stat *buf)
 {
     return stat(file_name, buf);
 }
@@ -135,14 +135,14 @@
  *
  * Returns information about the specified file.
  *
- * \param file_name file name
- * \param stat in the case of a symbolic link, the link itself is
- *             stat-ed, not the file that it refers to
+ * \param file_name file name, in the case of a symbolic link, the 
+ *                  link itself is stat-ed, not the file that it refers to
+ * \param stat pointer to structure filled with file information
  *
  * \return Return value from system lstat function
  **/
 
-int G_lstat(const char *file_name, STRUCT_STAT *buf)
+int G_lstat(const char *file_name, struct stat *buf)
 {
 #ifdef __MINGW32__
     return stat(file_name, buf);
@@ -165,7 +165,7 @@
 {
 
 #ifndef __MINGW32__
-    STRUCT_STAT info;
+    struct stat info;
 
     G_stat(path, &info);
 

Modified: grass/trunk/lib/gis/remove.c
===================================================================
--- grass/trunk/lib/gis/remove.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/remove.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -106,7 +106,7 @@
 {
     DIR *dirp;
     struct dirent *dp;
-    STRUCT_STAT sb;
+    struct stat sb;
     char path2[GPATH_MAX];
 
     if (G_lstat(path, &sb))

Modified: grass/trunk/lib/gis/user_config.c
===================================================================
--- grass/trunk/lib/gis/user_config.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/gis/user_config.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -59,7 +59,7 @@
     uid_t me;
     struct passwd *my_passwd;
 #endif
-    STRUCT_STAT buf;
+    struct stat buf;
     char *path;
 
     errno = 0;
@@ -194,7 +194,7 @@
 {
     int i, status;
     char *cp, *path, *top, *ptr;
-    STRUCT_STAT buf;
+    struct stat buf;
 
     /* Get top level path */
     if (NULL == (top = _make_toplevel()))

Modified: grass/trunk/lib/init/clean_temp.c
===================================================================
--- grass/trunk/lib/init/clean_temp.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/init/clean_temp.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -42,7 +42,7 @@
     char buf[BUF_MAX];
     DIR *curdir;
     struct dirent *cur_entry;
-    STRUCT_STAT info;
+    struct stat info;
     int n, pathlen;
 
     curdir = opendir(pathname);

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/vector/Vlib/open.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -894,7 +894,7 @@
 int Vect_coor_info(const struct Map_info *Map, struct Coor_info *Info)
 {
     char *path, file_path[GPATH_MAX];
-    STRUCT_STAT stat_buf;
+    struct stat stat_buf;
     
     switch (Map->format) {
     case GV_FORMAT_NATIVE:

Modified: grass/trunk/lib/vector/dglib/examples/parse.c
===================================================================
--- grass/trunk/lib/vector/dglib/examples/parse.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/vector/dglib/examples/parse.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -117,7 +117,7 @@
 
     unsigned char *pbNodeAttr, *pbEdgeAttr, *pbToNodeAttr;
 
-    STRUCT_STAT statdata;
+    struct stat statdata;
 
     dglGraph_s graphOut;
 

Modified: grass/trunk/lib/vector/diglib/file.c
===================================================================
--- grass/trunk/lib/vector/diglib/file.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/lib/vector/diglib/file.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -189,7 +189,7 @@
     int ret, mode, load;
     const char *cmode;
     size_t size;
-    STRUCT_STAT sbuf;
+    struct stat sbuf;
 
     G_debug(2, "dig_file_load ()");
 

Modified: grass/trunk/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/daemon.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/raster/r.li/r.li.daemon/daemon.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -181,7 +181,7 @@
 
 int parseSetup(char *path, struct list *l, struct g_area *g, char *raster)
 {
-    STRUCT_STAT s;
+    struct stat s;
     struct Cell_head cellhd;
     char *buf;
     const char *token;

Modified: grass/trunk/vector/v.mapcalc/map.c
===================================================================
--- grass/trunk/vector/v.mapcalc/map.c	2013-07-02 13:57:15 UTC (rev 56981)
+++ grass/trunk/vector/v.mapcalc/map.c	2013-07-02 14:37:37 UTC (rev 56982)
@@ -129,7 +129,7 @@
 	return;
 
     while ((ent = readdir(dir)) != NULL) {
-	STRUCT_STAT buf;
+	struct stat buf;
 
 	if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
 	    continue;



More information about the grass-commit mailing list