xsubs/sizeof.xs

filter: Statementstmt 100% 10 / 10 Branchbran 100% 20 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 30 / 30 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xsubs/native.xs ↑ Summary xsubs/sourcify.xs »
1 ################################################################################
2 #
3 # Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the same terms as Perl itself.
6 #
7 ################################################################################
8  
9  
10 ################################################################################
11 #
12 # METHOD: sizeof
13 #
14 # WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002
15 # CHANGED BY: ON:
16 #
17 ################################################################################
18  
19 SV *
20 CBC::sizeof(type)
21 const char *type
22  
23 PREINIT:
24 148360 CBC_METHOD(sizeof);
25 MemberInfo mi;
26  
27 CODE:
28 CT_DEBUG_METHOD1("'%s'", type);
29  
30 148360 ▶ CHECK_VOID_CONTEXT;
Branch: 2 branches
BranchTrueFalseTotal
CHECK_VOID_CONTEXT; 12 148348 148360
CHECK_VOID_CONTEXT; 8 4 12
31  
32 148348 ▶ NEED_PARSE_DATA;
Branch: 2 branches
BranchTrueFalseTotal
NEED_PARSE_DATA; 148285 63 148348
NEED_PARSE_DATA; 19598 128687 148285
33  
34 148348 ▶ if (!get_member_info(aTHX_ THIS, type, &mi, 0))
Branch: 1 branch
BranchTrueFalseTotal
if (!get_member_info(aTHX_ THIS, type, &mi, 0)) 18 148180 148198
35 18 Perl_croak(aTHX_ "Cannot find '%s'", type);
36  
37 148180 ▶ if (mi.pDecl && mi.pDecl->bitfield_flag)
Branch: 2 branches
BranchTrueFalseTotal
if (mi.pDecl && mi.pDecl->bitfield_flag) 58226 89954 148180
if (mi.pDecl && mi.pDecl->bitfield_flag) 6 58220 58226
38 6 Perl_croak(aTHX_ "Cannot use %s on bitfields", method);
39  
40 148174 ▶ if (mi.flags)
Branch: 1 branch
BranchTrueFalseTotal
if (mi.flags) 89435 58739 148174
41 89435 ▶ WARN_FLAGS(type, mi.flags);
Branch: 2 branches
BranchTrueFalseTotal
WARN_FLAGS(type, mi.flags); 12 89423 89435
WARN_FLAGS(type, mi.flags); 8 4 12
42  
43 148174 RETVAL = newSVuv(mi.size);
44  
45 OUTPUT:
46 RETVAL
47  
« xsubs/native.xs ↑ Summary xsubs/sourcify.xs »