diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-17 16:52:15 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-17 16:52:15 +0000 |
commit | 7c9d72565a970bca339f2612b3491ef32646ed81 (patch) | |
tree | b4ae3bf910381858eed9b9c567b1cd88571362f0 /hv.c | |
parent | e6004194bd9995b9edb61bee40b1be70012d75ed (diff) | |
download | perl-7c9d72565a970bca339f2612b3491ef32646ed81.tar.gz |
PERL_HASH() casting games so that our hashed data is "unsigned
char" but old code using just a "char" doesn't need changes.
(The change is using a temporary pointer instead of a direct
cast to unsigned char* which would blindly cast anything,
not just char pointers.) (The problem arose in MacOS Classic,
as seen by Pudge, the cure by Nicholas Clark.)
p4raw-id: //depot/perl@16656
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -251,7 +251,7 @@ S_hv_fetch_flags(pTHX_ HV *hv, const char *key, I32 klen, I32 lval, int flags) } } - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); /* entry = (HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */ entry = ((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; @@ -410,7 +410,7 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) } if (!hash) - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); /* entry = (HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */ entry = ((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; @@ -578,7 +578,7 @@ Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val, HvHASKFLAGS_on((SV*)hv); if (!hash) - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); if (!xhv->xhv_array /* !HvARRAY(hv) */) Newz(505, xhv->xhv_array /* HvARRAY(hv) */, @@ -738,7 +738,7 @@ Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash) } if (!hash) - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); if (!xhv->xhv_array /* !HvARRAY(hv) */) Newz(505, xhv->xhv_array /* HvARRAY(hv) */, @@ -882,7 +882,7 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags) k_flags |= HVhek_FREEKEY; } - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); /* oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */ oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; @@ -1038,7 +1038,7 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) } if (!hash) - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); /* oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */ oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max]; @@ -1185,7 +1185,7 @@ Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen) k_flags |= HVhek_FREEKEY; } - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); #ifdef DYNAMIC_ENV_FETCH if (!xhv->xhv_array /* !HvARRAY(hv) */) entry = Null(HE*); @@ -1290,7 +1290,7 @@ Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) k_flags |= HVhek_FREEKEY; } if (!hash) - PERL_HASH(hash, (U8*)key, klen); + PERL_HASH(hash, key, klen); #ifdef DYNAMIC_ENV_FETCH if (!xhv->xhv_array /* !HvARRAY(hv) */) entry = Null(HE*); |