File Coverage

pp-plpoly3.c
Criterion Covered Total %
statement 35 36 97.2
branch 32 60 53.3
condition n/a
subroutine n/a
pod n/a
total 67 96 69.7


line stmt bran cond sub pod time code
1              
2             #line 453 "lib/PDL/PP.pm"
3             /*
4             * THIS FILE WAS GENERATED BY PDL::PP from plplot.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_Graphics_PLplot
21             extern Core* PDL; /* Structure hold core C functions */
22             #line 23 "pp-plpoly3.c"
23             #include
24             #include
25             #include
26             #include
27              
28             #ifndef PDL /* this is needed for PDL pre-2.058 */
29             #define PDL PDL_Graphics_PLplot
30             Core* PDL = NULL; PDL_COMMENT("Structure hold core C functions")
31             #endif
32              
33             #define PLPTR_DEFINE(t) typedef t *t ## Ptr; typedef t *t ## Ptr__OUT;
34             PLPTR_DEFINE(PLcGrid)
35             PLPTR_DEFINE(PLcGrid2)
36             #define PLPTR_RECEIVE_IN(t, v, v_in) t *v = (t *)v_in;
37             #define PLPTR_RECEIVE_SV(v) ((PLPointer) (SvROK(v) ? SvIV((SV*)SvRV(v)) : (IV)NULL))
38              
39             #line 1857 "lib/PDL/PP.pm"
40             pdl_error pdl_plpoly3_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plpoly3.c"
43 1600 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plpoly3:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 1600           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 1600           register PDL_Indx __tinc0_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 1600           register PDL_Indx __tinc0_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 1600           register PDL_Indx __tinc0_z = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 1600           register PDL_Indx __tinc0_draw = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 1600           register PDL_Indx __tinc0_ifcc = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0);
54 1600           register PDL_Indx __tinc1_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
55 1600           register PDL_Indx __tinc1_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
56 1600           register PDL_Indx __tinc1_z = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
57 1600           register PDL_Indx __tinc1_draw = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
58 1600           register PDL_Indx __tinc1_ifcc = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1);
59             #define PDL_BROADCASTLOOP_START_plpoly3_readdata PDL_BROADCASTLOOP_START( \
60             readdata, \
61             __privtrans->broadcast, \
62             __privtrans->vtable, \
63             x_datap += __offsp[0]; \
64             y_datap += __offsp[1]; \
65             z_datap += __offsp[2]; \
66             draw_datap += __offsp[3]; \
67             ifcc_datap += __offsp[4]; \
68             , \
69             ( ,x_datap += __tinc1_x - __tinc0_x * __tdims0 \
70             ,y_datap += __tinc1_y - __tinc0_y * __tdims0 \
71             ,z_datap += __tinc1_z - __tinc0_z * __tdims0 \
72             ,draw_datap += __tinc1_draw - __tinc0_draw * __tdims0 \
73             ,ifcc_datap += __tinc1_ifcc - __tinc0_ifcc * __tdims0 \
74             ), \
75             ( ,x_datap += __tinc0_x \
76             ,y_datap += __tinc0_y \
77             ,z_datap += __tinc0_z \
78             ,draw_datap += __tinc0_draw \
79             ,ifcc_datap += __tinc0_ifcc \
80             ) \
81             )
82             #define PDL_BROADCASTLOOP_END_plpoly3_readdata PDL_BROADCASTLOOP_END( \
83             __privtrans->broadcast, \
84             x_datap -= __tinc1_x * __tdims1 + __offsp[0]; \
85             y_datap -= __tinc1_y * __tdims1 + __offsp[1]; \
86             z_datap -= __tinc1_z * __tdims1 + __offsp[2]; \
87             draw_datap -= __tinc1_draw * __tdims1 + __offsp[3]; \
88             ifcc_datap -= __tinc1_ifcc * __tdims1 + __offsp[4]; \
89             )
90 1600           register PDL_Indx __inc_draw_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_draw_m;
91 1600           register PDL_Indx __inc_x_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_x_n;
92 1600           register PDL_Indx __inc_y_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_y_n;
93 1600           register PDL_Indx __inc_z_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_z_n;
94             #ifndef PDL_DECLARE_PARAMS_plpoly3_1
95             #define PDL_DECLARE_PARAMS_plpoly3_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_draw,PDL_PPSYM_PARAM_draw,PDL_TYPE_PARAM_ifcc,PDL_PPSYM_PARAM_ifcc) \
96             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, x, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \
97             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, y, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \
98             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, z, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP) \
99             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_draw, draw, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_draw) \
100             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_ifcc, ifcc, (__privtrans->pdls[4]), 1, PDL_PPSYM_PARAM_ifcc)
101             #endif
102             #define PDL_IF_BAD(t,f) f
103 1600 50         switch (__privtrans->__datatype) { /* Start generic switch */
104 1600           case PDL_D: {
105 1600 50         PDL_DECLARE_PARAMS_plpoly3_1(PDL_Double,D,PDL_Long,L,PDL_Long,L)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
106 6400 50         PDL_BROADCASTLOOP_START_plpoly3_readdata {c_plpoly3(__privtrans->ind_sizes[1],x_datap,y_datap,z_datap,draw_datap,(ifcc_datap)[0]);}PDL_BROADCASTLOOP_END_plpoly3_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
107 1600           } break;
108 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plpoly3: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
109             }
110             #undef PDL_IF_BAD
111 1600           return PDL_err;
112             }
113              
114             static pdl_datatypes pdl_plpoly3_vtable_gentypes[] = { PDL_D, -1 };
115             static PDL_Indx pdl_plpoly3_vtable_realdims[] = { 1, 1, 1, 1, 0 };
116             static char *pdl_plpoly3_vtable_parnames[] = { "x","y","z","draw","ifcc" };
117             static short pdl_plpoly3_vtable_parflags[] = {
118             PDL_PARAM_ISPHYS,
119             PDL_PARAM_ISPHYS,
120             PDL_PARAM_ISPHYS,
121             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED,
122             PDL_PARAM_ISTYPED
123             };
124             static pdl_datatypes pdl_plpoly3_vtable_partypes[] = { -1, -1, -1, PDL_L, PDL_L };
125             static PDL_Indx pdl_plpoly3_vtable_realdims_starts[] = { 0, 1, 2, 3, 4 };
126             static PDL_Indx pdl_plpoly3_vtable_realdims_ind_ids[] = { 1, 1, 1, 0 };
127             static char *pdl_plpoly3_vtable_indnames[] = { "m","n" };
128             pdl_transvtable pdl_plpoly3_vtable = {
129             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plpoly3_vtable_gentypes, 5, 5, NULL /*CORE21*/,
130             pdl_plpoly3_vtable_realdims, pdl_plpoly3_vtable_parnames,
131             pdl_plpoly3_vtable_parflags, pdl_plpoly3_vtable_partypes,
132             pdl_plpoly3_vtable_realdims_starts, pdl_plpoly3_vtable_realdims_ind_ids, 4,
133             2, pdl_plpoly3_vtable_indnames,
134             NULL, pdl_plpoly3_readdata, NULL,
135             NULL,
136             0,"PDL::Graphics::PLplot::plpoly3"
137             };
138              
139              
140 1600           pdl_error pdl_run_plpoly3(pdl *x,pdl *y,pdl *z,pdl *draw,pdl *ifcc) {
141 1600           pdl_error PDL_err = {0, NULL, 0};
142 1600 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
143 1600           pdl_trans *__privtrans = PDL->create_trans(&pdl_plpoly3_vtable);
144 1600 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
145 1600           __privtrans->pdls[0] = x;
146 1600           __privtrans->pdls[1] = y;
147 1600           __privtrans->pdls[2] = z;
148 1600           __privtrans->pdls[3] = draw;
149 1600           __privtrans->pdls[4] = ifcc;
150 1600 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
151 1600 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
152 1600           return PDL_err;
153             }