File Coverage

pp-plsori.c
Criterion Covered Total %
statement 19 20 95.0
branch 20 36 55.5
condition n/a
subroutine n/a
pod n/a
total 39 56 69.6


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-plsori.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_plsori_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plsori.c"
43 1 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plsori:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 1           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 1           register PDL_Indx __tinc0_ori = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 1           register PDL_Indx __tinc1_ori = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
51             #define PDL_BROADCASTLOOP_START_plsori_readdata PDL_BROADCASTLOOP_START( \
52             readdata, \
53             __privtrans->broadcast, \
54             __privtrans->vtable, \
55             ori_datap += __offsp[0]; \
56             , \
57             ( ,ori_datap += __tinc1_ori - __tinc0_ori * __tdims0 \
58             ), \
59             ( ,ori_datap += __tinc0_ori \
60             ) \
61             )
62             #define PDL_BROADCASTLOOP_END_plsori_readdata PDL_BROADCASTLOOP_END( \
63             __privtrans->broadcast, \
64             ori_datap -= __tinc1_ori * __tdims1 + __offsp[0]; \
65             )
66             #ifndef PDL_DECLARE_PARAMS_plsori_1
67             #define PDL_DECLARE_PARAMS_plsori_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_ori,PDL_PPSYM_PARAM_ori) \
68             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_ori, ori, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_ori)
69             #endif
70             #define PDL_IF_BAD(t,f) f
71 1 50         switch (__privtrans->__datatype) { /* Start generic switch */
72 1           case PDL_D: {
73 1 50         PDL_DECLARE_PARAMS_plsori_1(PDL_Double,D,PDL_Long,L)
    50          
    50          
74 4 50         PDL_BROADCASTLOOP_START_plsori_readdata {c_plsori((ori_datap)[0]);}PDL_BROADCASTLOOP_END_plsori_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
75 1           } break;
76 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plsori: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
77             }
78             #undef PDL_IF_BAD
79 1           return PDL_err;
80             }
81              
82             static pdl_datatypes pdl_plsori_vtable_gentypes[] = { PDL_D, -1 };
83             static PDL_Indx pdl_plsori_vtable_realdims[] = { 0 };
84             static char *pdl_plsori_vtable_parnames[] = { "ori" };
85             static short pdl_plsori_vtable_parflags[] = {
86             PDL_PARAM_ISTYPED
87             };
88             static pdl_datatypes pdl_plsori_vtable_partypes[] = { PDL_L };
89             static PDL_Indx pdl_plsori_vtable_realdims_starts[] = { 0 };
90             static PDL_Indx pdl_plsori_vtable_realdims_ind_ids[] = { 0 };
91             static char *pdl_plsori_vtable_indnames[] = { "" };
92             pdl_transvtable pdl_plsori_vtable = {
93             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plsori_vtable_gentypes, 1, 1, NULL /*CORE21*/,
94             pdl_plsori_vtable_realdims, pdl_plsori_vtable_parnames,
95             pdl_plsori_vtable_parflags, pdl_plsori_vtable_partypes,
96             pdl_plsori_vtable_realdims_starts, pdl_plsori_vtable_realdims_ind_ids, 0,
97             0, pdl_plsori_vtable_indnames,
98             NULL, pdl_plsori_readdata, NULL,
99             NULL,
100             0,"PDL::Graphics::PLplot::plsori"
101             };
102              
103              
104 1           pdl_error pdl_run_plsori(pdl *ori) {
105 1           pdl_error PDL_err = {0, NULL, 0};
106 1 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
107 1           pdl_trans *__privtrans = PDL->create_trans(&pdl_plsori_vtable);
108 1 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
109 1           __privtrans->pdls[0] = ori;
110 1 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
111 1 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
112 1           return PDL_err;
113             }