diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-25 13:33:06 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-26 00:31:44 +0800 |
commit | f1adf80b568f0077689a3dcfb735259cb3100253 (patch) | |
tree | 52fd509562b8403115d7d32d0edefeb806a47986 /class.c | |
parent | c86200b4e6d2238a0e4a7026f42957107df1dd4e (diff) | |
download | perl-f1adf80b568f0077689a3dcfb735259cb3100253.tar.gz |
class.c - silence build warning under clang
Use SSize_t for iterator as it matches the type being compared against.
Silences the following warning:
class.c:555:26: warning: comparison of integers of different signs:
'U32' (aka 'unsigned long') and 'long' [-Wsign-compare]
for(U32 i = 0; i <= AvFILL(superaux->xhv_class_adjust_blocks); i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class.c:699:40: warning: comparison of integers of different signs:
'U32' (aka 'unsigned long') and 'ssize_t' (aka 'int') [-Wsign-compare]
for(U32 i = 0; fieldnames && i <= PadnamelistMAX(fieldnames); i++) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -552,7 +552,7 @@ apply_class_attribute_isa(pTHX_ HV *stash, SV *value) if(!aux->xhv_class_adjust_blocks) aux->xhv_class_adjust_blocks = newAV(); - for(U32 i = 0; i <= AvFILL(superaux->xhv_class_adjust_blocks); i++) + for(SSize_t i = 0; i <= AvFILL(superaux->xhv_class_adjust_blocks); i++) av_push(aux->xhv_class_adjust_blocks, AvARRAY(superaux->xhv_class_adjust_blocks)[i]); } @@ -696,7 +696,7 @@ Perl_class_seal_stash(pTHX_ HV *stash) PADNAMELIST *fieldnames = aux->xhv_class_fields; - for(U32 i = 0; fieldnames && i <= PadnamelistMAX(fieldnames); i++) { + for(SSize_t i = 0; fieldnames && i <= PadnamelistMAX(fieldnames); i++) { PADNAME *pn = PadnamelistARRAY(fieldnames)[i]; char sigil = PadnamePV(pn)[0]; PADOFFSET fieldix = PadnameFIELDINFO(pn)->fieldix; |