// author: Michele Martone // description: (still incomplete) debug / sentinel code patch #include "tests/gadget_match.cocci" // usable prtcl_str_mmbrs_scalars rule from make_ptr, but slow :-( @prtcl_str_mmbrs_scalars@ identifier prtcl_str.id; identifier M; identifier P; typedef MyDouble; typedef MyFloat; typedef MyLongDouble; typedef MyDoublePos; typedef MyBigFloat; type MT = { double,float,MyDouble,MyFloat,MyLongDouble,MyDoublePos,MyBigFloat }; @@ // identify structure+pointer definitions of specified types struct id { ... MT M; ... } *P; @checksum_per_type_soa_functions@ identifier new_prtcl_str_id.id1; fresh identifier soa_checksum_fid="soa_checksum__"##id1; @@ ++ long double soa_checksum_fid(const struct id1*P_soa, size_t first, size_t N) ++ { ++ size_t i; ++ long double cksumval = 0; ++ if(P_soa==NULL) return cksumval; //happens. e.g. in runs with gravity only SphP does not exist ++ for(i=first;iM[i]; ++#endif } ... } @checksum_per_type_aos_functions@ identifier prtcl_str.id; fresh identifier aos_checksum_fid="aos_checksum__"##id; @@ ++ long double aos_checksum_fid(const struct id*P_aos, size_t first, size_t N) ++ { ++ size_t i; ++ long double cksumval = 0; ++ if(P_aos==NULL) return cksumval; //happens. e.g. in runs with gravity only SphP does not exist ++ for(i=first;i