lib/PDL/IO/Misc-pp-bswap8.c

filter: Statementstmt 25.5% 51 / 200 Branchbran 12.3% 43 / 348 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 17.1% 94 / 548 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/PDL/Slices-pp-rldvec.c ↑ Summary lib/PDL/Primitive-pp-statsover.c »
1  
2 #line 453 "lib/PDL/PP.pm"
3 /*
4 * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/IO/Misc.pd! Do not modify!
5 */
6  
7 #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \
8 if (destroy) { \
9 comp_free_code \
10 } \
11 if ((trans)->dims_redone) { \
12 ntpriv_free_code \
13 }
14  
15 #include "EXTERN.h"
16 #include "perl.h"
17 #include "XSUB.h"
18 #include "pdl.h"
19 #include "pdlcore.h"
20 #define PDL PDL_IO_Misc
21 extern Core* PDL; /* Structure hold core C functions */
22  
23 #line 1888 "lib/PDL/PP.pm"
24 pdl_error pdl_bswap8_redodims(pdl_trans *__privtrans) {
25 pdl_error PDL_err = {0, NULL, 0};
26 #line 27 "lib/PDL/IO/Misc-pp-bswap8.c"
27 #ifndef PDL_DECLARE_PARAMS_bswap8_0
28 #define PDL_DECLARE_PARAMS_bswap8_0(PDL_TYPE_OP,PDL_PPSYM_OP) \
29 PDL_DECLARE_PARAMETER(PDL_TYPE_OP, x, (__privtrans->pdls[0]), 0, PDL_PPSYM_OP)
30 #endif
31 #define PDL_IF_BAD(t,f) f
32 64 switch (__privtrans->__datatype) { /* Start generic switch */
33 0 case PDL_SB: {
34 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_SByte,A)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_SByte,A) 0 0 0
35 {if (sizeof(PDL_SByte) < 8)
36 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_SByte));
37 }
38 } break;
39 0 case PDL_B: {
40 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Byte,B)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Byte,B) 0 0 0
41 {if (sizeof(PDL_Byte) < 8)
42 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Byte));
43 }
44 } break;
45 1 case PDL_S: {
46 1 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Short,S)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Short,S) 0 1 1
47 {if (sizeof(PDL_Short) < 8)
48 1 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Short));
49 }
50 } break;
51 0 case PDL_US: {
52 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Ushort,U)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Ushort,U) 0 0 0
53 {if (sizeof(PDL_Ushort) < 8)
54 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Ushort));
55 }
56 } break;
57 0 case PDL_L: {
58 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Long,L)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Long,L) 0 0 0
59 {if (sizeof(PDL_Long) < 8)
60 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Long));
61 }
62 } break;
63 0 case PDL_UL: {
64 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_ULong,K)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_ULong,K) 0 0 0
65 {if (sizeof(PDL_ULong) < 8)
66 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_ULong));
67 }
68 } break;
69 0 case PDL_IND: {
70 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Indx,N)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Indx,N) 0 0 0
71 {if (sizeof(PDL_Indx) < 8)
72 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Indx));
73 }
74 0 } break;
75 0 case PDL_ULL: {
76 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_ULongLong,P)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_ULongLong,P) 0 0 0
77 {if (sizeof(PDL_ULongLong) < 8)
78 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_ULongLong));
79 }
80 0 } break;
81 4 case PDL_LL: {
82 4 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_LongLong,Q)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_LongLong,Q) 0 4 4
83 {if (sizeof(PDL_LongLong) < 8)
84 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_LongLong));
85 }
86 4 } break;
87 0 case PDL_F: {
88 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Float,F)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Float,F) 0 0 0
89 {if (sizeof(PDL_Float) < 8)
90 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Float));
91 }
92 } break;
93 59 case PDL_D: {
94 59 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_Double,D)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_Double,D) 0 59 59
95 {if (sizeof(PDL_Double) < 8)
96 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_Double));
97 }
98 59 } break;
99 0 case PDL_LD: {
100 0 ▶ PDL_DECLARE_PARAMS_bswap8_0(PDL_LDouble,E)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_0(PDL_LDouble,E) 0 0 0
101 {if (sizeof(PDL_LDouble) < 8)
102 return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "Tried to bswap size 8 but data type only %zd bytes",sizeof(PDL_LDouble));
103 }
104 0 } break;
105 0 default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in bswap8: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
106 }
107 #undef PDL_IF_BAD
108  
109 63 ▶ PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); 0 63 63
110 63 return PDL_err;
111 }
112  
113  
114 #line 1888 "lib/PDL/PP.pm"
115 pdl_error pdl_bswap8_readdata(pdl_trans *__privtrans) {
116 pdl_error PDL_err = {0, NULL, 0};
117 #line 118 "lib/PDL/IO/Misc-pp-bswap8.c"
118 63 ▶ if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "broadcast.incs NULL");
Branch: 1 branch
BranchTrueFalseTotal
if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in bswap8:" "broadcast.incs NULL"); 0 63 63
119 /* broadcastloop declarations */
120 int __brcloopval;
121 register PDL_Indx __tind0,__tind1; /* counters along dim */
122 63 register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
123 /* dims here are how many steps along those dims */
124 63 register PDL_Indx __tinc0_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
125 63 register PDL_Indx __tinc1_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
126 #define PDL_BROADCASTLOOP_START_bswap8_readdata PDL_BROADCASTLOOP_START( \
127 readdata, \
128 __privtrans->broadcast, \
129 __privtrans->vtable, \
130 x_datap += __offsp[0]; \
131 , \
132 ( ,x_datap += __tinc1_x - __tinc0_x * __tdims0 \
133 ), \
134 ( ,x_datap += __tinc0_x \
135 ) \
136 )
137 #define PDL_BROADCASTLOOP_END_bswap8_readdata PDL_BROADCASTLOOP_END( \
138 __privtrans->broadcast, \
139 x_datap -= __tinc1_x * __tdims1 + __offsp[0]; \
140 )
141 #ifndef PDL_DECLARE_PARAMS_bswap8_1
142 #define PDL_DECLARE_PARAMS_bswap8_1(PDL_TYPE_OP,PDL_PPSYM_OP) \
143 PDL_DECLARE_PARAMETER(PDL_TYPE_OP, x, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP)
144 #endif
145 #define PDL_IF_BAD(t,f) f
146 63 switch (__privtrans->__datatype) { /* Start generic switch */
147 0 case PDL_SB: {
148 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_SByte,A)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_SByte,A) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_SByte,A) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_SByte,A) 0 0 0
149 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
150 0 int n = sizeof((x_datap)[0]) / 8;
151 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
152 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
153 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
154 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
155 0 PDL_Byte *b = (PDL_Byte*) &bb;
156 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
157 }
158 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
159 0 } break;
160 0 case PDL_B: {
161 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Byte,B)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Byte,B) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Byte,B) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Byte,B) 0 0 0
162 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
163 0 int n = sizeof((x_datap)[0]) / 8;
164 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
165 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
166 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
167 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
168 0 PDL_Byte *b = (PDL_Byte*) &bb;
169 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
170 }
171 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
172 0 } break;
173 0 case PDL_S: {
174 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Short,S)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Short,S) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Short,S) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Short,S) 0 0 0
175 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
176 0 int n = sizeof((x_datap)[0]) / 8;
177 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
178 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
179 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
180 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
181 0 PDL_Byte *b = (PDL_Byte*) &bb;
182 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
183 }
184 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
185 0 } break;
186 0 case PDL_US: {
187 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Ushort,U)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Ushort,U) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Ushort,U) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Ushort,U) 0 0 0
188 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
189 0 int n = sizeof((x_datap)[0]) / 8;
190 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
191 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
192 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
193 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
194 0 PDL_Byte *b = (PDL_Byte*) &bb;
195 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
196 }
197 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
198 0 } break;
199 0 case PDL_L: {
200 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Long,L)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Long,L) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Long,L) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Long,L) 0 0 0
201 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
202 0 int n = sizeof((x_datap)[0]) / 8;
203 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
204 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
205 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
206 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
207 0 PDL_Byte *b = (PDL_Byte*) &bb;
208 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
209 }
210 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
211 0 } break;
212 0 case PDL_UL: {
213 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_ULong,K)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULong,K) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULong,K) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULong,K) 0 0 0
214 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
215 0 int n = sizeof((x_datap)[0]) / 8;
216 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
217 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
218 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
219 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
220 0 PDL_Byte *b = (PDL_Byte*) &bb;
221 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
222 }
223 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
224 0 } break;
225 0 case PDL_IND: {
226 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Indx,N)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Indx,N) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Indx,N) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Indx,N) 0 0 0
227 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
228 0 int n = sizeof((x_datap)[0]) / 8;
229 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
230 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
231 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
232 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
233 0 PDL_Byte *b = (PDL_Byte*) &bb;
234 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
235 }
236 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
237 0 } break;
238 0 case PDL_ULL: {
239 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_ULongLong,P)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULongLong,P) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULongLong,P) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_ULongLong,P) 0 0 0
240 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
241 0 int n = sizeof((x_datap)[0]) / 8;
242 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
243 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
244 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
245 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
246 0 PDL_Byte *b = (PDL_Byte*) &bb;
247 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
248 }
249 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
250 0 } break;
251 4 case PDL_LL: {
252 4 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_LongLong,Q)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_LongLong,Q) 0 4 4
PDL_DECLARE_PARAMS_bswap8_1(PDL_LongLong,Q) 4 0 4
PDL_DECLARE_PARAMS_bswap8_1(PDL_LongLong,Q) 0 4 4
253 220 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 4 4
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 4 4
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 4 4
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 4 4
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 4 4
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 196 16 212
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 16 4 20
254 196 int n = sizeof((x_datap)[0]) / 8;
255 196 struct {char n[8];} *aa = (void *) &(x_datap)[0];
256 392 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 196 196 392
257 196 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
258 196 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
259 196 PDL_Byte *b = (PDL_Byte*) &bb;
260 196 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
261 }
262 4 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 4 4
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 4 4
263 4 } break;
264 0 case PDL_F: {
265 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Float,F)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Float,F) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Float,F) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_Float,F) 0 0 0
266 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
267 0 int n = sizeof((x_datap)[0]) / 8;
268 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
269 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
270 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
271 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
272 0 PDL_Byte *b = (PDL_Byte*) &bb;
273 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
274 }
275 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
276 0 } break;
277 59 case PDL_D: {
278 59 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_Double,D)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_Double,D) 0 59 59
PDL_DECLARE_PARAMS_bswap8_1(PDL_Double,D) 59 0 59
PDL_DECLARE_PARAMS_bswap8_1(PDL_Double,D) 0 59 59
279 10377 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 59 59
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 59 59
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 59 59
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 77 77
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 77 77
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 9844 397 10241
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 397 77 474
280 9844 int n = sizeof((x_datap)[0]) / 8;
281 9844 struct {char n[8];} *aa = (void *) &(x_datap)[0];
282 19688 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 9844 9844 19688
283 9844 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
284 9844 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
285 9844 PDL_Byte *b = (PDL_Byte*) &bb;
286 9844 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
287 }
288 77 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 77 77
}PDL_BROADCASTLOOP_END_bswap8_readdata 18 59 77
289 59 } break;
290 0 case PDL_LD: {
291 0 ▶ PDL_DECLARE_PARAMS_bswap8_1(PDL_LDouble,E)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap8_1(PDL_LDouble,E) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_LDouble,E) 0 0 0
PDL_DECLARE_PARAMS_bswap8_1(PDL_LDouble,E) 0 0 0
292 0 ▶ PDL_BROADCASTLOOP_START_bswap8_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap8_readdata {int i; 0 0 0
293 0 int n = sizeof((x_datap)[0]) / 8;
294 0 struct {char n[8];} *aa = (void *) &(x_datap)[0];
295 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
296 0 struct {char n[8];} bb; memcpy(&bb, aa+i, 8);
297 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
298 0 PDL_Byte *b = (PDL_Byte*) &bb;
299 0 a[0] = b[7]; a[1] = b[6]; a[2] = b[5]; a[3] = b[4]; a[4] = b[3]; a[5] = b[2]; a[6] = b[1]; a[7] = b[0];
300 }
301 0 ▶ }PDL_BROADCASTLOOP_END_bswap8_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap8_readdata 0 0 0
302 0 } break;
303 0 default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in bswap8: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
304 }
305 #undef PDL_IF_BAD
306 63 return PDL_err;
307 }
308  
309 static pdl_datatypes pdl_bswap8_vtable_gentypes[] = { PDL_SB, PDL_B, PDL_S, PDL_US, PDL_L, PDL_UL, PDL_IND, PDL_ULL, PDL_LL, PDL_F, PDL_D, PDL_LD, -1 };
310 static PDL_Indx pdl_bswap8_vtable_realdims[] = { 0 };
311 static char *pdl_bswap8_vtable_parnames[] = { "x" };
312 static short pdl_bswap8_vtable_parflags[] = {
313 PDL_PARAM_ISWRITE
314 };
315 static pdl_datatypes pdl_bswap8_vtable_partypes[] = { -1 };
316 static PDL_Indx pdl_bswap8_vtable_realdims_starts[] = { 0 };
317 static PDL_Indx pdl_bswap8_vtable_realdims_ind_ids[] = { 0 };
318 static char *pdl_bswap8_vtable_indnames[] = { "" };
319 pdl_transvtable pdl_bswap8_vtable = {
320 PDL_TRANS_DO_BROADCAST, 0, pdl_bswap8_vtable_gentypes, 0, 1, NULL /*CORE21*/,
321 pdl_bswap8_vtable_realdims, pdl_bswap8_vtable_parnames,
322 pdl_bswap8_vtable_parflags, pdl_bswap8_vtable_partypes,
323 pdl_bswap8_vtable_realdims_starts, pdl_bswap8_vtable_realdims_ind_ids, 0,
324 0, pdl_bswap8_vtable_indnames,
325 pdl_bswap8_redodims, pdl_bswap8_readdata, NULL,
326 NULL,
327 0,"PDL::IO::Misc::bswap8"
328 };
329  
330  
331 64 pdl_error pdl_run_bswap8(pdl *x) {
332 64 pdl_error PDL_err = {0, NULL, 0};
333 64 ▶ if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
Branch: 1 branch
BranchTrueFalseTotal
if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; 0 64 64
334 64 pdl_trans *__privtrans = PDL->create_trans(&pdl_bswap8_vtable);
335 64 ▶ if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
Branch: 1 branch
BranchTrueFalseTotal
if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); 0 64 64
336 64 __privtrans->pdls[0] = x;
337 64 ▶ PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); 0 64 64
338 64 ▶ PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); 1 63 64
339 63 return PDL_err;
340 }
« lib/PDL/Slices-pp-rldvec.c ↑ Summary lib/PDL/Primitive-pp-statsover.c »