Trivial.xs

filter: Statementstmt 100% 7 / 7 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 13 / 13 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« const-xs.inc ↑ Summary blib/lib/Digest/Trivial.pm »
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4  
5 #include "const-c.inc"
6  
7 MODULE = Digest::Trivial PACKAGE = Digest::Trivial
8  
9 INCLUDE: const-xs.inc
10  
11 int
12 trivial_x (char *str);
13 PROTOTYPE: $
14 CODE:
15 1536 RETVAL = 0;
16 263321 ▶ for (; * str; str ++) {
Branch: 1 branch
BranchTrueFalseTotal
for (; * str; str ++) { 261785 1536 263321
17 261785 RETVAL ^= (unsigned char) * str;
18 }
19 OUTPUT:
20 RETVAL
21  
22  
23 int
24 trivial_s (char *str);
25 PROTOTYPE: $
26 CODE:
27 1280 RETVAL = 0;
28 262555 ▶ for (; * str; str ++) {
Branch: 1 branch
BranchTrueFalseTotal
for (; * str; str ++) { 261275 1280 262555
29 261275 RETVAL += (unsigned char) * str;
30 }
31 1280 ▶ RETVAL %= 256;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL %= 256; 1278 2 1280
32 OUTPUT:
33 RETVAL
« const-xs.inc ↑ Summary blib/lib/Digest/Trivial.pm »