klen = klen_i32;
flags = 0;
}
- hek = hv_common(hv, NULL, key, klen, flags,
- (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
+ hek = (HE *) hv_common(hv, NULL, key, klen, flags,
+ (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
return hek ? &HeVAL(hek) : NULL;
}
Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val,
register U32 hash, int flags)
{
- HE * const hek = hv_common(hv, NULL, key, klen, flags,
- (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
+ HE * const hek = (HE *) hv_common(hv, NULL, key, klen, flags,
+ (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val,
+ hash);
return hek ? &HeVAL(hek) : NULL;
}
klen = klen_i32;
flags = 0;
}
- hek = hv_common(hv, NULL, key, klen, flags, lval
- ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) : HV_FETCH_JUST_SV,
- NULL, 0);
+ hek = (HE *) hv_common(hv, NULL, key, klen, flags,
+ lval ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE)
+ : HV_FETCH_JUST_SV, NULL, 0);
return hek ? &HeVAL(hek) : NULL;
}
=cut
*/
-HE *
+void *
Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
int flags, int action, SV *val, register U32 hash)
{
const char * const nkey = strupr(savepvn(key,klen));
/* Note that this fetch is for nkey (the uppercased
key) whereas the store is for key (the original) */
- entry = hv_common(hv, NULL, nkey, klen,
- HVhek_FREEKEY, /* free nkey */
- 0 /* non-LVAL fetch */
- | HV_DISABLE_UVAR_XKEY,
- NULL /* no value */,
- 0 /* compute hash */);
+ void *result = hv_common(hv, NULL, nkey, klen,
+ HVhek_FREEKEY, /* free nkey */
+ 0 /* non-LVAL fetch */
+ | HV_DISABLE_UVAR_XKEY,
+ NULL /* no value */,
+ 0 /* compute hash */);
if (!entry && (action & HV_FETCH_LVALUE)) {
/* This call will free key if necessary.
Do it this way to encourage compiler to tail
call optimise. */
- entry = hv_common(hv, keysv, key, klen,
- flags,
- HV_FETCH_ISSTORE
- | HV_DISABLE_UVAR_XKEY,
- newSV(0), hash);
+ result = hv_common(hv, keysv, key, klen, flags,
+ HV_FETCH_ISSTORE
+ | HV_DISABLE_UVAR_XKEY,
+ newSV(0), hash);
} else {
if (flags & HVhek_FREEKEY)
Safefree(key);
}
- return entry;
+ return result;
}
}
#endif
if (needs_copy) {
SV *sv;
- entry = hv_common(hv, keysv, key, klen, k_flags & ~HVhek_FREEKEY,
- HV_FETCH_LVALUE|HV_DISABLE_UVAR_XKEY, NULL,
- hash);
+ entry = (HE *) hv_common(hv, keysv, key, klen,
+ k_flags & ~HVhek_FREEKEY,
+ HV_FETCH_LVALUE|HV_DISABLE_UVAR_XKEY,
+ NULL, hash);
sv = entry ? HeVAL(entry) : NULL;
if (sv) {
if (SvMAGICAL(sv)) {
hek)
#define hv_store_ent(zlonk, awk, touche, zgruppp) \
- hv_common((zlonk), (awk), NULL, 0, 0, HV_FETCH_ISSTORE, (touche), (zgruppp))
+ ((HE *) hv_common((zlonk), (awk), NULL, 0, 0, HV_FETCH_ISSTORE, \
+ (touche), (zgruppp)))
#define hv_exists_ent(zlonk, awk, zgruppp) \
(hv_common((zlonk), (awk), NULL, 0, 0, HV_FETCH_ISEXISTS, 0, (zgruppp))\
? TRUE : FALSE)
#define hv_fetch_ent(zlonk, awk, touche, zgruppp) \
- hv_common((zlonk), (awk), NULL, 0, 0, ((touche) ? HV_FETCH_LVALUE : 0), \
- NULL, (zgruppp))
+ ((HE *) hv_common((zlonk), (awk), NULL, 0, 0, \
+ ((touche) ? HV_FETCH_LVALUE : 0), NULL, (zgruppp)))
#define hv_delete_ent(zlonk, awk, touche, zgruppp) \
((SV *) hv_common((zlonk), (awk), NULL, 0, 0, (touche) | HV_DELETE, \
NULL, (zgruppp)))