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

filter: Statementstmt 0.0% 0 / 200 Branchbran 0.0% 0 / 348 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 548 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/PDL/LiteF.pm ↑ Summary lib/PDL/IO/Misc-pp-bswap16.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_bswap12_redodims(pdl_trans *__privtrans) {
25 pdl_error PDL_err = {0, NULL, 0};
26 #line 27 "lib/PDL/IO/Misc-pp-bswap12.c"
27 #ifndef PDL_DECLARE_PARAMS_bswap12_0
28 #define PDL_DECLARE_PARAMS_bswap12_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 0 switch (__privtrans->__datatype) { /* Start generic switch */
33 0 case PDL_SB: {
34 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_SByte,A)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_SByte,A) 0 0 0
35 {if (sizeof(PDL_SByte) < 12)
36 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_SByte));
37 }
38 } break;
39 0 case PDL_B: {
40 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Byte,B)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Byte,B) 0 0 0
41 {if (sizeof(PDL_Byte) < 12)
42 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Byte));
43 }
44 } break;
45 0 case PDL_S: {
46 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Short,S)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Short,S) 0 0 0
47 {if (sizeof(PDL_Short) < 12)
48 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Short));
49 }
50 } break;
51 0 case PDL_US: {
52 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Ushort,U)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Ushort,U) 0 0 0
53 {if (sizeof(PDL_Ushort) < 12)
54 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Ushort));
55 }
56 } break;
57 0 case PDL_L: {
58 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Long,L)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Long,L) 0 0 0
59 {if (sizeof(PDL_Long) < 12)
60 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Long));
61 }
62 } break;
63 0 case PDL_UL: {
64 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_ULong,K)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_ULong,K) 0 0 0
65 {if (sizeof(PDL_ULong) < 12)
66 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_ULong));
67 }
68 } break;
69 0 case PDL_IND: {
70 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Indx,N)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Indx,N) 0 0 0
71 {if (sizeof(PDL_Indx) < 12)
72 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Indx));
73 }
74 } break;
75 0 case PDL_ULL: {
76 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_ULongLong,P)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_ULongLong,P) 0 0 0
77 {if (sizeof(PDL_ULongLong) < 12)
78 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_ULongLong));
79 }
80 } break;
81 0 case PDL_LL: {
82 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_LongLong,Q)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_LongLong,Q) 0 0 0
83 {if (sizeof(PDL_LongLong) < 12)
84 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_LongLong));
85 }
86 } break;
87 0 case PDL_F: {
88 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Float,F)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Float,F) 0 0 0
89 {if (sizeof(PDL_Float) < 12)
90 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Float));
91 }
92 } break;
93 0 case PDL_D: {
94 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_Double,D)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_Double,D) 0 0 0
95 {if (sizeof(PDL_Double) < 12)
96 0 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 but data type only %zd bytes",sizeof(PDL_Double));
97 }
98 } break;
99 0 case PDL_LD: {
100 0 ▶ PDL_DECLARE_PARAMS_bswap12_0(PDL_LDouble,E)
Branch: 1 branch
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_0(PDL_LDouble,E) 0 0 0
101 {if (sizeof(PDL_LDouble) < 12)
102 return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "Tried to bswap size 12 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 bswap12: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
106 }
107 #undef PDL_IF_BAD
108  
109 0 ▶ PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); 0 0 0
110 0 return PDL_err;
111 }
112  
113  
114 #line 1888 "lib/PDL/PP.pm"
115 pdl_error pdl_bswap12_readdata(pdl_trans *__privtrans) {
116 pdl_error PDL_err = {0, NULL, 0};
117 #line 118 "lib/PDL/IO/Misc-pp-bswap12.c"
118 0 ▶ if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "broadcast.incs NULL");
Branch: 1 branch
BranchTrueFalseTotal
if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in bswap12:" "broadcast.incs NULL"); 0 0 0
119 /* broadcastloop declarations */
120 int __brcloopval;
121 register PDL_Indx __tind0,__tind1; /* counters along dim */
122 0 register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
123 /* dims here are how many steps along those dims */
124 0 register PDL_Indx __tinc0_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
125 0 register PDL_Indx __tinc1_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
126 #define PDL_BROADCASTLOOP_START_bswap12_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_bswap12_readdata PDL_BROADCASTLOOP_END( \
138 __privtrans->broadcast, \
139 x_datap -= __tinc1_x * __tdims1 + __offsp[0]; \
140 )
141 #ifndef PDL_DECLARE_PARAMS_bswap12_1
142 #define PDL_DECLARE_PARAMS_bswap12_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 0 switch (__privtrans->__datatype) { /* Start generic switch */
147 0 case PDL_SB: {
148 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_SByte,A)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_SByte,A) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_SByte,A) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_SByte,A) 0 0 0
149 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
150 0 int n = sizeof((x_datap)[0]) / 12;
151 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
154 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
155 0 PDL_Byte *b = (PDL_Byte*) &bb;
156 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
157 }
158 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
159 0 } break;
160 0 case PDL_B: {
161 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Byte,B)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Byte,B) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Byte,B) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Byte,B) 0 0 0
162 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
163 0 int n = sizeof((x_datap)[0]) / 12;
164 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
167 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
168 0 PDL_Byte *b = (PDL_Byte*) &bb;
169 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
170 }
171 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
172 0 } break;
173 0 case PDL_S: {
174 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Short,S)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Short,S) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Short,S) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Short,S) 0 0 0
175 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
176 0 int n = sizeof((x_datap)[0]) / 12;
177 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
180 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
181 0 PDL_Byte *b = (PDL_Byte*) &bb;
182 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
183 }
184 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
185 0 } break;
186 0 case PDL_US: {
187 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Ushort,U)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Ushort,U) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Ushort,U) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Ushort,U) 0 0 0
188 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
189 0 int n = sizeof((x_datap)[0]) / 12;
190 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
193 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
194 0 PDL_Byte *b = (PDL_Byte*) &bb;
195 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
196 }
197 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
198 0 } break;
199 0 case PDL_L: {
200 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Long,L)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Long,L) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Long,L) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Long,L) 0 0 0
201 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
202 0 int n = sizeof((x_datap)[0]) / 12;
203 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
206 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
207 0 PDL_Byte *b = (PDL_Byte*) &bb;
208 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
209 }
210 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
211 0 } break;
212 0 case PDL_UL: {
213 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_ULong,K)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULong,K) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULong,K) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULong,K) 0 0 0
214 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
215 0 int n = sizeof((x_datap)[0]) / 12;
216 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
219 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
220 0 PDL_Byte *b = (PDL_Byte*) &bb;
221 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
222 }
223 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
224 0 } break;
225 0 case PDL_IND: {
226 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Indx,N)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Indx,N) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Indx,N) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Indx,N) 0 0 0
227 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
228 0 int n = sizeof((x_datap)[0]) / 12;
229 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
232 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
233 0 PDL_Byte *b = (PDL_Byte*) &bb;
234 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
235 }
236 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
237 0 } break;
238 0 case PDL_ULL: {
239 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_ULongLong,P)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULongLong,P) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULongLong,P) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_ULongLong,P) 0 0 0
240 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
241 0 int n = sizeof((x_datap)[0]) / 12;
242 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
245 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
246 0 PDL_Byte *b = (PDL_Byte*) &bb;
247 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
248 }
249 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
250 0 } break;
251 0 case PDL_LL: {
252 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_LongLong,Q)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_LongLong,Q) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_LongLong,Q) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_LongLong,Q) 0 0 0
253 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
254 0 int n = sizeof((x_datap)[0]) / 12;
255 0 struct {char n[12];} *aa = (void *) &(x_datap)[0];
256 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
257 0 struct {char n[12];} bb; memcpy(&bb, aa+i, 12);
258 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
259 0 PDL_Byte *b = (PDL_Byte*) &bb;
260 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
261 }
262 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
263 0 } break;
264 0 case PDL_F: {
265 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Float,F)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Float,F) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Float,F) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Float,F) 0 0 0
266 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
267 0 int n = sizeof((x_datap)[0]) / 12;
268 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
271 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
272 0 PDL_Byte *b = (PDL_Byte*) &bb;
273 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
274 }
275 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
276 0 } break;
277 0 case PDL_D: {
278 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_Double,D)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_Double,D) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Double,D) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_Double,D) 0 0 0
279 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
280 0 int n = sizeof((x_datap)[0]) / 12;
281 0 struct {char n[12];} *aa = (void *) &(x_datap)[0];
282 0 ▶ for (i=0;i<n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i=0;i<n; i++) { 0 0 0
283 0 struct {char n[12];} bb; memcpy(&bb, aa+i, 12);
284 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
285 0 PDL_Byte *b = (PDL_Byte*) &bb;
286 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
287 }
288 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
289 0 } break;
290 0 case PDL_LD: {
291 0 ▶ PDL_DECLARE_PARAMS_bswap12_1(PDL_LDouble,E)
Branch: 3 branches
BranchTrueFalseTotal
PDL_DECLARE_PARAMS_bswap12_1(PDL_LDouble,E) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_LDouble,E) 0 0 0
PDL_DECLARE_PARAMS_bswap12_1(PDL_LDouble,E) 0 0 0
292 0 ▶ PDL_BROADCASTLOOP_START_bswap12_readdata {int i;
Branch: 7 branches
BranchTrueFalseTotal
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
PDL_BROADCASTLOOP_START_bswap12_readdata {int i; 0 0 0
293 0 int n = sizeof((x_datap)[0]) / 12;
294 0 struct {char n[12];} *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[12];} bb; memcpy(&bb, aa+i, 12);
297 0 PDL_Byte *a = (PDL_Byte*) (void*) (aa+i);
298 0 PDL_Byte *b = (PDL_Byte*) &bb;
299 0 a[0] = b[11]; a[1] = b[10]; a[2] = b[9]; a[3] = b[8]; a[4] = b[7]; a[5] = b[6]; a[6] = b[5]; a[7] = b[4]; a[8] = b[3]; a[9] = b[2]; a[10] = b[1]; a[11] = b[0];
300 }
301 0 ▶ }PDL_BROADCASTLOOP_END_bswap12_readdata
Branch: 2 branches
BranchTrueFalseTotal
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
}PDL_BROADCASTLOOP_END_bswap12_readdata 0 0 0
302 0 } break;
303 0 default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in bswap12: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
304 }
305 #undef PDL_IF_BAD
306 0 return PDL_err;
307 }
308  
309 static pdl_datatypes pdl_bswap12_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_bswap12_vtable_realdims[] = { 0 };
311 static char *pdl_bswap12_vtable_parnames[] = { "x" };
312 static short pdl_bswap12_vtable_parflags[] = {
313 PDL_PARAM_ISWRITE
314 };
315 static pdl_datatypes pdl_bswap12_vtable_partypes[] = { -1 };
316 static PDL_Indx pdl_bswap12_vtable_realdims_starts[] = { 0 };
317 static PDL_Indx pdl_bswap12_vtable_realdims_ind_ids[] = { 0 };
318 static char *pdl_bswap12_vtable_indnames[] = { "" };
319 pdl_transvtable pdl_bswap12_vtable = {
320 PDL_TRANS_DO_BROADCAST, 0, pdl_bswap12_vtable_gentypes, 0, 1, NULL /*CORE21*/,
321 pdl_bswap12_vtable_realdims, pdl_bswap12_vtable_parnames,
322 pdl_bswap12_vtable_parflags, pdl_bswap12_vtable_partypes,
323 pdl_bswap12_vtable_realdims_starts, pdl_bswap12_vtable_realdims_ind_ids, 0,
324 0, pdl_bswap12_vtable_indnames,
325 pdl_bswap12_redodims, pdl_bswap12_readdata, NULL,
326 NULL,
327 0,"PDL::IO::Misc::bswap12"
328 };
329  
330  
331 0 pdl_error pdl_run_bswap12(pdl *x) {
332 0 pdl_error PDL_err = {0, NULL, 0};
333 0 ▶ 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 0 0
334 0 pdl_trans *__privtrans = PDL->create_trans(&pdl_bswap12_vtable);
335 0 ▶ 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 0 0
336 0 __privtrans->pdls[0] = x;
337 0 ▶ PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); 0 0 0
338 0 ▶ PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
Branch: 1 branch
BranchTrueFalseTotal
PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); 0 0 0
339 0 return PDL_err;
340 }
« blib/lib/PDL/LiteF.pm ↑ Summary lib/PDL/IO/Misc-pp-bswap16.c »