summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>1999-09-07 13:30:18 +0100
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-07 12:49:15 +0000
commit427181846486e3aa5034a647dc1922377185f4c0 (patch)
tree77214104959f745247da88a35a1ff858eede7f44 /ext/POSIX
parentf8d4b9aa3df7268ea9f1bdecfb17864f5f71ae93 (diff)
downloadperl-427181846486e3aa5034a647dc1922377185f4c0.tar.gz
Fix pointer casts.
To: perl5-porters@perl.org Subject: [ID 19990907.004] [PATCH perl5.005_61] compiler warnings with -Duse64bits Message-Id: <199909071130.MAA11435@tempest.npl.co.uk> p4raw-id: //depot/cfgperl@4100
Diffstat (limited to 'ext/POSIX')
-rw-r--r--ext/POSIX/POSIX.xs12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index cc3f0c10d6..0f09aace1a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -3246,7 +3246,7 @@ sigaction(sig, action, oldaction = 0)
}
else {
New(0, sigset, 1, sigset_t);
- sv_setptrobj(*svp, sigset, "POSIX::SigSet");
+ sv_setptrobj(*svp, PTR_CAST sigset, "POSIX::SigSet");
}
*sigset = oact.sa_mask;
@@ -3274,7 +3274,7 @@ INIT:
}
else if (sv_derived_from(ST(2), "POSIX::SigSet")) {
IV tmp = SvIV((SV*)SvRV(ST(2)));
- oldsigset = (POSIX__SigSet) tmp;
+ oldsigset = (POSIX__SigSet)PTR_CAST tmp;
}
else {
New(0, oldsigset, 1, sigset_t);
@@ -3455,10 +3455,12 @@ strtol(str, base = 0)
char *unparsed;
PPCODE:
num = strtol(str, &unparsed, base);
- if (num >= IV_MIN && num <= IV_MAX)
- PUSHs(sv_2mortal(newSViv((IV)num)));
- else
+#if IVSIZE <= LONGSIZE
+ if (num < IV_MIN || num > IV_MAX)
PUSHs(sv_2mortal(newSVnv((double)num)));
+ else
+#endif
+ PUSHs(sv_2mortal(newSViv((IV)num)));
if (GIMME == G_ARRAY) {
EXTEND(SP, 1);
if (unparsed)