summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2007-12-22 00:39:47 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-22 16:17:01 +0000
commitd3f5e39945c1adca90422be3853d860ba9478c11 (patch)
tree3c862227ab85f5337dad461b490e91a47018452d /ext
parent3376de987afecc3e3aea14b3dea087f4b50fd3f4 (diff)
downloadperl-d3f5e39945c1adca90422be3853d860ba9478c11.tar.gz
ext/ consting
From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399D@exchsvr2.npl.ad.local> Date: Sat, 22 Dec 2007 00:39:47 -0000 p4raw-id: //depot/perl@32703
Diffstat (limited to 'ext')
-rw-r--r--ext/Devel/Peek/Peek.xs2
-rw-r--r--ext/DynaLoader/dl_aix.xs2
-rw-r--r--ext/DynaLoader/dl_beos.xs2
-rw-r--r--ext/DynaLoader/dl_dld.xs2
-rw-r--r--ext/DynaLoader/dl_dllload.xs2
-rw-r--r--ext/DynaLoader/dl_dlopen.xs2
-rw-r--r--ext/DynaLoader/dl_dyld.xs2
-rw-r--r--ext/DynaLoader/dl_hpux.xs2
-rw-r--r--ext/DynaLoader/dl_mac.xs2
-rw-r--r--ext/DynaLoader/dl_mpeix.xs2
-rw-r--r--ext/DynaLoader/dl_next.xs2
-rw-r--r--ext/DynaLoader/dl_symbian.xs2
-rw-r--r--ext/DynaLoader/dl_vmesa.xs2
-rw-r--r--ext/DynaLoader/dl_vms.xs2
-rw-r--r--ext/GDBM_File/typemap3
-rw-r--r--ext/IPC/SysV/SysV.xs4
-rw-r--r--ext/POSIX/POSIX.xs4
-rw-r--r--ext/PerlIO/via/via.xs4
-rw-r--r--ext/SDBM_File/sdbm/hash.c2
-rw-r--r--ext/SDBM_File/sdbm/pair.c4
-rw-r--r--ext/SDBM_File/sdbm/sdbm.h4
-rw-r--r--ext/Socket/Socket.xs2
-rw-r--r--ext/re/re.xs2
23 files changed, 29 insertions, 28 deletions
diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs
index f07c2e5b5f..cf47c3cddd 100644
--- a/ext/Devel/Peek/Peek.xs
+++ b/ext/Devel/Peek/Peek.xs
@@ -321,7 +321,7 @@ MODULE = Devel::Peek PACKAGE = Devel::Peek
void
mstat(str="Devel::Peek::mstat: ")
-char *str
+const char *str
void
fill_mstats(SV *sv, int level = 0)
diff --git a/ext/DynaLoader/dl_aix.xs b/ext/DynaLoader/dl_aix.xs
index 8529097469..c91a2fce2a 100644
--- a/ext/DynaLoader/dl_aix.xs
+++ b/ext/DynaLoader/dl_aix.xs
@@ -744,7 +744,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_beos.xs b/ext/DynaLoader/dl_beos.xs
index ae40269338..3453d6801b 100644
--- a/ext/DynaLoader/dl_beos.xs
+++ b/ext/DynaLoader/dl_beos.xs
@@ -98,7 +98,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
diff --git a/ext/DynaLoader/dl_dld.xs b/ext/DynaLoader/dl_dld.xs
index 127c0d1455..ab72ca3c6c 100644
--- a/ext/DynaLoader/dl_dld.xs
+++ b/ext/DynaLoader/dl_dld.xs
@@ -169,7 +169,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_dllload.xs b/ext/DynaLoader/dl_dllload.xs
index c5ce35a224..61611d7b6d 100644
--- a/ext/DynaLoader/dl_dllload.xs
+++ b/ext/DynaLoader/dl_dllload.xs
@@ -170,7 +170,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
diff --git a/ext/DynaLoader/dl_dlopen.xs b/ext/DynaLoader/dl_dlopen.xs
index 83f5aed074..3332758b63 100644
--- a/ext/DynaLoader/dl_dlopen.xs
+++ b/ext/DynaLoader/dl_dlopen.xs
@@ -246,7 +246,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%"UVxf")\n",
perl_name, PTR2UV(symref)));
diff --git a/ext/DynaLoader/dl_dyld.xs b/ext/DynaLoader/dl_dyld.xs
index eac0408d5f..c8f999bea5 100644
--- a/ext/DynaLoader/dl_dyld.xs
+++ b/ext/DynaLoader/dl_dyld.xs
@@ -201,7 +201,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_hpux.xs b/ext/DynaLoader/dl_hpux.xs
index 0c751dd2b7..f85dea1eb9 100644
--- a/ext/DynaLoader/dl_hpux.xs
+++ b/ext/DynaLoader/dl_hpux.xs
@@ -160,7 +160,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_mac.xs b/ext/DynaLoader/dl_mac.xs
index 826caf204d..474cd99eac 100644
--- a/ext/DynaLoader/dl_mac.xs
+++ b/ext/DynaLoader/dl_mac.xs
@@ -126,7 +126,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_mpeix.xs b/ext/DynaLoader/dl_mpeix.xs
index 4b339c5bb9..a73e22a00f 100644
--- a/ext/DynaLoader/dl_mpeix.xs
+++ b/ext/DynaLoader/dl_mpeix.xs
@@ -111,7 +111,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_next.xs b/ext/DynaLoader/dl_next.xs
index e61c800802..a7742a1fe3 100644
--- a/ext/DynaLoader/dl_next.xs
+++ b/ext/DynaLoader/dl_next.xs
@@ -301,7 +301,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/DynaLoader/dl_symbian.xs b/ext/DynaLoader/dl_symbian.xs
index b2f27321e6..f7ddc09e4a 100644
--- a/ext/DynaLoader/dl_symbian.xs
+++ b/ext/DynaLoader/dl_symbian.xs
@@ -205,7 +205,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
ST(0) = sv_2mortal(newRV((SV*)newXS_flags(perl_name,
(void(*)(pTHX_ CV *))symref,
diff --git a/ext/DynaLoader/dl_vmesa.xs b/ext/DynaLoader/dl_vmesa.xs
index 8b0d756349..606c89e4e5 100644
--- a/ext/DynaLoader/dl_vmesa.xs
+++ b/ext/DynaLoader/dl_vmesa.xs
@@ -156,7 +156,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
diff --git a/ext/DynaLoader/dl_vms.xs b/ext/DynaLoader/dl_vms.xs
index e476663bdb..3ae76b800e 100644
--- a/ext/DynaLoader/dl_vms.xs
+++ b/ext/DynaLoader/dl_vms.xs
@@ -367,7 +367,7 @@ void
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
diff --git a/ext/GDBM_File/typemap b/ext/GDBM_File/typemap
index 8c7cb45b46..3e69721569 100644
--- a/ext/GDBM_File/typemap
+++ b/ext/GDBM_File/typemap
@@ -37,7 +37,8 @@ T_DATUM_V
$var.dsize = (int)PL_na;
}
else {
- $var.dptr = \"\";
+ $var.dptr = (char *)\"\";
+ /* better would be for .dptr to be const char * */
$var.dsize = 0;
}
OUTPUT
diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs
index deaa8e85bc..b5137cf0a7 100644
--- a/ext/IPC/SysV/SysV.xs
+++ b/ext/IPC/SysV/SysV.xs
@@ -222,7 +222,7 @@ BOOT:
/*
* constant subs for IPC::SysV
*/
- struct { char *n; I32 v; } IPC__SysV__const[] = {
+ struct { const char *n; I32 v; } IPC__SysV__const[] = {
#ifdef GETVAL
{"GETVAL", GETVAL},
#endif
@@ -434,7 +434,7 @@ BOOT:
{"S_IRWXO", S_IRWXO},
#endif
{Nullch,0}};
- char *name;
+ const char *name;
int i;
for(i = 0 ; (name = IPC__SysV__const[i].n) ; i++) {
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 9ddfd3ae48..867d35bfe1 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -582,7 +582,7 @@ MODULE = SigSet PACKAGE = POSIX::SigSet PREFIX = sig
POSIX::SigSet
new(packname = "POSIX::SigSet", ...)
- char * packname
+ const char * packname
CODE:
{
int i;
@@ -627,7 +627,7 @@ MODULE = Termios PACKAGE = POSIX::Termios PREFIX = cf
POSIX::Termios
new(packname = "POSIX::Termios", ...)
- char * packname
+ const char * packname
CODE:
{
#ifdef I_TERMIOS
diff --git a/ext/PerlIO/via/via.xs b/ext/PerlIO/via/via.xs
index 5670887e18..b17108ce7e 100644
--- a/ext/PerlIO/via/via.xs
+++ b/ext/PerlIO/via/via.xs
@@ -41,7 +41,7 @@ typedef struct
#define MYMethod(x) #x,&s->x
CV *
-PerlIOVia_fetchmethod(pTHX_ PerlIOVia * s, char *method, CV ** save)
+PerlIOVia_fetchmethod(pTHX_ PerlIOVia * s, const char *method, CV ** save)
{
GV *gv = gv_fetchmeth(s->stash, method, strlen(method), 0);
#if 0
@@ -64,7 +64,7 @@ PerlIOVia_fetchmethod(pTHX_ PerlIOVia * s, char *method, CV ** save)
*/
SV *
-PerlIOVia_method(pTHX_ PerlIO * f, char *method, CV ** save, int flags,
+PerlIOVia_method(pTHX_ PerlIO * f, const char *method, CV ** save, int flags,
...)
{
PerlIOVia *s = PerlIOSelf(f, PerlIOVia);
diff --git a/ext/SDBM_File/sdbm/hash.c b/ext/SDBM_File/sdbm/hash.c
index 9b27648599..7dd1c99e35 100644
--- a/ext/SDBM_File/sdbm/hash.c
+++ b/ext/SDBM_File/sdbm/hash.c
@@ -18,7 +18,7 @@
* 65587 even better.
*/
long
-sdbm_hash(register char *str, register int len)
+sdbm_hash(register const char *str, register int len)
{
register unsigned long n = 0;
diff --git a/ext/SDBM_File/sdbm/pair.c b/ext/SDBM_File/sdbm/pair.c
index 4f0fde2302..42b130db19 100644
--- a/ext/SDBM_File/sdbm/pair.c
+++ b/ext/SDBM_File/sdbm/pair.c
@@ -22,7 +22,7 @@
/*
* forward
*/
-static int seepair proto((char *, int, char *, int));
+static int seepair proto((char *, int, const char *, int));
/*
* page format:
@@ -218,7 +218,7 @@ delpair(char *pag, datum key)
* return 0 if not found.
*/
static int
-seepair(char *pag, register int n, register char *key, register int siz)
+seepair(char *pag, register int n, register const char *key, register int siz)
{
register int i;
register int off = PBLKSIZ;
diff --git a/ext/SDBM_File/sdbm/sdbm.h b/ext/SDBM_File/sdbm/sdbm.h
index 88e4b66b39..53fc366801 100644
--- a/ext/SDBM_File/sdbm/sdbm.h
+++ b/ext/SDBM_File/sdbm/sdbm.h
@@ -47,7 +47,7 @@ typedef struct {
#define sdbm_pagfno(db) ((db)->pagf)
typedef struct {
- char *dptr;
+ const char *dptr;
int dsize;
} datum;
@@ -85,7 +85,7 @@ extern int sdbm_exists proto((DBM *, datum));
* other
*/
extern DBM *sdbm_prep proto((char *, char *, int, int));
-extern long sdbm_hash proto((char *, int));
+extern long sdbm_hash proto((const char *, int));
#ifndef SDBM_ONLY
#define dbm_open sdbm_open
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index f86c5aefa6..076297f25d 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -182,7 +182,7 @@ my_inet_aton(register const char *cp, struct in_addr *addr)
static int
-not_here(char *s)
+not_here(const char *s)
{
croak("Socket::%s not implemented on this architecture", s);
return -1;
diff --git a/ext/re/re.xs b/ext/re/re.xs
index b4d3e34c4a..d1001c4e57 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -105,7 +105,7 @@ PPCODE:
modifiers" in this scenario.
*/
- char *fptr = INT_PAT_MODS;
+ const char *fptr = INT_PAT_MODS;
char ch;
U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME) >> 12);