diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/DB_File/DB_File.xs | 3 | ||||
-rw-r--r-- | ext/DynaLoader/dl_dlopen.xs | 2 | ||||
-rw-r--r-- | ext/Fcntl/Fcntl.xs | 7 | ||||
-rw-r--r-- | ext/GDBM_File/GDBM_File.xs | 7 | ||||
-rw-r--r-- | ext/IO/IO.xs | 7 | ||||
-rw-r--r-- | ext/Opcode/Opcode.pm | 2 | ||||
-rw-r--r-- | ext/Opcode/Opcode.xs | 32 | ||||
-rw-r--r-- | ext/POSIX/POSIX.xs | 7 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/hash.c | 4 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/pair.c | 45 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/sdbm.c | 66 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/sdbm.h | 9 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/util.c | 7 | ||||
-rw-r--r-- | ext/Socket/Socket.xs | 11 | ||||
-rw-r--r-- | ext/Thread/Thread.xs | 5 | ||||
-rw-r--r-- | ext/attrs/attrs.xs | 7 |
16 files changed, 69 insertions, 152 deletions
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index bd0c933329..959f3425eb 100644 --- a/ext/DB_File/DB_File.xs +++ b/ext/DB_File/DB_File.xs @@ -140,7 +140,6 @@ btree_compare(key1, key2) const DBT * key1 ; const DBT * key2 ; { - dTHR ; dSP ; void * data1, * data2 ; int retval ; @@ -188,7 +187,6 @@ btree_prefix(key1, key2) const DBT * key1 ; const DBT * key2 ; { - dTHR ; dSP ; void * data1, * data2 ; int retval ; @@ -236,7 +234,6 @@ hash_cb(data, size) const void * data ; size_t size ; { - dTHR ; dSP ; int retval ; int count ; diff --git a/ext/DynaLoader/dl_dlopen.xs b/ext/DynaLoader/dl_dlopen.xs index fef4530cfe..2459205653 100644 --- a/ext/DynaLoader/dl_dlopen.xs +++ b/ext/DynaLoader/dl_dlopen.xs @@ -206,7 +206,7 @@ dl_install_xsub(perl_name, symref, filename="$Package") CODE: DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n", perl_name, (unsigned long) symref)); - ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)())symref, filename))); + ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)_((CV *)))symref, filename))); char * diff --git a/ext/Fcntl/Fcntl.xs b/ext/Fcntl/Fcntl.xs index 9034031c9c..251f3f4176 100644 --- a/ext/Fcntl/Fcntl.xs +++ b/ext/Fcntl/Fcntl.xs @@ -23,17 +23,14 @@ */ static int -not_here(s) -char *s; +not_here(char *s) { croak("%s not implemented on this architecture", s); return -1; } static double -constant(name, arg) -char *name; -int arg; +constant(char *name, int arg) { errno = 0; switch (*name) { diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index a423c88c70..ac1ca8c68d 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -23,8 +23,7 @@ typedef datum gdatum; typedef void (*FATALFUNC)(); static int -not_here(s) -char *s; +not_here(char *s) { croak("GDBM_File::%s not implemented on this architecture", s); return -1; @@ -41,9 +40,7 @@ char *s; #endif static double -constant(name, arg) -char *name; -int arg; +constant(char *name, int arg) { errno = 0; switch (*name) { diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index e558d5c4e0..f226a79a9f 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -22,17 +22,14 @@ typedef FILE * OutputStream; #endif static int -not_here(s) -char *s; +not_here(char *s) { croak("%s not implemented on this architecture", s); return -1; } static bool -constant(name, pval) -char *name; -IV *pval; +constant(char *name, IV *pval) { switch (*name) { case '_': diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index c7d7ce3f96..b71e8b43cf 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -431,7 +431,7 @@ beyond the scope of the compartment. These ops are related to multi-threading. - lock specific + lock threadsv =item :default diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs index 8307ade2ca..bed7099900 100644 --- a/ext/Opcode/Opcode.xs +++ b/ext/Opcode/Opcode.xs @@ -24,7 +24,7 @@ static SV *get_op_bitspec _((char *opname, STRLEN len, int fatal)); */ static void -op_names_init() +op_names_init(void) { int i; STRLEN len; @@ -58,10 +58,7 @@ op_names_init() */ static void -put_op_bitspec(optag, len, mask) - char *optag; - STRLEN len; - SV *mask; +put_op_bitspec(char *optag, STRLEN len, SV *mask) { SV **svp; verify_opset(mask,1); @@ -82,10 +79,7 @@ put_op_bitspec(optag, len, mask) */ static SV * -get_op_bitspec(opname, len, fatal) - char *opname; - STRLEN len; - int fatal; +get_op_bitspec(char *opname, STRLEN len, int fatal) { SV **svp; if (!len) @@ -108,8 +102,7 @@ get_op_bitspec(opname, len, fatal) static SV * -new_opset(old_opset) - SV *old_opset; +new_opset(SV *old_opset) { SV *opset; if (old_opset) { @@ -128,9 +121,7 @@ new_opset(old_opset) static int -verify_opset(opset, fatal) - SV *opset; - int fatal; +verify_opset(SV *opset, int fatal) { char *err = Nullch; if (!SvOK(opset)) err = "undefined"; @@ -144,11 +135,7 @@ verify_opset(opset, fatal) static void -set_opset_bits(bitmap, bitspec, on, opname) - char *bitmap; - SV *bitspec; - int on; - char *opname; +set_opset_bits(char *bitmap, SV *bitspec, int on, char *opname) { if (SvIOK(bitspec)) { int myopcode = SvIV(bitspec); @@ -182,8 +169,7 @@ set_opset_bits(bitmap, bitspec, on, opname) static void -opmask_add(opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */ - SV *opset; +opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */ { int i,j; char *bitmask; @@ -210,9 +196,7 @@ opmask_add(opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */ } static void -opmask_addlocal(opset, op_mask_buf) /* Localise op_mask then opmask_add() */ - SV *opset; - char *op_mask_buf; +opmask_addlocal(SV *opset, char *op_mask_buf) /* Localise op_mask then opmask_add() */ { char *orig_op_mask = op_mask; SAVEPPTR(op_mask); diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 0e53a49183..57efb83a42 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -275,17 +275,14 @@ init_tm(ptm) /* see mktime, strftime and asctime */ #endif static int -not_here(s) -char *s; +not_here(char *s) { croak("POSIX::%s not implemented on this architecture", s); return -1; } static double -constant(name, arg) -char *name; -int arg; +constant(char *name, int arg) { errno = 0; switch (*name) { diff --git a/ext/SDBM_File/sdbm/hash.c b/ext/SDBM_File/sdbm/hash.c index eb585ac102..514bb5ed1a 100644 --- a/ext/SDBM_File/sdbm/hash.c +++ b/ext/SDBM_File/sdbm/hash.c @@ -17,9 +17,7 @@ * 65587 even better. */ long -sdbm_hash(str, len) -register char *str; -register int len; +sdbm_hash(register 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 23bbfe9a67..e1a6ee6f43 100644 --- a/ext/SDBM_File/sdbm/pair.c +++ b/ext/SDBM_File/sdbm/pair.c @@ -44,9 +44,7 @@ static int seepair proto((char *, int, char *, int)); */ int -fitpair(pag, need) -char *pag; -int need; +fitpair(char *pag, int need) { register int n; register int off; @@ -63,10 +61,7 @@ int need; } void -putpair(pag, key, val) -char *pag; -datum key; -datum val; +putpair(char *pag, datum key, datum val) { register int n; register int off; @@ -92,9 +87,7 @@ datum val; } datum -getpair(pag, key) -char *pag; -datum key; +getpair(char *pag, datum key) { register int i; register int n; @@ -114,9 +107,7 @@ datum key; #ifdef SEEDUPS int -duppair(pag, key) -char *pag; -datum key; +duppair(char *pag, datum key) { register short *ino = (short *) pag; return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; @@ -124,9 +115,7 @@ datum key; #endif datum -getnkey(pag, num) -char *pag; -int num; +getnkey(char *pag, int num) { datum key; register int off; @@ -145,9 +134,7 @@ int num; } int -delpair(pag, key) -char *pag; -datum key; +delpair(char *pag, datum key) { register int n; register int i; @@ -219,11 +206,7 @@ datum key; * return 0 if not found. */ static int -seepair(pag, n, key, siz) -char *pag; -register int n; -register char *key; -register int siz; +seepair(char *pag, register int n, register char *key, register int siz) { register int i; register int off = PBLKSIZ; @@ -239,10 +222,7 @@ register int siz; } void -splpage(pag, new, sbit) -char *pag; -char *new; -long sbit; +splpage(char *pag, char *New, long int sbit) { datum key; datum val; @@ -254,7 +234,7 @@ long sbit; (void) memcpy(cur, pag, PBLKSIZ); (void) memset(pag, 0, PBLKSIZ); - (void) memset(new, 0, PBLKSIZ); + (void) memset(New, 0, PBLKSIZ); n = ino[0]; for (ino++; n > 0; ino += 2) { @@ -265,14 +245,14 @@ long sbit; /* * select the page pointer (by looking at sbit) and insert */ - (void) putpair((exhash(key) & sbit) ? new : pag, key, val); + (void) putpair((exhash(key) & sbit) ? New : pag, key, val); off = ino[1]; n -= 2; } debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, - ((short *) new)[0] / 2, + ((short *) New)[0] / 2, ((short *) pag)[0] / 2)); } @@ -283,8 +263,7 @@ long sbit; * this could be made more rigorous. */ int -chkpage(pag) -char *pag; +chkpage(char *pag) { register int n; register int off; diff --git a/ext/SDBM_File/sdbm/sdbm.c b/ext/SDBM_File/sdbm/sdbm.c index c2d9cbd47d..7fbba0f00a 100644 --- a/ext/SDBM_File/sdbm/sdbm.c +++ b/ext/SDBM_File/sdbm/sdbm.c @@ -39,7 +39,7 @@ extern int errno; extern Malloc_t malloc proto((MEM_SIZE)); extern Free_t free proto((Malloc_t)); -extern Off_t lseek(); +extern Off_t lseek(int, off_t, int); #endif /* @@ -75,10 +75,7 @@ static long masks[] = { datum nullitem = {NULL, 0}; DBM * -sdbm_open(file, flags, mode) -register char *file; -register int flags; -register int mode; +sdbm_open(register char *file, register int flags, register int mode) { register DBM *db; register char *dirname; @@ -92,7 +89,7 @@ register int mode; */ n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; - if ((dirname = malloc((unsigned) n)) == NULL) + if ((dirname = (char *) malloc((unsigned) n)) == NULL) return errno = ENOMEM, (DBM *) NULL; /* * build the file names @@ -107,11 +104,7 @@ register int mode; } DBM * -sdbm_prep(dirname, pagname, flags, mode) -char *dirname; -char *pagname; -int flags; -int mode; +sdbm_prep(char *dirname, char *pagname, int flags, int mode) { register DBM *db; struct stat dstat; @@ -170,8 +163,7 @@ int mode; } void -sdbm_close(db) -register DBM *db; +sdbm_close(register DBM *db) { if (db == NULL) errno = EINVAL; @@ -183,9 +175,7 @@ register DBM *db; } datum -sdbm_fetch(db, key) -register DBM *db; -datum key; +sdbm_fetch(register DBM *db, datum key) { if (db == NULL || bad(key)) return errno = EINVAL, nullitem; @@ -197,9 +187,7 @@ datum key; } int -sdbm_delete(db, key) -register DBM *db; -datum key; +sdbm_delete(register DBM *db, datum key) { if (db == NULL || bad(key)) return errno = EINVAL, -1; @@ -223,11 +211,7 @@ datum key; } int -sdbm_store(db, key, val, flags) -register DBM *db; -datum key; -datum val; -int flags; +sdbm_store(register DBM *db, datum key, datum val, int flags) { int need; register long hash; @@ -285,22 +269,19 @@ int flags; * giving up. */ static int -makroom(db, hash, need) -register DBM *db; -long hash; -int need; +makroom(register DBM *db, long int hash, int need) { long newp; char twin[PBLKSIZ]; char *pag = db->pagbuf; - char *new = twin; + char *New = twin; register int smax = SPLTMAX; do { /* * split the current page */ - (void) splpage(pag, new, db->hmask + 1); + (void) splpage(pag, New, db->hmask + 1); /* * address of the new page */ @@ -319,10 +300,10 @@ int need; || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) return 0; db->pagbno = newp; - (void) memcpy(pag, new, PBLKSIZ); + (void) memcpy(pag, New, PBLKSIZ); } else if (lseek(db->pagf, OFF_PAG(newp), SEEK_SET) < 0 - || write(db->pagf, new, PBLKSIZ) < 0) + || write(db->pagf, New, PBLKSIZ) < 0) return 0; if (!setdbit(db, db->curbit)) @@ -363,8 +344,7 @@ int need; * deletions aren't taken into account. (ndbm bug) */ datum -sdbm_firstkey(db) -register DBM *db; +sdbm_firstkey(register DBM *db) { if (db == NULL) return errno = EINVAL, nullitem; @@ -382,8 +362,7 @@ register DBM *db; } datum -sdbm_nextkey(db) -register DBM *db; +sdbm_nextkey(register DBM *db) { if (db == NULL) return errno = EINVAL, nullitem; @@ -394,9 +373,7 @@ register DBM *db; * all important binary trie traversal */ static int -getpage(db, hash) -register DBM *db; -register long hash; +getpage(register DBM *db, register long int hash) { register int hbit; register long dbit; @@ -435,9 +412,7 @@ register long hash; } static int -getdbit(db, dbit) -register DBM *db; -register long dbit; +getdbit(register DBM *db, register long int dbit) { register long c; register long dirb; @@ -458,9 +433,7 @@ register long dbit; } static int -setdbit(db, dbit) -register DBM *db; -register long dbit; +setdbit(register DBM *db, register long int dbit) { register long c; register long dirb; @@ -494,8 +467,7 @@ register long dbit; * the page, try the next page in sequence */ static datum -getnext(db) -register DBM *db; +getnext(register DBM *db) { datum key; diff --git a/ext/SDBM_File/sdbm/sdbm.h b/ext/SDBM_File/sdbm/sdbm.h index fdd9165145..5bc629f402 100644 --- a/ext/SDBM_File/sdbm/sdbm.h +++ b/ext/SDBM_File/sdbm/sdbm.h @@ -49,7 +49,7 @@ typedef struct { extern datum nullitem; -#ifdef __STDC__ +#if defined(__STDC__) || defined(__cplusplus) #define proto(p) p #else #define proto(p) () @@ -183,6 +183,10 @@ extern long sdbm_hash proto((char *, int)); #ifdef I_MEMORY #include <memory.h> +#endif + +#ifdef __cplusplus +#define HAS_MEMCPY #endif #ifdef HAS_MEMCPY @@ -239,7 +243,9 @@ extern long sdbm_hash proto((char *, int)); # else # define memcmp Perl_my_memcmp # endif +#ifndef __cplusplus extern int memcmp proto((char*, char*, int)); +#endif # endif #endif /* HAS_MEMCMP */ @@ -262,3 +268,4 @@ extern long sdbm_hash proto((char *, int)); #endif #endif /* Include guard */ + diff --git a/ext/SDBM_File/sdbm/util.c b/ext/SDBM_File/sdbm/util.c index 4b03d89f09..16bd4ac9a5 100644 --- a/ext/SDBM_File/sdbm/util.c +++ b/ext/SDBM_File/sdbm/util.c @@ -6,9 +6,7 @@ #endif void -oops(s1, s2) -register char *s1; -register char *s2; +oops(register char *s1, register char *s2) { extern int errno, sys_nerr; extern char *sys_errlist[]; @@ -24,8 +22,7 @@ register char *s2; } int -okpage(pag) -char *pag; +okpage(char *pag) { register unsigned n; register off; diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index e3b282b0ad..d37208f012 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -47,9 +47,7 @@ * cannot distinguish between failure and a local broadcast address. */ static int -my_inet_aton(cp, addr) -register const char *cp; -struct in_addr *addr; +my_inet_aton(register const char *cp, struct in_addr *addr) { register U32 val; register int base; @@ -145,17 +143,14 @@ struct in_addr *addr; static int -not_here(s) -char *s; +not_here(char *s) { croak("Socket::%s not implemented on this architecture", s); return -1; } static double -constant(name, arg) -char *name; -int arg; +constant(char *name, int arg) { errno = 0; switch (*name) { diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index 7bbe0889e7..841b5698a1 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -82,7 +82,7 @@ threadstart(void *arg) #else Thread thr = (Thread) arg; LOGOP myop; - dSP; + djSP; I32 oldmark = TOPMARK; I32 oldscope = scopestack_ix; I32 retval; @@ -163,6 +163,8 @@ threadstart(void *arg) SvREFCNT_dec(thr->cvcache); SvREFCNT_dec(thr->magicals); SvREFCNT_dec(thr->specific); + SvREFCNT_dec(thr->errsv); + SvREFCNT_dec(thr->errhv); Safefree(markstack); Safefree(scopestack); Safefree(savestack); @@ -214,7 +216,6 @@ threadstart(void *arg) static SV * newthread (SV *startsv, AV *initargs, char *Class) { - dTHR; #ifdef USE_THREADS dSP; Thread savethread; diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs index f34ac850ea..dae612adaf 100644 --- a/ext/attrs/attrs.xs +++ b/ext/attrs/attrs.xs @@ -3,8 +3,7 @@ #include "XSUB.h" static cv_flags_t -get_flag(attr) -char *attr; +get_flag(char *attr) { if (strnEQ(attr, "method", 6)) return CVf_METHOD; @@ -17,8 +16,8 @@ char *attr; MODULE = attrs PACKAGE = attrs void -import(class, ...) -char * class +import(Class, ...) +char * Class ALIAS: unimport = 1 PREINIT: |