Skip to content

Commit 4effa26

Browse files
committed
XXX try some Size_t for win
1 parent 0bf91cc commit 4effa26

File tree

4 files changed

+79
-18
lines changed

4 files changed

+79
-18
lines changed

embed.fnc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,12 +1024,12 @@ Apd |void |hv_clear |NULLOK HV *hv
10241024
: used in SAVEHINTS() and op.c
10251025
ApdR |HV * |hv_copy_hints_hv|NULLOK HV *const ohv
10261026
Cp |void |hv_delayfree_ent|NULLOK HV *notused|NULLOK HE *entry
1027-
AbMdp |SV* |hv_delete |NULLOK HV *hv|NN const char *key|I32 klen \
1027+
AbMdp |SV* |hv_delete |NULLOK HV *hv|NN const char *key|Size_t klen \
10281028
|I32 flags
10291029
AbMdp |SV* |hv_delete_ent |NULLOK HV *hv|NN SV *keysv|I32 flags|U32 hash
1030-
AbMdRp |bool |hv_exists |NULLOK HV *hv|NN const char *key|I32 klen
1030+
AbMdRp |bool |hv_exists |NULLOK HV *hv|NN const char *key|Size_t klen
10311031
AbMdRp |bool |hv_exists_ent |NULLOK HV *hv|NN SV *keysv|U32 hash
1032-
AbMdp |SV** |hv_fetch |NULLOK HV *hv|NN const char *key|I32 klen \
1032+
AbMdp |SV** |hv_fetch |NULLOK HV *hv|NN const char *key|Size_t klen \
10331033
|I32 lval
10341034
AbMdp |HE* |hv_fetch_ent |NULLOK HV *hv|NN SV *keysv|I32 lval|U32 hash
10351035
Cp |void* |hv_common |NULLOK HV *hv|NULLOK SV *keysv \
@@ -1074,12 +1074,12 @@ Xpd |struct refcounted_he *|refcounted_he_new_sv \
10741074
Xpd |void |refcounted_he_free|NULLOK struct refcounted_he *he
10751075
Xpd |struct refcounted_he *|refcounted_he_inc|NULLOK struct refcounted_he *he
10761076
ApbMd |SV** |hv_store |NULLOK HV *hv|NULLOK const char *key \
1077-
|I32 klen|NULLOK SV *val|U32 hash
1077+
|Size_t klen|NULLOK SV *val|U32 hash
10781078
Amd |SV** |hv_stores |NULLOK HV* hv|"key"|NULLOK SV* val
10791079
ApbMd |HE* |hv_store_ent |NULLOK HV *hv|NULLOK SV *key|NULLOK SV *val\
10801080
|U32 hash
10811081
ApbMx |SV** |hv_store_flags |NULLOK HV *hv|NULLOK const char *key \
1082-
|I32 klen|NULLOK SV *val|U32 hash|int flags
1082+
|Size_t klen|NULLOK SV *val|U32 hash|int flags
10831083
Amd |void |hv_undef |NULLOK HV *hv
10841084
poX |void |hv_undef_flags |NULLOK HV *hv|U32 flags
10851085
AdmP |I32 |ibcmp |NN const char* a|NN const char* b|I32 len
@@ -1383,7 +1383,7 @@ Apd |void |sortsv |NULLOK SV** array|size_t num_elts|NN SVCOMPARE_t cmp
13831383
Apd |void |sortsv_flags |NULLOK SV** array|size_t num_elts|NN SVCOMPARE_t cmp|U32 flags
13841384
Apd |int |mg_clear |NN SV* sv
13851385
Apd |int |mg_copy |NN SV *sv|NN SV *nsv|NULLOK const char *key \
1386-
|I32 klen
1386+
|Size_t klen
13871387
: Defined in mg.c, used only in scope.c
13881388
pd |void |mg_localize |NN SV* sv|NN SV* nsv|bool setmagic
13891389
Apd |SV* |sv_string_from_errnum|int errnum|NULLOK SV* tgtsv

mg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ Copies the magic from one SV to another. See C<L</sv_magic>>.
433433
*/
434434

435435
int
436-
Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen)
436+
Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, Size_t klen)
437437
{
438438
int count = 0;
439439
MAGIC* mg;

mro_core.c

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level)
283283
if(av && AvFILLp(av) >= 0) {
284284

285285
SV **svp = AvARRAY(av);
286-
I32 items = AvFILLp(av) + 1;
286+
SSize_t items = AvFILLp(av) + 1;
287287

288288
/* foreach(@ISA) */
289289
while (items--) {
290290
SV* const sv = *svp ? *svp : &PL_sv_undef;
291291
HV* const basestash = gv_stashsv(sv, 0);
292292
SV *const *subrv_p;
293-
I32 subrv_items;
293+
SSize_t subrv_items;
294294
svp++;
295295

296296
if (!basestash) {
@@ -449,7 +449,7 @@ Perl_mro_get_linear_isa(pTHX_ HV *stash)
449449
if (!meta->isa) {
450450
HV *const isa_hash = newHV();
451451
/* Linearisation didn't build it for us, so do it here. */
452-
I32 count = AvFILLp(isa) + 1;
452+
SSize_t count = AvFILLp(isa) + 1;
453453
SV *const *svp = AvARRAY(isa);
454454
SV *const *const svp_end = svp + count;
455455
const HEK *canon_name = HvENAME_HEK(stash);
@@ -507,7 +507,7 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
507507
AV* linear_mro;
508508
HE* iter;
509509
SV** svp;
510-
I32 items;
510+
SSize_t items;
511511
bool is_universal;
512512
struct mro_meta * meta;
513513
HV *isa = NULL;
@@ -902,7 +902,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
902902
XPVHV* xhv;
903903
HE *entry;
904904
I32 riter = -1;
905-
I32 items = 0;
905+
SSize_t items = 0;
906906
const bool stash_had_name = stash && HvENAME(stash);
907907
bool fetched_isarev = FALSE;
908908
HV *seen = NULL;
@@ -1453,3 +1453,64 @@ XS(XS_mro_method_changed_in)
14531453
/*
14541454
* ex: set ts=8 sts=4 sw=4 et:
14551455
*/
1456+
#if 0
1457+
gv.c
1458+
D:\a\perl5\perl5\inline.h(2751): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1459+
D:\a\perl5\perl5\inline.h(2826): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1460+
D:\a\perl5\perl5\inline.h(2887): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1461+
..\gv.c(158): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1462+
..\gv.c(521): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1463+
..\gv.c(601): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1464+
..\gv.c(685): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1465+
..\gv.c(897): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1466+
..\gv.c(1207): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1467+
..\gv.c(1212): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1468+
..\gv.c(1520): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1469+
..\gv.c(1529): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1470+
..\gv.c(1568): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1471+
..\gv.c(1702): warning C4267: '=': conversion from 'size_t' to 'U32', possible loss of data
1472+
..\gv.c(1853): warning C4244: 'function': conversion from '__int64' to 'U32', possible loss of data
1473+
..\gv.c(1861): warning C4244: 'function': conversion from '__int64' to 'U32', possible loss of data
1474+
..\gv.c(2182): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1475+
..\gv.c(2330): warning C4244: 'function': conversion from '__int64' to 'const I32', possible loss of data
1476+
..\gv.c(2347): warning C4267: 'function': conversion from 'size_t' to 'const I32', possible loss of data
1477+
..\gv.c(2358): warning C4267: 'function': conversion from 'size_t' to 'const I32', possible loss of data
1478+
..\gv.c(2417): warning C4267: 'function': conversion from 'size_t' to 'const I32', possible loss of data
1479+
..\gv.c(2697): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1480+
..\gv.c(3987): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1481+
..\gv.c(4171): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1482+
cl -c -nologo -GF -W3 -MD -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS -DPERLDLL -DPERL_CORE -O1 -Zi -GL -fp:precise -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -Fo.\mini\mro_core.obj ..\mro_core.c
1483+
mro_core.c
1484+
D:\a\perl5\perl5\inline.h(2751): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1485+
D:\a\perl5\perl5\inline.h(2826): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1486+
D:\a\perl5\perl5\inline.h(2887): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1487+
..\mro_core.c(452): warning C4244: 'initializing': conversion from '__int64' to 'I32', possible loss of data
1488+
..\mro_core.c(622): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1489+
..\mro_core.c(670): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1490+
..\mro_core.c(961): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1491+
..\mro_core.c(977): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1492+
..\mro_core.c(1004): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1493+
..\mro_core.c(1015): warning C4267: 'function': conversion from 'size_t' to 'U32', possible loss of data
1494+
..\mro_core.c(1084): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1495+
..\mro_core.c(1174): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1496+
..\mro_core.c(1257): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1497+
cl -c -nologo -GF -W3 -MD -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS -DPERLDLL -DPERL_CORE -O1 -Zi -GL -fp:precise -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -Fo.\mini\hv.obj ..\hv.c
1498+
hv.c
1499+
D:\a\perl5\perl5\inline.h(2751): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1500+
D:\a\perl5\perl5\inline.h(2826): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1501+
D:\a\perl5\perl5\inline.h(2887): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
1502+
..\hv.c(651): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1503+
..\hv.c(698): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1504+
..\hv.c(927): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1505+
..\hv.c(989): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1506+
..\hv.c(1417): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1507+
..\hv.c(1571): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1508+
..\hv.c(1831): warning C4267: 'function': conversion from 'size_t' to 'I32', possible loss of data
1509+
..\hv.c(2086): warning C4267: '=': conversion from 'size_t' to 'I32', possible loss of data
1510+
..\hv.c(2459): warning C4267: 'return': conversion from 'size_t' to 'I32', possible loss of data
1511+
..\hv.c(3087): warning C4267: '=': conversion from 'size_t' to 'I32', possible loss of data
1512+
..\hv.c(3231): warning C4267: '=': conversion from 'size_t' to 'I32', possible loss of data
1513+
..\hv.c(3382): warning C4267: '=': conversion from 'size_t' to 'I32', possible loss of data
1514+
..\hv.c(3442): warning C4244: 'return': conversion from '__int64' to 'I32', possible loss of data
1515+
..\hv.c(3538): warning C4267: '=': conversion from 'size_t' to 'U32', possible loss of data
1516+
#endif

proto.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ PERL_CALLCONV HV * Perl_hv_copy_hints_hv(pTHX_ HV *const ohv)
14341434
PERL_CALLCONV void Perl_hv_delayfree_ent(pTHX_ HV *notused, HE *entry);
14351435
#define PERL_ARGS_ASSERT_HV_DELAYFREE_ENT
14361436
#ifndef NO_MATHOMS
1437-
PERL_CALLCONV SV* Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags);
1437+
PERL_CALLCONV SV* Perl_hv_delete(pTHX_ HV *hv, const char *key, Size_t klen, I32 flags);
14381438
#define PERL_ARGS_ASSERT_HV_DELETE \
14391439
assert(key)
14401440
#endif
@@ -1458,7 +1458,7 @@ PERL_CALLCONV void Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len,
14581458
#define PERL_ARGS_ASSERT_HV_ENAME_DELETE \
14591459
assert(hv); assert(name)
14601460
#ifndef NO_MATHOMS
1461-
PERL_CALLCONV bool Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen)
1461+
PERL_CALLCONV bool Perl_hv_exists(pTHX_ HV *hv, const char *key, Size_t klen)
14621462
__attribute__warn_unused_result__;
14631463
#define PERL_ARGS_ASSERT_HV_EXISTS \
14641464
assert(key)
@@ -1472,7 +1472,7 @@ PERL_CALLCONV bool Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
14721472
#endif
14731473

14741474
#ifndef NO_MATHOMS
1475-
PERL_CALLCONV SV** Perl_hv_fetch(pTHX_ HV *hv, const char *key, I32 klen, I32 lval);
1475+
PERL_CALLCONV SV** Perl_hv_fetch(pTHX_ HV *hv, const char *key, Size_t klen, I32 lval);
14761476
#define PERL_ARGS_ASSERT_HV_FETCH \
14771477
assert(key)
14781478
#endif
@@ -1565,15 +1565,15 @@ PERL_CALLCONV SV* Perl_hv_scalar(pTHX_ HV *hv)
15651565
assert(hv)
15661566

15671567
#ifndef NO_MATHOMS
1568-
PERL_CALLCONV SV** Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen, SV *val, U32 hash);
1568+
PERL_CALLCONV SV** Perl_hv_store(pTHX_ HV *hv, const char *key, Size_t klen, SV *val, U32 hash);
15691569
#define PERL_ARGS_ASSERT_HV_STORE
15701570
#endif
15711571
#ifndef NO_MATHOMS
15721572
PERL_CALLCONV HE* Perl_hv_store_ent(pTHX_ HV *hv, SV *key, SV *val, U32 hash);
15731573
#define PERL_ARGS_ASSERT_HV_STORE_ENT
15741574
#endif
15751575
#ifndef NO_MATHOMS
1576-
PERL_CALLCONV SV** Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val, U32 hash, int flags);
1576+
PERL_CALLCONV SV** Perl_hv_store_flags(pTHX_ HV *hv, const char *key, Size_t klen, SV *val, U32 hash, int flags);
15771577
#define PERL_ARGS_ASSERT_HV_STORE_FLAGS
15781578
#endif
15791579
/* PERL_CALLCONV SV** hv_stores(pTHX_ HV* hv, const char * const key, SV* val); */
@@ -2057,7 +2057,7 @@ PERL_CALLCONV Free_t Perl_mfree(Malloc_t where);
20572057
PERL_CALLCONV int Perl_mg_clear(pTHX_ SV* sv);
20582058
#define PERL_ARGS_ASSERT_MG_CLEAR \
20592059
assert(sv)
2060-
PERL_CALLCONV int Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen);
2060+
PERL_CALLCONV int Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, Size_t klen);
20612061
#define PERL_ARGS_ASSERT_MG_COPY \
20622062
assert(sv); assert(nsv)
20632063
PERL_CALLCONV MAGIC* Perl_mg_find(const SV* sv, int type)

0 commit comments

Comments
 (0)