changeset 4386:112a509bd2e6

[project @ 2003-04-24 18:41:02 by jwe]
author jwe
date Thu, 24 Apr 2003 18:41:02 +0000
parents de8c1d2ee728
children dd0abcde160c
files liboctave/ChangeLog liboctave/kpse.cc
diffstat 2 files changed, 24 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Thu Apr 24 03:27:41 2003 +0000
+++ b/liboctave/ChangeLog	Thu Apr 24 18:41:02 2003 +0000
@@ -1,3 +1,9 @@
+2003-04-24  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* kpse.cc (xclosedir): Don't define or declare for Windows.
+	(READABLE): Now a static function to avoid warnings from MinGW
+	compiler.	
+
 2003-04-23  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* kpse.cc: Move most functions from kpse-xfns.c here and make
--- a/liboctave/kpse.cc	Thu Apr 24 03:27:41 2003 +0000
+++ b/liboctave/kpse.cc	Thu Apr 24 18:41:02 2003 +0000
@@ -339,7 +339,9 @@
 
 unsigned long xftell (FILE *f, char *filename);
 
+#ifndef WIN32
 static void xclosedir (DIR *d);
+#endif
 
 static void *xmalloc (unsigned size);
 
@@ -2800,6 +2802,7 @@
   return where;
 }
 
+#ifndef WIN32
 void
 xclosedir (DIR *d)
 {
@@ -2812,6 +2815,7 @@
     FATAL ("closedir failed");
 #endif
 }
+#endif
 
 /* xmalloc.c: malloc with error checking.  */
 
@@ -2881,7 +2885,7 @@
 dir_p (const char *fn)
 {
 #ifdef WIN32
-  int fa = GetFileAttributes(fn);
+  unsigned int fa = GetFileAttributes(fn);
   return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
 #else
   struct stat stats;
@@ -3282,12 +3286,20 @@
    kinds of devices.  */
 
 #ifdef WIN32
-#define READABLE(fn, st) \
-  (GetFileAttributes(fn) != 0xFFFFFFFF && \
-   !(GetFileAttributes(fn) & FILE_ATTRIBUTE_DIRECTORY))
+static inline bool
+READABLE (const char *fn, struct stat&)
+{
+  return (GetFileAttributes(fn) != 0xFFFFFFFF
+	  && !(GetFileAttributes(fn) & FILE_ATTRIBUTE_DIRECTORY));
+}
 #else
-#define READABLE(fn, st) \
-  (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode))
+static inline bool
+READABLE (const char *fn, struct stat& st)
+{
+  return (access (fn, R_OK) == 0
+	  && stat (fn, &(st)) == 0
+	  && !S_ISDIR (st.st_mode));
+}
 #endif
 
 /* POSIX invented the brain-damage of not necessarily truncating