threads::shared: fix compiler warning
authorDavid Mitchell <davem@iabyn.com>
Fri, 8 Nov 2013 15:13:23 +0000 (15:13 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 8 Nov 2013 15:13:23 +0000 (15:13 +0000)
make the file name stored in the lock on debugging builds
be const char* rather than char*, so that passing __FILE__ doesn't give
lots of

    shared.xs:1287:323: warning: deprecated conversion from string
    constant to 'char *' [-Wwrite-strings]

dist/threads-shared/shared.xs

index d3e859d..0d1f1eb 100644 (file)
@@ -172,7 +172,7 @@ typedef struct {
     I32                 locks;
     perl_cond           cond;
 #ifdef DEBUG_LOCKS
-    char *              file;
+    const char *        file;
     int                 line;
 #endif
 } recursive_lock_t;
@@ -208,7 +208,7 @@ recursive_lock_release(pTHX_ recursive_lock_t *lock)
 }
 
 void
-recursive_lock_acquire(pTHX_ recursive_lock_t *lock, char *file, int line)
+recursive_lock_acquire(pTHX_ recursive_lock_t *lock, const char *file, int line)
 {
     PERL_UNUSED_ARG(file);
     PERL_UNUSED_ARG(line);