This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Cwd's THX_unix_canonpath add two casts from (void*) to keep C++ sweet.
authorNicholas Clark <nick@ccl4.org>
Wed, 12 Jun 2013 17:48:37 +0000 (19:48 +0200)
committerZefram <zefram@fysh.org>
Sat, 17 Aug 2013 15:47:37 +0000 (16:47 +0100)
The new XS implementation of various File::Spec methods needs a couple of
casts to compile with a C++ compiler.

dist/Cwd/Cwd.xs

index a18afd1..dc3da18 100644 (file)
@@ -457,7 +457,7 @@ THX_unix_canonpath(pTHX_ SV *path)
 #endif
     o = SvPVX(retval);
     if(DOUBLE_SLASHES_SPECIAL && p[0] == '/' && p[1] == '/' && p[2] != '/') {
-       q = memchr(p+2, '/', pe-(p+2));
+       q = (const char *) memchr(p+2, '/', pe-(p+2));
        if(!q) q = pe;
        l = q - p;
        memcpy(o, p, l);
@@ -493,7 +493,7 @@ THX_unix_canonpath(pTHX_ SV *path)
     }
     if(p == pe) goto end;
     while(1) {
-       q = memchr(p, '/', pe-p);
+       q = (const char *) memchr(p, '/', pe-p);
        if(!q) q = pe;
        l = q - p;
        memcpy(o, p, l);