File Coverage

pp-plfill3.c
Criterion Covered Total %
statement 31 32 96.8
branch 29 54 53.7
condition n/a
subroutine n/a
pod n/a
total 60 86 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-plfill3.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_plfill3_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plfill3.c"
43 2 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plfill3:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 2           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 2           register PDL_Indx __tinc0_n = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 2           register PDL_Indx __tinc0_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 2           register PDL_Indx __tinc0_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 2           register PDL_Indx __tinc0_z = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 2           register PDL_Indx __tinc1_n = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
54 2           register PDL_Indx __tinc1_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
55 2           register PDL_Indx __tinc1_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
56 2           register PDL_Indx __tinc1_z = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
57             #define PDL_BROADCASTLOOP_START_plfill3_readdata PDL_BROADCASTLOOP_START( \
58             readdata, \
59             __privtrans->broadcast, \
60             __privtrans->vtable, \
61             n_datap += __offsp[0]; \
62             x_datap += __offsp[1]; \
63             y_datap += __offsp[2]; \
64             z_datap += __offsp[3]; \
65             , \
66             ( ,n_datap += __tinc1_n - __tinc0_n * __tdims0 \
67             ,x_datap += __tinc1_x - __tinc0_x * __tdims0 \
68             ,y_datap += __tinc1_y - __tinc0_y * __tdims0 \
69             ,z_datap += __tinc1_z - __tinc0_z * __tdims0 \
70             ), \
71             ( ,n_datap += __tinc0_n \
72             ,x_datap += __tinc0_x \
73             ,y_datap += __tinc0_y \
74             ,z_datap += __tinc0_z \
75             ) \
76             )
77             #define PDL_BROADCASTLOOP_END_plfill3_readdata PDL_BROADCASTLOOP_END( \
78             __privtrans->broadcast, \
79             n_datap -= __tinc1_n * __tdims1 + __offsp[0]; \
80             x_datap -= __tinc1_x * __tdims1 + __offsp[1]; \
81             y_datap -= __tinc1_y * __tdims1 + __offsp[2]; \
82             z_datap -= __tinc1_z * __tdims1 + __offsp[3]; \
83             )
84 2           register PDL_Indx __inc_x_dima = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_x_dima;
85 2           register PDL_Indx __inc_y_dima = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_y_dima;
86 2           register PDL_Indx __inc_z_dima = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_z_dima;
87             #ifndef PDL_DECLARE_PARAMS_plfill3_1
88             #define PDL_DECLARE_PARAMS_plfill3_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_n,PDL_PPSYM_PARAM_n,PDL_TYPE_PARAM_x,PDL_PPSYM_PARAM_x,PDL_TYPE_PARAM_y,PDL_PPSYM_PARAM_y,PDL_TYPE_PARAM_z,PDL_PPSYM_PARAM_z) \
89             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_n, n, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_n) \
90             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_x, x, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_x) \
91             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_y, y, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_y) \
92             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_z, z, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_z)
93             #endif
94             #define PDL_IF_BAD(t,f) f
95 2 50         switch (__privtrans->__datatype) { /* Start generic switch */
96 2           case PDL_D: {
97 2 50         PDL_DECLARE_PARAMS_plfill3_1(PDL_Double,D,PDL_Long,L,PDL_Double,D,PDL_Double,D,PDL_Double,D)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
98 8 50         PDL_BROADCASTLOOP_START_plfill3_readdata {c_plfill3((n_datap)[0],x_datap,y_datap,z_datap);}PDL_BROADCASTLOOP_END_plfill3_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
99 2           } break;
100 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plfill3: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
101             }
102             #undef PDL_IF_BAD
103 2           return PDL_err;
104             }
105              
106             static pdl_datatypes pdl_plfill3_vtable_gentypes[] = { PDL_D, -1 };
107             static PDL_Indx pdl_plfill3_vtable_realdims[] = { 0, 1, 1, 1 };
108             static char *pdl_plfill3_vtable_parnames[] = { "n","x","y","z" };
109             static short pdl_plfill3_vtable_parflags[] = {
110             PDL_PARAM_ISTYPED,
111             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED,
112             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED,
113             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED
114             };
115             static pdl_datatypes pdl_plfill3_vtable_partypes[] = { PDL_L, PDL_D, PDL_D, PDL_D };
116             static PDL_Indx pdl_plfill3_vtable_realdims_starts[] = { 0, 0, 1, 2 };
117             static PDL_Indx pdl_plfill3_vtable_realdims_ind_ids[] = { 0, 0, 0 };
118             static char *pdl_plfill3_vtable_indnames[] = { "dima" };
119             pdl_transvtable pdl_plfill3_vtable = {
120             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plfill3_vtable_gentypes, 4, 4, NULL /*CORE21*/,
121             pdl_plfill3_vtable_realdims, pdl_plfill3_vtable_parnames,
122             pdl_plfill3_vtable_parflags, pdl_plfill3_vtable_partypes,
123             pdl_plfill3_vtable_realdims_starts, pdl_plfill3_vtable_realdims_ind_ids, 3,
124             1, pdl_plfill3_vtable_indnames,
125             NULL, pdl_plfill3_readdata, NULL,
126             NULL,
127             0,"PDL::Graphics::PLplot::plfill3"
128             };
129              
130              
131 2           pdl_error pdl_run_plfill3(pdl *n,pdl *x,pdl *y,pdl *z) {
132 2           pdl_error PDL_err = {0, NULL, 0};
133 2 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
134 2           pdl_trans *__privtrans = PDL->create_trans(&pdl_plfill3_vtable);
135 2 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
136 2           __privtrans->pdls[0] = n;
137 2           __privtrans->pdls[1] = x;
138 2           __privtrans->pdls[2] = y;
139 2           __privtrans->pdls[3] = z;
140 2 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
141 2 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
142 2           return PDL_err;
143             }