harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r829967 - in /harmony/enhanced/classlib/trunk/modules: luni/src/main/native/luni/shared/file.c portlib/src/main/native/common/shared/iohelp.c portlib/src/main/native/include/shared/iohelp.h
Date Mon, 26 Oct 2009 21:13:36 GMT
Author: hindessm
Date: Mon Oct 26 21:13:32 2009
New Revision: 829967

URL: http://svn.apache.org/viewvc?rev=829967&view=rev
Log:
Replace jclSeparator with more consistent define.
Use preprocessor support to remove code that isn't required at build time
rather than compiling it and skipping it at run time.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/common/shared/iohelp.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/iohelp.h

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c?rev=829967&r1=829966&r2=829967&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c Mon Oct
26 21:13:32 2009
@@ -94,7 +94,7 @@
   if (length >= 1 && pathCopy[length - 1] != '\\'
       && pathCopy[length - 1] != '/')
     {
-      pathCopy[length] = jclSeparator;
+      pathCopy[length] = DIR_SEPARATOR;
       length++;
     }
   pathCopy[length] = '\0';

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/common/shared/iohelp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/common/shared/iohelp.c?rev=829967&r1=829966&r2=829967&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/common/shared/iohelp.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/common/shared/iohelp.c
Mon Oct 26 21:13:32 2009
@@ -34,18 +34,16 @@
   while (*pathIndex != '\0')
     {
       if ((*pathIndex == '\\' || *pathIndex == '/')
-          && (*pathIndex != jclSeparator))
-        *pathIndex = jclSeparator;
+          && (*pathIndex != DIR_SEPARATOR))
+        *pathIndex = DIR_SEPARATOR;
       pathIndex++;
     }
 
-  /* Remove duplicate separators */
-  if (jclSeparator == '/')
-    return;                     /* Do not do POSIX platforms */
+#if !(DIR_SEPARATOR == '/')
 
   /* Remove duplicate initial separators */
   pathIndex = path;
-  while ((*pathIndex != '\0') && (*pathIndex == jclSeparator))
+  while ((*pathIndex != '\0') && (*pathIndex == DIR_SEPARATOR))
     {
       pathIndex++;
     }
@@ -68,5 +66,6 @@
         }
     }
   /* This will have to handle extra \'s but currently doesn't */
+#endif
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/iohelp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/iohelp.h?rev=829967&r1=829966&r2=829967&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/iohelp.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/iohelp.h
Mon Oct 26 21:13:32 2009
@@ -21,8 +21,6 @@
 #include "vmi.h"
 #include "exceptions.h"
 
-/* DIR_SEPARATOR is defined in hycomp.h */
-#define jclSeparator DIR_SEPARATOR
 void ioh_convertToPlatform (char *path);
 
 #endif /* iohelp_h */



Mime
View raw message