diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2001-04-04 18:38:52 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2001-04-04 18:38:52 +0000 |
commit | 17b5f5f59178adf6dfacaf3e283ba1f784f8924d (patch) | |
tree | 5bef6d33706b3ddbd563f3a0692dae5e175af751 | |
parent | 405f61b82790e3c0b3cb02962f34aa8522c5a18e (diff) | |
download | perl-17b5f5f59178adf6dfacaf3e283ba1f784f8924d.tar.gz |
integrate change#8837 from mainline
Subject: [patch] -Wall cleanup round 2
p4raw-link: @8837 on //depot/perl: 8063af025e8b11a3a92c708534a72a8c4fe60322
p4raw-id: //depot/maint-5.6/perl@9545
p4raw-integrated: from //depot/perl@9544 'copy in'
ext/SDBM_File/SDBM_File.xs (@5091..) ext/IPC/SysV/SysV.xs
(@7614..) ext/Devel/Peek/Peek.xs (@7629..)
ext/Devel/DProf/DProf.xs (@8724..) 'merge in'
ext/Fcntl/Fcntl.xs (@8148..) ext/Opcode/Opcode.xs (@8524..)
p4raw-integrated: from //depot/perl@8837 'copy in'
ext/Data/Dumper/Dumper.xs (@6495..) 'merge in'
ext/File/Glob/Glob.xs (@5590..) ext/IO/IO.xs (@8029..)
ext/GDBM_File/GDBM_File.xs (@8364..) ext/B/B.xs (@8448..)
ext/POSIX/POSIX.xs (@8670..)
-rw-r--r-- | ext/B/B.xs | 14 | ||||
-rw-r--r-- | ext/Data/Dumper/Dumper.xs | 2 | ||||
-rw-r--r-- | ext/Devel/DProf/DProf.xs | 7 | ||||
-rw-r--r-- | ext/Devel/Peek/Peek.xs | 4 | ||||
-rw-r--r-- | ext/Fcntl/Fcntl.xs | 7 | ||||
-rw-r--r-- | ext/File/Glob/Glob.xs | 9 | ||||
-rw-r--r-- | ext/GDBM_File/GDBM_File.xs | 4 | ||||
-rw-r--r-- | ext/IO/IO.xs | 4 | ||||
-rw-r--r-- | ext/IPC/SysV/SysV.xs | 6 | ||||
-rw-r--r-- | ext/Opcode/Opcode.xs | 2 | ||||
-rw-r--r-- | ext/POSIX/POSIX.xs | 13 | ||||
-rw-r--r-- | ext/SDBM_File/SDBM_File.xs | 2 |
12 files changed, 30 insertions, 44 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index e188024f30..d2c2264e87 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -582,11 +582,12 @@ char * OP_name(o) B::OP o CODE: - ST(0) = sv_newmortal(); - sv_setpv(ST(0), PL_op_name[o->op_type]); + RETVAL = PL_op_name[o->op_type]; + OUTPUT: + RETVAL -char * +void OP_ppaddr(o) B::OP o PREINIT: @@ -656,11 +657,12 @@ LISTOP_children(o) OP * kid = NO_INIT int i = NO_INIT CODE: - ST(0) = sv_newmortal(); i = 0; for (kid = o->op_first; kid; kid = kid->op_sibling) i++; - sv_setiv(ST(0), i); + RETVAL = i; + OUTPUT: + RETVAL #define PMOP_pmreplroot(o) o->op_pmreplroot #define PMOP_pmreplstart(o) o->op_pmreplstart @@ -1272,7 +1274,7 @@ HvARRAY(hv) I32 len; (void)hv_iterinit(hv); EXTEND(sp, HvKEYS(hv) * 2); - while (sv = hv_iternextsv(hv, &key, &len)) { + while ((sv = hv_iternextsv(hv, &key, &len))) { PUSHs(newSVpvn(key, len)); PUSHs(make_sv_object(aTHX_ sv_newmortal(), sv)); } diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index d3cf292e9e..25e72b144c 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -805,7 +805,7 @@ Data_Dumper_Dumpxs(href, ...) if ((svp = av_fetch(namesav, i, TRUE))) sv_setsv(name, *svp); else - SvOK_off(name); + (void)SvOK_off(name); if (SvOK(name)) { if ((SvPVX(name))[0] == '*') { diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs index e75e732486..aba6de99d3 100644 --- a/ext/Devel/DProf/DProf.xs +++ b/ext/Devel/DProf/DProf.xs @@ -276,10 +276,6 @@ prof_mark(pTHX_ opcode ptype) { struct tms t; clock_t realtime, rdelta, udelta, sdelta; - char *name, *pv; - char *hvname; - STRLEN len; - SV *sv; U32 id; SV *Sub = GvSV(PL_DBsub); /* name of current sub */ @@ -472,8 +468,6 @@ prof_record(pTHX) /* Now that we know the runtimes, fill them in at the recorded location -JH */ - clock_t r, u, s; - if (g_SAVE_STACK) { prof_dump_until(aTHX_ g_profstack_ix); } @@ -542,6 +536,7 @@ XS(XS_DB_sub) prof_mark(aTHX_ OP_ENTERSUB); PUSHMARK(ORIGMARK); perl_call_sv(INT2PTR(SV*,SvIV(Sub)), GIMME | G_NODEBUG); + PL_curstash = oldstash; prof_mark(aTHX_ OP_LEAVESUB); g_depth--; } diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs index 312f5f84ba..1e481492b5 100644 --- a/ext/Devel/Peek/Peek.xs +++ b/ext/Devel/Peek/Peek.xs @@ -82,8 +82,6 @@ DeadCode(pTHX) } } else if (SvTYPE(pad[j]) >= SVt_PV && SvLEN(pad[j])) { - int db_len = SvLEN(pad[j]); - SV *db_sv = pad[j]; levels++; levelm += SvLEN(pad[j])/SvREFCNT(pad[j]); /* Dump(pad[j],4); */ @@ -383,7 +381,7 @@ PPCODE: # PPCODE needed since by default it is void -SV * +void SvREFCNT_dec(sv) SV * sv PPCODE: diff --git a/ext/Fcntl/Fcntl.xs b/ext/Fcntl/Fcntl.xs index b597e03c1a..51851bb674 100644 --- a/ext/Fcntl/Fcntl.xs +++ b/ext/Fcntl/Fcntl.xs @@ -33,13 +33,6 @@ --AD October 16, 1995 */ -static int -not_here(char *s) -{ - croak("%s not implemented on this architecture", s); - return -1; -} - static double constant(char *name, int arg) { diff --git a/ext/File/Glob/Glob.xs b/ext/File/Glob/Glob.xs index e96d8033ff..ee8c0c9751 100644 --- a/ext/File/Glob/Glob.xs +++ b/ext/File/Glob/Glob.xs @@ -4,16 +4,9 @@ #include "bsd_glob.h" +/* XXX: need some thread awareness */ static int GLOB_ERROR = 0; -static int -not_here(char *s) -{ - croak("%s not implemented on this architecture", s); - return -1; -} - - static double constant(char *name, int arg) { diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index 4a7455c725..5e426f90f3 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -42,12 +42,14 @@ typedef datum datum_value ; typedef void (*FATALFUNC)(); +#ifndef GDBM_FAST static int not_here(char *s) { croak("GDBM_File::%s not implemented on this architecture", s); return -1; } +#endif /* GDBM allocates the datum with system malloc() and expects the user * to free() it. So we either have to free() it immediately, or have @@ -220,7 +222,7 @@ gdbm_TIEHASH(dbtype, name, read_write, mode, fatal_func = (FATALFUNC)croak) GDBM_FILE dbp ; RETVAL = NULL ; - if (dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, fatal_func)) { + if ((dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, fatal_func))) { RETVAL = (GDBM_File)safemalloc(sizeof(GDBM_File_type)) ; Zero(RETVAL, 1, GDBM_File_type) ; RETVAL->dbp = dbp ; diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index 6da48dca15..38acf41148 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -136,7 +136,7 @@ io_blocking(InputStream f, int block) MODULE = IO PACKAGE = IO::Seekable PREFIX = f -SV * +void fgetpos(handle) InputStream handle CODE: @@ -181,7 +181,7 @@ fsetpos(handle, pos) MODULE = IO PACKAGE = IO::File PREFIX = f -SV * +void new_tmpfile(packname = "IO::File") char * packname PREINIT: diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs index 4a10eb90e3..c7985f99fe 100644 --- a/ext/IPC/SysV/SysV.xs +++ b/ext/IPC/SysV/SysV.xs @@ -194,7 +194,7 @@ PPCODE: MODULE=IPC::SysV PACKAGE=IPC::SysV -int +void ftok(path, id) char * path int id @@ -206,7 +206,7 @@ ftok(path, id) DIE(aTHX_ PL_no_func, "ftok"); #endif -int +void SHMLBA() CODE: #ifdef SHMLBA @@ -436,7 +436,7 @@ BOOT: char *name; int i; - for(i = 0 ; name = IPC__SysV__const[i].n ; i++) { + for(i = 0 ; (name = IPC__SysV__const[i].n) ; i++) { newCONSTSUB(stash,name, newSViv(IPC__SysV__const[i].v)); } } diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs index 63c24e192b..cc4e1f45e1 100644 --- a/ext/Opcode/Opcode.xs +++ b/ext/Opcode/Opcode.xs @@ -325,7 +325,7 @@ PPCODE: void opset(...) CODE: - int i, j; + int i; SV *bitspec, *opset; char *bitmap; STRLEN len, on; diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index bb068d5076..7ffd49411a 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -3172,7 +3172,7 @@ localeconv() #ifdef HAS_LOCALECONV struct lconv *lcbuf; RETVAL = newHV(); - if (lcbuf = localeconv()) { + if ((lcbuf = localeconv())) { /* the strings */ if (lcbuf->decimal_point && *lcbuf->decimal_point) hv_store(RETVAL, "decimal_point", 13, @@ -3515,7 +3515,7 @@ SysRet nice(incr) int incr -int +void pipe() PPCODE: int fds[2]; @@ -3558,7 +3558,7 @@ tcsetpgrp(fd, pgrp_id) int fd pid_t pgrp_id -int +void uname() PPCODE: #ifdef HAS_UNAME @@ -3692,7 +3692,7 @@ strtoul(str, base = 0) PUSHs(&PL_sv_undef); } -SV * +void strxfrm(src) SV * src CODE: @@ -3827,7 +3827,10 @@ mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0) OUTPUT: RETVAL -char * +#XXX: if $xsubpp::WantOptimize is always the default +# sv_setpv(TARG, ...) could be used rather than +# ST(0) = sv_2mortal(newSVpv(...)) +void strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) char * fmt int sec diff --git a/ext/SDBM_File/SDBM_File.xs b/ext/SDBM_File/SDBM_File.xs index a4b90451a9..859730bf3a 100644 --- a/ext/SDBM_File/SDBM_File.xs +++ b/ext/SDBM_File/SDBM_File.xs @@ -57,7 +57,7 @@ sdbm_TIEHASH(dbtype, filename, flags, mode) DBM * dbp ; RETVAL = NULL ; - if (dbp = sdbm_open(filename,flags,mode) ) { + if ((dbp = sdbm_open(filename,flags,mode))) { RETVAL = (SDBM_File)safemalloc(sizeof(SDBM_File_type)) ; Zero(RETVAL, 1, SDBM_File_type) ; RETVAL->dbp = dbp ; |