… | |
… | |
159 | return BER_TYPE_BYTES; |
159 | return BER_TYPE_BYTES; |
160 | |
160 | |
161 | return SvPVX (sv)[idx]; |
161 | return SvPVX (sv)[idx]; |
162 | } |
162 | } |
163 | |
163 | |
164 | static int |
164 | static void |
165 | profile_set (profile_type *profile, int klass, int tag, int type) |
165 | profile_set (profile_type *profile, int klass, int tag, int type) |
166 | { |
166 | { |
167 | SV *sv = (SV *)profile; |
167 | SV *sv = (SV *)profile; |
168 | U32 idx = (tag << 2) + klass; |
168 | U32 idx = (tag << 2) + klass; |
169 | STRLEN oldlen = SvCUR (sv); |
169 | STRLEN oldlen = SvCUR (sv); |
… | |
… | |
557 | static void |
557 | static void |
558 | set_buf (SV *sv) |
558 | set_buf (SV *sv) |
559 | { |
559 | { |
560 | STRLEN len; |
560 | STRLEN len; |
561 | buf_sv = sv; |
561 | buf_sv = sv; |
562 | buf = SvPVbyte (buf_sv, len); |
562 | buf = (U8 *)SvPVbyte (buf_sv, len); |
563 | cur = buf; |
563 | cur = buf; |
564 | end = buf + len; |
564 | end = buf + len; |
565 | } |
565 | } |
566 | |
566 | |
567 | /* similar to SvGROW, but somewhat safer and guarantees exponential realloc strategy */ |
567 | /* similar to SvGROW, but somewhat safer and guarantees exponential realloc strategy */ |
… | |
… | |
581 | need (STRLEN len) |
581 | need (STRLEN len) |
582 | { |
582 | { |
583 | if (expect_false ((uintptr_t)(end - cur) < len)) |
583 | if (expect_false ((uintptr_t)(end - cur) < len)) |
584 | { |
584 | { |
585 | STRLEN pos = cur - buf; |
585 | STRLEN pos = cur - buf; |
586 | buf = my_sv_grow (buf_sv, pos, len); |
586 | buf = (U8 *)my_sv_grow (buf_sv, pos, len); |
587 | cur = buf + pos; |
587 | cur = buf + pos; |
588 | end = buf + SvLEN (buf_sv) - 1; |
588 | end = buf + SvLEN (buf_sv) - 1; |
589 | } |
589 | } |
590 | } |
590 | } |
591 | |
591 | |
… | |
… | |
817 | put_length (uchars * chrsize); |
817 | put_length (uchars * chrsize); |
818 | |
818 | |
819 | while (uchars--) |
819 | while (uchars--) |
820 | { |
820 | { |
821 | STRLEN uclen; |
821 | STRLEN uclen; |
822 | UV uchr = utf8_to_uvchr_buf (ptr, ptr + len, &uclen); |
822 | UV uchr = utf8_to_uvchr_buf ((U8 *)ptr, (U8 *)ptr + len, &uclen); |
823 | |
823 | |
824 | ptr += uclen; |
824 | ptr += uclen; |
825 | len -= uclen; |
825 | len -= uclen; |
826 | |
826 | |
827 | if (chrsize == 4) |
827 | if (chrsize == 4) |
… | |
… | |
1028 | ber_decode (SV *ber, SV *profile = &PL_sv_undef) |
1028 | ber_decode (SV *ber, SV *profile = &PL_sv_undef) |
1029 | CODE: |
1029 | CODE: |
1030 | { |
1030 | { |
1031 | cur_profile = SvPROFILE (profile); |
1031 | cur_profile = SvPROFILE (profile); |
1032 | STRLEN len; |
1032 | STRLEN len; |
1033 | buf = SvPVbyte (ber, len); |
1033 | buf = (U8 *)SvPVbyte (ber, len); |
1034 | cur = buf; |
1034 | cur = buf; |
1035 | end = buf + len; |
1035 | end = buf + len; |
1036 | |
1036 | |
1037 | RETVAL = decode_ber (); |
1037 | RETVAL = decode_ber (); |
1038 | } |
1038 | } |