/src/postgis/liblwgeom/lwinline.h
Line | Count | Source |
1 | | /********************************************************************** |
2 | | * |
3 | | * PostGIS - Spatial Types for PostgreSQL |
4 | | * http://postgis.net |
5 | | * |
6 | | * PostGIS is free software: you can redistribute it and/or modify |
7 | | * it under the terms of the GNU General Public License as published by |
8 | | * the Free Software Foundation, either version 2 of the License, or |
9 | | * (at your option) any later version. |
10 | | * |
11 | | * PostGIS is distributed in the hope that it will be useful, |
12 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | * GNU General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU General Public License |
17 | | * along with PostGIS. If not, see <http://www.gnu.org/licenses/>. |
18 | | * |
19 | | ********************************************************************** |
20 | | * |
21 | | * Copyright 2018 Darafei Praliaskouski <me@komzpa.net> |
22 | | * Copyright 2017-2018 Daniel Baston <dbaston@gmail.com> |
23 | | * Copyright 2011 Sandro Santilli <strk@kbt.io> |
24 | | * Copyright 2011 Paul Ramsey <pramsey@cleverelephant.ca> |
25 | | * Copyright 2007-2008 Mark Cave-Ayland |
26 | | * Copyright 2001-2006 Refractions Research Inc. |
27 | | * |
28 | | **********************************************************************/ |
29 | | |
30 | | #include <assert.h> |
31 | | |
32 | | inline static double |
33 | | distance2d_sqr_pt_pt(const POINT2D *p1, const POINT2D *p2) |
34 | 0 | { |
35 | 0 | double hside = p2->x - p1->x; |
36 | 0 | double vside = p2->y - p1->y; |
37 | |
|
38 | 0 | return hside * hside + vside * vside; |
39 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:distance2d_sqr_pt_pt(POINT2D const*, POINT2D const*) Unexecuted instantiation: lwgeom.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwpoint.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwline.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwpoly.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwtriangle.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwmpoint.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwmline.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwmpoly.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwcollection.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwcircstring.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwcompound.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwcurvepoly.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwpsurface.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwtin.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwin_geojson.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwiterator.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwout_wkt.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwutil.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwhomogenize.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwalgorithm.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwstroke.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwprint.c:distance2d_sqr_pt_pt Unexecuted instantiation: gbox.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwgeodetic.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos_node.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos_split.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwnurbscurve.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwspheroid.c:distance2d_sqr_pt_pt Unexecuted instantiation: stringbuffer.c:distance2d_sqr_pt_pt Unexecuted instantiation: measures.c:distance2d_sqr_pt_pt Unexecuted instantiation: measures3d.c:distance2d_sqr_pt_pt Unexecuted instantiation: ptarray.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwgeom_api.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwout_wkb.c:distance2d_sqr_pt_pt Unexecuted instantiation: lwlinearreferencing.c:distance2d_sqr_pt_pt |
40 | | |
41 | | inline static double |
42 | | distance3d_sqr_pt_pt(const POINT3D *p1, const POINT3D *p2) |
43 | 0 | { |
44 | 0 | double hside = p2->x - p1->x; |
45 | 0 | double vside = p2->y - p1->y; |
46 | 0 | double zside = p2->z - p1->z; |
47 | 0 |
|
48 | 0 | return hside * hside + vside * vside + zside * zside; |
49 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:distance3d_sqr_pt_pt(POINT3D const*, POINT3D const*) Unexecuted instantiation: lwgeom.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwpoint.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwline.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwpoly.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwtriangle.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwmpoint.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwmline.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwmpoly.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwcollection.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwcircstring.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwcompound.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwcurvepoly.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwpsurface.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwtin.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwin_geojson.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwiterator.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwout_wkt.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwutil.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwhomogenize.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwalgorithm.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwstroke.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwprint.c:distance3d_sqr_pt_pt Unexecuted instantiation: gbox.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwgeodetic.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos_node.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwgeom_geos_split.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwnurbscurve.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwspheroid.c:distance3d_sqr_pt_pt Unexecuted instantiation: stringbuffer.c:distance3d_sqr_pt_pt Unexecuted instantiation: measures.c:distance3d_sqr_pt_pt Unexecuted instantiation: measures3d.c:distance3d_sqr_pt_pt Unexecuted instantiation: ptarray.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwgeom_api.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwout_wkb.c:distance3d_sqr_pt_pt Unexecuted instantiation: lwlinearreferencing.c:distance3d_sqr_pt_pt |
50 | | |
51 | | /* |
52 | | * Size of point represeneted in the POINTARRAY |
53 | | * 16 for 2d, 24 for 3d, 32 for 4d |
54 | | */ |
55 | | static inline size_t |
56 | | ptarray_point_size(const POINTARRAY *pa) |
57 | 1.47M | { |
58 | 1.47M | return sizeof(double) * FLAGS_NDIMS(pa->flags); |
59 | 1.47M | } Unexecuted instantiation: geojson_import_fuzzer.cpp:ptarray_point_size(POINTARRAY const*) Unexecuted instantiation: lwgeom.c:ptarray_point_size Unexecuted instantiation: lwpoint.c:ptarray_point_size Unexecuted instantiation: lwline.c:ptarray_point_size Unexecuted instantiation: lwpoly.c:ptarray_point_size Unexecuted instantiation: lwtriangle.c:ptarray_point_size Unexecuted instantiation: lwmpoint.c:ptarray_point_size Unexecuted instantiation: lwmline.c:ptarray_point_size Unexecuted instantiation: lwmpoly.c:ptarray_point_size Unexecuted instantiation: lwcollection.c:ptarray_point_size Unexecuted instantiation: lwcircstring.c:ptarray_point_size Unexecuted instantiation: lwcompound.c:ptarray_point_size Unexecuted instantiation: lwcurvepoly.c:ptarray_point_size Unexecuted instantiation: lwpsurface.c:ptarray_point_size Unexecuted instantiation: lwtin.c:ptarray_point_size Unexecuted instantiation: lwin_geojson.c:ptarray_point_size Unexecuted instantiation: lwiterator.c:ptarray_point_size Unexecuted instantiation: lwout_wkt.c:ptarray_point_size Unexecuted instantiation: lwutil.c:ptarray_point_size Unexecuted instantiation: lwhomogenize.c:ptarray_point_size Unexecuted instantiation: lwalgorithm.c:ptarray_point_size Unexecuted instantiation: lwstroke.c:ptarray_point_size Unexecuted instantiation: lwprint.c:ptarray_point_size gbox.c:ptarray_point_size Line | Count | Source | 57 | 171k | { | 58 | 171k | return sizeof(double) * FLAGS_NDIMS(pa->flags); | 59 | 171k | } |
Unexecuted instantiation: lwgeodetic.c:ptarray_point_size Unexecuted instantiation: lwgeom_geos.c:ptarray_point_size Unexecuted instantiation: lwgeom_geos_node.c:ptarray_point_size Unexecuted instantiation: lwgeom_geos_split.c:ptarray_point_size Unexecuted instantiation: lwnurbscurve.c:ptarray_point_size Unexecuted instantiation: lwspheroid.c:ptarray_point_size Unexecuted instantiation: stringbuffer.c:ptarray_point_size Unexecuted instantiation: measures.c:ptarray_point_size Unexecuted instantiation: measures3d.c:ptarray_point_size ptarray.c:ptarray_point_size Line | Count | Source | 57 | 855k | { | 58 | 855k | return sizeof(double) * FLAGS_NDIMS(pa->flags); | 59 | 855k | } |
lwgeom_api.c:ptarray_point_size Line | Count | Source | 57 | 444k | { | 58 | 444k | return sizeof(double) * FLAGS_NDIMS(pa->flags); | 59 | 444k | } |
Unexecuted instantiation: lwout_wkb.c:ptarray_point_size Unexecuted instantiation: lwlinearreferencing.c:ptarray_point_size |
60 | | |
61 | | /* |
62 | | * Get a pointer to Nth point of a POINTARRAY |
63 | | * You'll need to cast it to appropriate dimensioned point. |
64 | | * Note that if you cast to a higher dimensional point you'll |
65 | | * possibly corrupt the POINTARRAY. |
66 | | * |
67 | | * Casting to returned pointer to POINT2D* should be safe, |
68 | | * as gserialized format always keeps the POINTARRAY pointer |
69 | | * aligned to double boundary. |
70 | | * |
71 | | * WARNING: Don't cast this to a POINT! |
72 | | * it would not be reliable due to memory alignment constraints |
73 | | */ |
74 | | static inline uint8_t * |
75 | | getPoint_internal(const POINTARRAY *pa, uint32_t n) |
76 | 615k | { |
77 | 615k | size_t size; |
78 | 615k | uint8_t *ptr; |
79 | | |
80 | 615k | assert(pa); |
81 | 615k | assert(n <= pa->npoints); |
82 | 615k | assert(n <= pa->maxpoints); |
83 | | |
84 | 615k | size = ptarray_point_size(pa); |
85 | 615k | ptr = pa->serialized_pointlist + size * n; |
86 | | |
87 | 615k | return ptr; |
88 | 615k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:getPoint_internal(POINTARRAY const*, unsigned int) Unexecuted instantiation: lwgeom.c:getPoint_internal Unexecuted instantiation: lwpoint.c:getPoint_internal Unexecuted instantiation: lwline.c:getPoint_internal Unexecuted instantiation: lwpoly.c:getPoint_internal Unexecuted instantiation: lwtriangle.c:getPoint_internal Unexecuted instantiation: lwmpoint.c:getPoint_internal Unexecuted instantiation: lwmline.c:getPoint_internal Unexecuted instantiation: lwmpoly.c:getPoint_internal Unexecuted instantiation: lwcollection.c:getPoint_internal Unexecuted instantiation: lwcircstring.c:getPoint_internal Unexecuted instantiation: lwcompound.c:getPoint_internal Unexecuted instantiation: lwcurvepoly.c:getPoint_internal Unexecuted instantiation: lwpsurface.c:getPoint_internal Unexecuted instantiation: lwtin.c:getPoint_internal Unexecuted instantiation: lwin_geojson.c:getPoint_internal Unexecuted instantiation: lwiterator.c:getPoint_internal Unexecuted instantiation: lwout_wkt.c:getPoint_internal Unexecuted instantiation: lwutil.c:getPoint_internal Unexecuted instantiation: lwhomogenize.c:getPoint_internal Unexecuted instantiation: lwalgorithm.c:getPoint_internal Unexecuted instantiation: lwstroke.c:getPoint_internal Unexecuted instantiation: lwprint.c:getPoint_internal Line | Count | Source | 76 | 171k | { | 77 | 171k | size_t size; | 78 | 171k | uint8_t *ptr; | 79 | | | 80 | 171k | assert(pa); | 81 | 171k | assert(n <= pa->npoints); | 82 | 171k | assert(n <= pa->maxpoints); | 83 | | | 84 | 171k | size = ptarray_point_size(pa); | 85 | 171k | ptr = pa->serialized_pointlist + size * n; | 86 | | | 87 | 171k | return ptr; | 88 | 171k | } |
Unexecuted instantiation: lwgeodetic.c:getPoint_internal Unexecuted instantiation: lwgeom_geos.c:getPoint_internal Unexecuted instantiation: lwgeom_geos_node.c:getPoint_internal Unexecuted instantiation: lwgeom_geos_split.c:getPoint_internal Unexecuted instantiation: lwnurbscurve.c:getPoint_internal Unexecuted instantiation: lwspheroid.c:getPoint_internal Unexecuted instantiation: stringbuffer.c:getPoint_internal Unexecuted instantiation: measures.c:getPoint_internal Unexecuted instantiation: measures3d.c:getPoint_internal Unexecuted instantiation: ptarray.c:getPoint_internal lwgeom_api.c:getPoint_internal Line | Count | Source | 76 | 444k | { | 77 | 444k | size_t size; | 78 | 444k | uint8_t *ptr; | 79 | | | 80 | 444k | assert(pa); | 81 | 444k | assert(n <= pa->npoints); | 82 | 444k | assert(n <= pa->maxpoints); | 83 | | | 84 | 444k | size = ptarray_point_size(pa); | 85 | 444k | ptr = pa->serialized_pointlist + size * n; | 86 | | | 87 | 444k | return ptr; | 88 | 444k | } |
Unexecuted instantiation: lwout_wkb.c:getPoint_internal Unexecuted instantiation: lwlinearreferencing.c:getPoint_internal |
89 | | |
90 | | /** |
91 | | * Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, |
92 | | * suitable for reading from. This is very high performance |
93 | | * and declared const because you aren't allowed to muck with the |
94 | | * values, only read them. |
95 | | */ |
96 | | static inline const POINT2D * |
97 | | getPoint2d_cp(const POINTARRAY *pa, uint32_t n) |
98 | 136k | { |
99 | 136k | return (const POINT2D *)getPoint_internal(pa, n); |
100 | 136k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:getPoint2d_cp(POINTARRAY const*, unsigned int) Unexecuted instantiation: lwgeom.c:getPoint2d_cp Unexecuted instantiation: lwpoint.c:getPoint2d_cp Unexecuted instantiation: lwline.c:getPoint2d_cp Unexecuted instantiation: lwpoly.c:getPoint2d_cp Unexecuted instantiation: lwtriangle.c:getPoint2d_cp Unexecuted instantiation: lwmpoint.c:getPoint2d_cp Unexecuted instantiation: lwmline.c:getPoint2d_cp Unexecuted instantiation: lwmpoly.c:getPoint2d_cp Unexecuted instantiation: lwcollection.c:getPoint2d_cp Unexecuted instantiation: lwcircstring.c:getPoint2d_cp Unexecuted instantiation: lwcompound.c:getPoint2d_cp Unexecuted instantiation: lwcurvepoly.c:getPoint2d_cp Unexecuted instantiation: lwpsurface.c:getPoint2d_cp Unexecuted instantiation: lwtin.c:getPoint2d_cp Unexecuted instantiation: lwin_geojson.c:getPoint2d_cp Unexecuted instantiation: lwiterator.c:getPoint2d_cp Unexecuted instantiation: lwout_wkt.c:getPoint2d_cp Unexecuted instantiation: lwutil.c:getPoint2d_cp Unexecuted instantiation: lwhomogenize.c:getPoint2d_cp Unexecuted instantiation: lwalgorithm.c:getPoint2d_cp Unexecuted instantiation: lwstroke.c:getPoint2d_cp Unexecuted instantiation: lwprint.c:getPoint2d_cp Line | Count | Source | 98 | 136k | { | 99 | 136k | return (const POINT2D *)getPoint_internal(pa, n); | 100 | 136k | } |
Unexecuted instantiation: lwgeodetic.c:getPoint2d_cp Unexecuted instantiation: lwgeom_geos.c:getPoint2d_cp Unexecuted instantiation: lwgeom_geos_node.c:getPoint2d_cp Unexecuted instantiation: lwgeom_geos_split.c:getPoint2d_cp Unexecuted instantiation: lwnurbscurve.c:getPoint2d_cp Unexecuted instantiation: lwspheroid.c:getPoint2d_cp Unexecuted instantiation: stringbuffer.c:getPoint2d_cp Unexecuted instantiation: measures.c:getPoint2d_cp Unexecuted instantiation: measures3d.c:getPoint2d_cp Unexecuted instantiation: ptarray.c:getPoint2d_cp Unexecuted instantiation: lwgeom_api.c:getPoint2d_cp Unexecuted instantiation: lwout_wkb.c:getPoint2d_cp Unexecuted instantiation: lwlinearreferencing.c:getPoint2d_cp |
101 | | |
102 | | /** |
103 | | * Returns a POINT3D pointer into the POINTARRAY serialized_ptlist, |
104 | | * suitable for reading from. This is very high performance |
105 | | * and declared const because you aren't allowed to muck with the |
106 | | * values, only read them. |
107 | | */ |
108 | | static inline const POINT3D * |
109 | | getPoint3d_cp(const POINTARRAY *pa, uint32_t n) |
110 | 35.5k | { |
111 | 35.5k | return (const POINT3D *)getPoint_internal(pa, n); |
112 | 35.5k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:getPoint3d_cp(POINTARRAY const*, unsigned int) Unexecuted instantiation: lwgeom.c:getPoint3d_cp Unexecuted instantiation: lwpoint.c:getPoint3d_cp Unexecuted instantiation: lwline.c:getPoint3d_cp Unexecuted instantiation: lwpoly.c:getPoint3d_cp Unexecuted instantiation: lwtriangle.c:getPoint3d_cp Unexecuted instantiation: lwmpoint.c:getPoint3d_cp Unexecuted instantiation: lwmline.c:getPoint3d_cp Unexecuted instantiation: lwmpoly.c:getPoint3d_cp Unexecuted instantiation: lwcollection.c:getPoint3d_cp Unexecuted instantiation: lwcircstring.c:getPoint3d_cp Unexecuted instantiation: lwcompound.c:getPoint3d_cp Unexecuted instantiation: lwcurvepoly.c:getPoint3d_cp Unexecuted instantiation: lwpsurface.c:getPoint3d_cp Unexecuted instantiation: lwtin.c:getPoint3d_cp Unexecuted instantiation: lwin_geojson.c:getPoint3d_cp Unexecuted instantiation: lwiterator.c:getPoint3d_cp Unexecuted instantiation: lwout_wkt.c:getPoint3d_cp Unexecuted instantiation: lwutil.c:getPoint3d_cp Unexecuted instantiation: lwhomogenize.c:getPoint3d_cp Unexecuted instantiation: lwalgorithm.c:getPoint3d_cp Unexecuted instantiation: lwstroke.c:getPoint3d_cp Unexecuted instantiation: lwprint.c:getPoint3d_cp Line | Count | Source | 110 | 35.5k | { | 111 | 35.5k | return (const POINT3D *)getPoint_internal(pa, n); | 112 | 35.5k | } |
Unexecuted instantiation: lwgeodetic.c:getPoint3d_cp Unexecuted instantiation: lwgeom_geos.c:getPoint3d_cp Unexecuted instantiation: lwgeom_geos_node.c:getPoint3d_cp Unexecuted instantiation: lwgeom_geos_split.c:getPoint3d_cp Unexecuted instantiation: lwnurbscurve.c:getPoint3d_cp Unexecuted instantiation: lwspheroid.c:getPoint3d_cp Unexecuted instantiation: stringbuffer.c:getPoint3d_cp Unexecuted instantiation: measures.c:getPoint3d_cp Unexecuted instantiation: measures3d.c:getPoint3d_cp Unexecuted instantiation: ptarray.c:getPoint3d_cp Unexecuted instantiation: lwgeom_api.c:getPoint3d_cp Unexecuted instantiation: lwout_wkb.c:getPoint3d_cp Unexecuted instantiation: lwlinearreferencing.c:getPoint3d_cp |
113 | | |
114 | | /** |
115 | | * Returns a POINT4D pointer into the POINTARRAY serialized_ptlist, |
116 | | * suitable for reading from. This is very high performance |
117 | | * and declared const because you aren't allowed to muck with the |
118 | | * values, only read them. |
119 | | */ |
120 | | static inline const POINT4D * |
121 | | getPoint4d_cp(const POINTARRAY *pa, uint32_t n) |
122 | 0 | { |
123 | 0 | return (const POINT4D *)getPoint_internal(pa, n); |
124 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:getPoint4d_cp(POINTARRAY const*, unsigned int) Unexecuted instantiation: lwgeom.c:getPoint4d_cp Unexecuted instantiation: lwpoint.c:getPoint4d_cp Unexecuted instantiation: lwline.c:getPoint4d_cp Unexecuted instantiation: lwpoly.c:getPoint4d_cp Unexecuted instantiation: lwtriangle.c:getPoint4d_cp Unexecuted instantiation: lwmpoint.c:getPoint4d_cp Unexecuted instantiation: lwmline.c:getPoint4d_cp Unexecuted instantiation: lwmpoly.c:getPoint4d_cp Unexecuted instantiation: lwcollection.c:getPoint4d_cp Unexecuted instantiation: lwcircstring.c:getPoint4d_cp Unexecuted instantiation: lwcompound.c:getPoint4d_cp Unexecuted instantiation: lwcurvepoly.c:getPoint4d_cp Unexecuted instantiation: lwpsurface.c:getPoint4d_cp Unexecuted instantiation: lwtin.c:getPoint4d_cp Unexecuted instantiation: lwin_geojson.c:getPoint4d_cp Unexecuted instantiation: lwiterator.c:getPoint4d_cp Unexecuted instantiation: lwout_wkt.c:getPoint4d_cp Unexecuted instantiation: lwutil.c:getPoint4d_cp Unexecuted instantiation: lwhomogenize.c:getPoint4d_cp Unexecuted instantiation: lwalgorithm.c:getPoint4d_cp Unexecuted instantiation: lwstroke.c:getPoint4d_cp Unexecuted instantiation: lwprint.c:getPoint4d_cp Unexecuted instantiation: gbox.c:getPoint4d_cp Unexecuted instantiation: lwgeodetic.c:getPoint4d_cp Unexecuted instantiation: lwgeom_geos.c:getPoint4d_cp Unexecuted instantiation: lwgeom_geos_node.c:getPoint4d_cp Unexecuted instantiation: lwgeom_geos_split.c:getPoint4d_cp Unexecuted instantiation: lwnurbscurve.c:getPoint4d_cp Unexecuted instantiation: lwspheroid.c:getPoint4d_cp Unexecuted instantiation: stringbuffer.c:getPoint4d_cp Unexecuted instantiation: measures.c:getPoint4d_cp Unexecuted instantiation: measures3d.c:getPoint4d_cp Unexecuted instantiation: ptarray.c:getPoint4d_cp Unexecuted instantiation: lwgeom_api.c:getPoint4d_cp Unexecuted instantiation: lwout_wkb.c:getPoint4d_cp Unexecuted instantiation: lwlinearreferencing.c:getPoint4d_cp |
125 | | |
126 | | static inline LWPOINT * |
127 | | lwgeom_as_lwpoint(const LWGEOM *lwgeom) |
128 | 0 | { |
129 | 0 | if (!lwgeom) |
130 | 0 | return NULL; |
131 | 0 | if (lwgeom->type == POINTTYPE) |
132 | 0 | return (LWPOINT *)lwgeom; |
133 | 0 | else |
134 | 0 | return NULL; |
135 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwgeom_as_lwpoint(LWGEOM const*) Unexecuted instantiation: lwgeom.c:lwgeom_as_lwpoint Unexecuted instantiation: lwpoint.c:lwgeom_as_lwpoint Unexecuted instantiation: lwline.c:lwgeom_as_lwpoint Unexecuted instantiation: lwpoly.c:lwgeom_as_lwpoint Unexecuted instantiation: lwtriangle.c:lwgeom_as_lwpoint Unexecuted instantiation: lwmpoint.c:lwgeom_as_lwpoint Unexecuted instantiation: lwmline.c:lwgeom_as_lwpoint Unexecuted instantiation: lwmpoly.c:lwgeom_as_lwpoint Unexecuted instantiation: lwcollection.c:lwgeom_as_lwpoint Unexecuted instantiation: lwcircstring.c:lwgeom_as_lwpoint Unexecuted instantiation: lwcompound.c:lwgeom_as_lwpoint Unexecuted instantiation: lwcurvepoly.c:lwgeom_as_lwpoint Unexecuted instantiation: lwpsurface.c:lwgeom_as_lwpoint Unexecuted instantiation: lwtin.c:lwgeom_as_lwpoint Unexecuted instantiation: lwin_geojson.c:lwgeom_as_lwpoint Unexecuted instantiation: lwiterator.c:lwgeom_as_lwpoint Unexecuted instantiation: lwout_wkt.c:lwgeom_as_lwpoint Unexecuted instantiation: lwutil.c:lwgeom_as_lwpoint Unexecuted instantiation: lwhomogenize.c:lwgeom_as_lwpoint Unexecuted instantiation: lwalgorithm.c:lwgeom_as_lwpoint Unexecuted instantiation: lwstroke.c:lwgeom_as_lwpoint Unexecuted instantiation: lwprint.c:lwgeom_as_lwpoint Unexecuted instantiation: gbox.c:lwgeom_as_lwpoint Unexecuted instantiation: lwgeodetic.c:lwgeom_as_lwpoint Unexecuted instantiation: lwgeom_geos.c:lwgeom_as_lwpoint Unexecuted instantiation: lwgeom_geos_node.c:lwgeom_as_lwpoint Unexecuted instantiation: lwgeom_geos_split.c:lwgeom_as_lwpoint Unexecuted instantiation: lwnurbscurve.c:lwgeom_as_lwpoint Unexecuted instantiation: lwspheroid.c:lwgeom_as_lwpoint Unexecuted instantiation: stringbuffer.c:lwgeom_as_lwpoint Unexecuted instantiation: measures.c:lwgeom_as_lwpoint Unexecuted instantiation: measures3d.c:lwgeom_as_lwpoint Unexecuted instantiation: ptarray.c:lwgeom_as_lwpoint Unexecuted instantiation: lwgeom_api.c:lwgeom_as_lwpoint Unexecuted instantiation: lwout_wkb.c:lwgeom_as_lwpoint Unexecuted instantiation: lwlinearreferencing.c:lwgeom_as_lwpoint |
136 | | |
137 | | /** |
138 | | * Return LWTYPE number |
139 | | */ |
140 | | static inline uint32_t |
141 | | lwgeom_get_type(const LWGEOM *geom) |
142 | 0 | { |
143 | 0 | if (!geom) |
144 | 0 | return 0; |
145 | 0 | return geom->type; |
146 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwgeom_get_type(LWGEOM const*) Unexecuted instantiation: lwgeom.c:lwgeom_get_type Unexecuted instantiation: lwpoint.c:lwgeom_get_type Unexecuted instantiation: lwline.c:lwgeom_get_type Unexecuted instantiation: lwpoly.c:lwgeom_get_type Unexecuted instantiation: lwtriangle.c:lwgeom_get_type Unexecuted instantiation: lwmpoint.c:lwgeom_get_type Unexecuted instantiation: lwmline.c:lwgeom_get_type Unexecuted instantiation: lwmpoly.c:lwgeom_get_type Unexecuted instantiation: lwcollection.c:lwgeom_get_type Unexecuted instantiation: lwcircstring.c:lwgeom_get_type Unexecuted instantiation: lwcompound.c:lwgeom_get_type Unexecuted instantiation: lwcurvepoly.c:lwgeom_get_type Unexecuted instantiation: lwpsurface.c:lwgeom_get_type Unexecuted instantiation: lwtin.c:lwgeom_get_type Unexecuted instantiation: lwin_geojson.c:lwgeom_get_type Unexecuted instantiation: lwiterator.c:lwgeom_get_type Unexecuted instantiation: lwout_wkt.c:lwgeom_get_type Unexecuted instantiation: lwutil.c:lwgeom_get_type Unexecuted instantiation: lwhomogenize.c:lwgeom_get_type Unexecuted instantiation: lwalgorithm.c:lwgeom_get_type Unexecuted instantiation: lwstroke.c:lwgeom_get_type Unexecuted instantiation: lwprint.c:lwgeom_get_type Unexecuted instantiation: gbox.c:lwgeom_get_type Unexecuted instantiation: lwgeodetic.c:lwgeom_get_type Unexecuted instantiation: lwgeom_geos.c:lwgeom_get_type Unexecuted instantiation: lwgeom_geos_node.c:lwgeom_get_type Unexecuted instantiation: lwgeom_geos_split.c:lwgeom_get_type Unexecuted instantiation: lwnurbscurve.c:lwgeom_get_type Unexecuted instantiation: lwspheroid.c:lwgeom_get_type Unexecuted instantiation: stringbuffer.c:lwgeom_get_type Unexecuted instantiation: measures.c:lwgeom_get_type Unexecuted instantiation: measures3d.c:lwgeom_get_type Unexecuted instantiation: ptarray.c:lwgeom_get_type Unexecuted instantiation: lwgeom_api.c:lwgeom_get_type Unexecuted instantiation: lwout_wkb.c:lwgeom_get_type Unexecuted instantiation: lwlinearreferencing.c:lwgeom_get_type |
147 | | |
148 | | static inline int |
149 | | lwpoint_is_empty(const LWPOINT *point) |
150 | 490k | { |
151 | 490k | return !point->point || point->point->npoints < 1; |
152 | 490k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwpoint_is_empty(LWPOINT const*) lwgeom.c:lwpoint_is_empty Line | Count | Source | 150 | 126k | { | 151 | 126k | return !point->point || point->point->npoints < 1; | 152 | 126k | } |
lwpoint.c:lwpoint_is_empty Line | Count | Source | 150 | 134k | { | 151 | 134k | return !point->point || point->point->npoints < 1; | 152 | 134k | } |
Unexecuted instantiation: lwline.c:lwpoint_is_empty Unexecuted instantiation: lwpoly.c:lwpoint_is_empty Unexecuted instantiation: lwtriangle.c:lwpoint_is_empty Unexecuted instantiation: lwmpoint.c:lwpoint_is_empty Unexecuted instantiation: lwmline.c:lwpoint_is_empty Unexecuted instantiation: lwmpoly.c:lwpoint_is_empty lwcollection.c:lwpoint_is_empty Line | Count | Source | 150 | 229k | { | 151 | 229k | return !point->point || point->point->npoints < 1; | 152 | 229k | } |
Unexecuted instantiation: lwcircstring.c:lwpoint_is_empty Unexecuted instantiation: lwcompound.c:lwpoint_is_empty Unexecuted instantiation: lwcurvepoly.c:lwpoint_is_empty Unexecuted instantiation: lwpsurface.c:lwpoint_is_empty Unexecuted instantiation: lwtin.c:lwpoint_is_empty Unexecuted instantiation: lwin_geojson.c:lwpoint_is_empty Unexecuted instantiation: lwiterator.c:lwpoint_is_empty Unexecuted instantiation: lwout_wkt.c:lwpoint_is_empty Unexecuted instantiation: lwutil.c:lwpoint_is_empty Unexecuted instantiation: lwhomogenize.c:lwpoint_is_empty Unexecuted instantiation: lwalgorithm.c:lwpoint_is_empty Unexecuted instantiation: lwstroke.c:lwpoint_is_empty Unexecuted instantiation: lwprint.c:lwpoint_is_empty Unexecuted instantiation: gbox.c:lwpoint_is_empty Unexecuted instantiation: lwgeodetic.c:lwpoint_is_empty Unexecuted instantiation: lwgeom_geos.c:lwpoint_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwpoint_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwpoint_is_empty Unexecuted instantiation: lwnurbscurve.c:lwpoint_is_empty Unexecuted instantiation: lwspheroid.c:lwpoint_is_empty Unexecuted instantiation: stringbuffer.c:lwpoint_is_empty Unexecuted instantiation: measures.c:lwpoint_is_empty Unexecuted instantiation: measures3d.c:lwpoint_is_empty Unexecuted instantiation: ptarray.c:lwpoint_is_empty Unexecuted instantiation: lwgeom_api.c:lwpoint_is_empty Unexecuted instantiation: lwout_wkb.c:lwpoint_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwpoint_is_empty |
153 | | |
154 | | static inline int |
155 | | lwline_is_empty(const LWLINE *line) |
156 | 184k | { |
157 | 184k | return !line->points || line->points->npoints < 1; |
158 | 184k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwline_is_empty(LWLINE const*) Line | Count | Source | 156 | 58.0k | { | 157 | 58.0k | return !line->points || line->points->npoints < 1; | 158 | 58.0k | } |
Unexecuted instantiation: lwpoint.c:lwline_is_empty Line | Count | Source | 156 | 58.7k | { | 157 | 58.7k | return !line->points || line->points->npoints < 1; | 158 | 58.7k | } |
Unexecuted instantiation: lwpoly.c:lwline_is_empty Unexecuted instantiation: lwtriangle.c:lwline_is_empty Unexecuted instantiation: lwmpoint.c:lwline_is_empty Unexecuted instantiation: lwmline.c:lwline_is_empty Unexecuted instantiation: lwmpoly.c:lwline_is_empty lwcollection.c:lwline_is_empty Line | Count | Source | 156 | 67.3k | { | 157 | 67.3k | return !line->points || line->points->npoints < 1; | 158 | 67.3k | } |
Unexecuted instantiation: lwcircstring.c:lwline_is_empty Unexecuted instantiation: lwcompound.c:lwline_is_empty Unexecuted instantiation: lwcurvepoly.c:lwline_is_empty Unexecuted instantiation: lwpsurface.c:lwline_is_empty Unexecuted instantiation: lwtin.c:lwline_is_empty Unexecuted instantiation: lwin_geojson.c:lwline_is_empty Unexecuted instantiation: lwiterator.c:lwline_is_empty Unexecuted instantiation: lwout_wkt.c:lwline_is_empty Unexecuted instantiation: lwutil.c:lwline_is_empty Unexecuted instantiation: lwhomogenize.c:lwline_is_empty Unexecuted instantiation: lwalgorithm.c:lwline_is_empty Unexecuted instantiation: lwstroke.c:lwline_is_empty Unexecuted instantiation: lwprint.c:lwline_is_empty Unexecuted instantiation: gbox.c:lwline_is_empty Unexecuted instantiation: lwgeodetic.c:lwline_is_empty Unexecuted instantiation: lwgeom_geos.c:lwline_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwline_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwline_is_empty Unexecuted instantiation: lwnurbscurve.c:lwline_is_empty Unexecuted instantiation: lwspheroid.c:lwline_is_empty Unexecuted instantiation: stringbuffer.c:lwline_is_empty Unexecuted instantiation: measures.c:lwline_is_empty Unexecuted instantiation: measures3d.c:lwline_is_empty Unexecuted instantiation: ptarray.c:lwline_is_empty Unexecuted instantiation: lwgeom_api.c:lwline_is_empty Unexecuted instantiation: lwout_wkb.c:lwline_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwline_is_empty |
159 | | |
160 | | static inline int |
161 | | lwcircstring_is_empty(const LWCIRCSTRING *circ) |
162 | 0 | { |
163 | 0 | return !circ->points || circ->points->npoints < 1; |
164 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwcircstring_is_empty(LWCIRCSTRING const*) Unexecuted instantiation: lwgeom.c:lwcircstring_is_empty Unexecuted instantiation: lwpoint.c:lwcircstring_is_empty Unexecuted instantiation: lwline.c:lwcircstring_is_empty Unexecuted instantiation: lwpoly.c:lwcircstring_is_empty Unexecuted instantiation: lwtriangle.c:lwcircstring_is_empty Unexecuted instantiation: lwmpoint.c:lwcircstring_is_empty Unexecuted instantiation: lwmline.c:lwcircstring_is_empty Unexecuted instantiation: lwmpoly.c:lwcircstring_is_empty Unexecuted instantiation: lwcollection.c:lwcircstring_is_empty Unexecuted instantiation: lwcircstring.c:lwcircstring_is_empty Unexecuted instantiation: lwcompound.c:lwcircstring_is_empty Unexecuted instantiation: lwcurvepoly.c:lwcircstring_is_empty Unexecuted instantiation: lwpsurface.c:lwcircstring_is_empty Unexecuted instantiation: lwtin.c:lwcircstring_is_empty Unexecuted instantiation: lwin_geojson.c:lwcircstring_is_empty Unexecuted instantiation: lwiterator.c:lwcircstring_is_empty Unexecuted instantiation: lwout_wkt.c:lwcircstring_is_empty Unexecuted instantiation: lwutil.c:lwcircstring_is_empty Unexecuted instantiation: lwhomogenize.c:lwcircstring_is_empty Unexecuted instantiation: lwalgorithm.c:lwcircstring_is_empty Unexecuted instantiation: lwstroke.c:lwcircstring_is_empty Unexecuted instantiation: lwprint.c:lwcircstring_is_empty Unexecuted instantiation: gbox.c:lwcircstring_is_empty Unexecuted instantiation: lwgeodetic.c:lwcircstring_is_empty Unexecuted instantiation: lwgeom_geos.c:lwcircstring_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwcircstring_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwcircstring_is_empty Unexecuted instantiation: lwnurbscurve.c:lwcircstring_is_empty Unexecuted instantiation: lwspheroid.c:lwcircstring_is_empty Unexecuted instantiation: stringbuffer.c:lwcircstring_is_empty Unexecuted instantiation: measures.c:lwcircstring_is_empty Unexecuted instantiation: measures3d.c:lwcircstring_is_empty Unexecuted instantiation: ptarray.c:lwcircstring_is_empty Unexecuted instantiation: lwgeom_api.c:lwcircstring_is_empty Unexecuted instantiation: lwout_wkb.c:lwcircstring_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwcircstring_is_empty |
165 | | |
166 | | static inline int |
167 | | lwpoly_is_empty(const LWPOLY *poly) |
168 | 201k | { |
169 | 201k | return poly->nrings < 1 || !poly->rings || !poly->rings[0] || poly->rings[0]->npoints < 1; |
170 | 201k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwpoly_is_empty(LWPOLY const*) Line | Count | Source | 168 | 34.0k | { | 169 | 34.0k | return poly->nrings < 1 || !poly->rings || !poly->rings[0] || poly->rings[0]->npoints < 1; | 170 | 34.0k | } |
Unexecuted instantiation: lwpoint.c:lwpoly_is_empty Unexecuted instantiation: lwline.c:lwpoly_is_empty Line | Count | Source | 168 | 34.3k | { | 169 | 34.3k | return poly->nrings < 1 || !poly->rings || !poly->rings[0] || poly->rings[0]->npoints < 1; | 170 | 34.3k | } |
Unexecuted instantiation: lwtriangle.c:lwpoly_is_empty Unexecuted instantiation: lwmpoint.c:lwpoly_is_empty Unexecuted instantiation: lwmline.c:lwpoly_is_empty Unexecuted instantiation: lwmpoly.c:lwpoly_is_empty lwcollection.c:lwpoly_is_empty Line | Count | Source | 168 | 133k | { | 169 | 133k | return poly->nrings < 1 || !poly->rings || !poly->rings[0] || poly->rings[0]->npoints < 1; | 170 | 133k | } |
Unexecuted instantiation: lwcircstring.c:lwpoly_is_empty Unexecuted instantiation: lwcompound.c:lwpoly_is_empty Unexecuted instantiation: lwcurvepoly.c:lwpoly_is_empty Unexecuted instantiation: lwpsurface.c:lwpoly_is_empty Unexecuted instantiation: lwtin.c:lwpoly_is_empty Unexecuted instantiation: lwin_geojson.c:lwpoly_is_empty Unexecuted instantiation: lwiterator.c:lwpoly_is_empty Unexecuted instantiation: lwout_wkt.c:lwpoly_is_empty Unexecuted instantiation: lwutil.c:lwpoly_is_empty Unexecuted instantiation: lwhomogenize.c:lwpoly_is_empty Unexecuted instantiation: lwalgorithm.c:lwpoly_is_empty Unexecuted instantiation: lwstroke.c:lwpoly_is_empty Unexecuted instantiation: lwprint.c:lwpoly_is_empty Unexecuted instantiation: gbox.c:lwpoly_is_empty Unexecuted instantiation: lwgeodetic.c:lwpoly_is_empty Unexecuted instantiation: lwgeom_geos.c:lwpoly_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwpoly_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwpoly_is_empty Unexecuted instantiation: lwnurbscurve.c:lwpoly_is_empty Unexecuted instantiation: lwspheroid.c:lwpoly_is_empty Unexecuted instantiation: stringbuffer.c:lwpoly_is_empty Unexecuted instantiation: measures.c:lwpoly_is_empty Unexecuted instantiation: measures3d.c:lwpoly_is_empty Unexecuted instantiation: ptarray.c:lwpoly_is_empty Unexecuted instantiation: lwgeom_api.c:lwpoly_is_empty Unexecuted instantiation: lwout_wkb.c:lwpoly_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwpoly_is_empty |
171 | | |
172 | | static inline int |
173 | | lwtriangle_is_empty(const LWTRIANGLE *triangle) |
174 | 0 | { |
175 | 0 | return !triangle->points || triangle->points->npoints < 1; |
176 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwtriangle_is_empty(LWTRIANGLE const*) Unexecuted instantiation: lwgeom.c:lwtriangle_is_empty Unexecuted instantiation: lwpoint.c:lwtriangle_is_empty Unexecuted instantiation: lwline.c:lwtriangle_is_empty Unexecuted instantiation: lwpoly.c:lwtriangle_is_empty Unexecuted instantiation: lwtriangle.c:lwtriangle_is_empty Unexecuted instantiation: lwmpoint.c:lwtriangle_is_empty Unexecuted instantiation: lwmline.c:lwtriangle_is_empty Unexecuted instantiation: lwmpoly.c:lwtriangle_is_empty Unexecuted instantiation: lwcollection.c:lwtriangle_is_empty Unexecuted instantiation: lwcircstring.c:lwtriangle_is_empty Unexecuted instantiation: lwcompound.c:lwtriangle_is_empty Unexecuted instantiation: lwcurvepoly.c:lwtriangle_is_empty Unexecuted instantiation: lwpsurface.c:lwtriangle_is_empty Unexecuted instantiation: lwtin.c:lwtriangle_is_empty Unexecuted instantiation: lwin_geojson.c:lwtriangle_is_empty Unexecuted instantiation: lwiterator.c:lwtriangle_is_empty Unexecuted instantiation: lwout_wkt.c:lwtriangle_is_empty Unexecuted instantiation: lwutil.c:lwtriangle_is_empty Unexecuted instantiation: lwhomogenize.c:lwtriangle_is_empty Unexecuted instantiation: lwalgorithm.c:lwtriangle_is_empty Unexecuted instantiation: lwstroke.c:lwtriangle_is_empty Unexecuted instantiation: lwprint.c:lwtriangle_is_empty Unexecuted instantiation: gbox.c:lwtriangle_is_empty Unexecuted instantiation: lwgeodetic.c:lwtriangle_is_empty Unexecuted instantiation: lwgeom_geos.c:lwtriangle_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwtriangle_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwtriangle_is_empty Unexecuted instantiation: lwnurbscurve.c:lwtriangle_is_empty Unexecuted instantiation: lwspheroid.c:lwtriangle_is_empty Unexecuted instantiation: stringbuffer.c:lwtriangle_is_empty Unexecuted instantiation: measures.c:lwtriangle_is_empty Unexecuted instantiation: measures3d.c:lwtriangle_is_empty Unexecuted instantiation: ptarray.c:lwtriangle_is_empty Unexecuted instantiation: lwgeom_api.c:lwtriangle_is_empty Unexecuted instantiation: lwout_wkb.c:lwtriangle_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwtriangle_is_empty |
177 | | |
178 | | static inline int lwgeom_is_empty(const LWGEOM *geom); |
179 | | |
180 | | /** |
181 | | * Determine whether a collection geometry contains no non-empty geometries. |
182 | | * |
183 | | * Returns true if the collection has zero geometries, its geometry array is NULL, |
184 | | * or every contained geometry is empty according to lwgeom_is_empty(). Returns |
185 | | * false as soon as any contained geometry is found to be non-empty. |
186 | | * |
187 | | * @param col Collection to check; must be a valid LWCOLLECTION pointer. |
188 | | * @return LW_TRUE if the collection is empty, LW_FALSE otherwise. |
189 | | */ |
190 | | static inline int |
191 | | lwcollection_is_empty(const LWCOLLECTION *col) |
192 | 13.7k | { |
193 | 13.7k | uint32_t i; |
194 | 13.7k | if (col->ngeoms == 0 || !col->geoms) |
195 | 7.77k | return LW_TRUE; |
196 | 658k | for (i = 0; i < col->ngeoms; i++) |
197 | 656k | { |
198 | 656k | if (!lwgeom_is_empty(col->geoms[i])) |
199 | 3.95k | return LW_FALSE; |
200 | 656k | } |
201 | 2.07k | return LW_TRUE; |
202 | 6.02k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwcollection_is_empty(LWCOLLECTION const*) lwgeom.c:lwcollection_is_empty Line | Count | Source | 192 | 3.37k | { | 193 | 3.37k | uint32_t i; | 194 | 3.37k | if (col->ngeoms == 0 || !col->geoms) | 195 | 2.22k | return LW_TRUE; | 196 | 221k | for (i = 0; i < col->ngeoms; i++) | 197 | 220k | { | 198 | 220k | if (!lwgeom_is_empty(col->geoms[i])) | 199 | 777 | return LW_FALSE; | 200 | 220k | } | 201 | 377 | return LW_TRUE; | 202 | 1.15k | } |
Unexecuted instantiation: lwpoint.c:lwcollection_is_empty Unexecuted instantiation: lwline.c:lwcollection_is_empty Unexecuted instantiation: lwpoly.c:lwcollection_is_empty Unexecuted instantiation: lwtriangle.c:lwcollection_is_empty Unexecuted instantiation: lwmpoint.c:lwcollection_is_empty Unexecuted instantiation: lwmline.c:lwcollection_is_empty Unexecuted instantiation: lwmpoly.c:lwcollection_is_empty lwcollection.c:lwcollection_is_empty Line | Count | Source | 192 | 10.4k | { | 193 | 10.4k | uint32_t i; | 194 | 10.4k | if (col->ngeoms == 0 || !col->geoms) | 195 | 5.54k | return LW_TRUE; | 196 | 437k | for (i = 0; i < col->ngeoms; i++) | 197 | 436k | { | 198 | 436k | if (!lwgeom_is_empty(col->geoms[i])) | 199 | 3.18k | return LW_FALSE; | 200 | 436k | } | 201 | 1.69k | return LW_TRUE; | 202 | 4.87k | } |
Unexecuted instantiation: lwcircstring.c:lwcollection_is_empty Unexecuted instantiation: lwcompound.c:lwcollection_is_empty Unexecuted instantiation: lwcurvepoly.c:lwcollection_is_empty Unexecuted instantiation: lwpsurface.c:lwcollection_is_empty Unexecuted instantiation: lwtin.c:lwcollection_is_empty Unexecuted instantiation: lwin_geojson.c:lwcollection_is_empty Unexecuted instantiation: lwiterator.c:lwcollection_is_empty Unexecuted instantiation: lwout_wkt.c:lwcollection_is_empty Unexecuted instantiation: lwutil.c:lwcollection_is_empty Unexecuted instantiation: lwhomogenize.c:lwcollection_is_empty Unexecuted instantiation: lwalgorithm.c:lwcollection_is_empty Unexecuted instantiation: lwstroke.c:lwcollection_is_empty Unexecuted instantiation: lwprint.c:lwcollection_is_empty Unexecuted instantiation: gbox.c:lwcollection_is_empty Unexecuted instantiation: lwgeodetic.c:lwcollection_is_empty Unexecuted instantiation: lwgeom_geos.c:lwcollection_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwcollection_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwcollection_is_empty Unexecuted instantiation: lwnurbscurve.c:lwcollection_is_empty Unexecuted instantiation: lwspheroid.c:lwcollection_is_empty Unexecuted instantiation: stringbuffer.c:lwcollection_is_empty Unexecuted instantiation: measures.c:lwcollection_is_empty Unexecuted instantiation: measures3d.c:lwcollection_is_empty Unexecuted instantiation: ptarray.c:lwcollection_is_empty Unexecuted instantiation: lwgeom_api.c:lwcollection_is_empty Unexecuted instantiation: lwout_wkb.c:lwcollection_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwcollection_is_empty |
203 | | |
204 | | /** |
205 | | * Determine whether a NURBS curve is empty. |
206 | | * |
207 | | * A NURBS curve is considered empty if the curve pointer is NULL, its |
208 | | * associated points array is NULL, or the points array reports zero control |
209 | | * points. |
210 | | * |
211 | | * @param curve NURBS curve to test. |
212 | | * @return LW_TRUE if the curve is empty, otherwise LW_FALSE. |
213 | | */ |
214 | | static inline int |
215 | | lwnurbscurve_is_empty(const LWNURBSCURVE *curve) |
216 | 0 | { |
217 | 0 | if (!curve) |
218 | 0 | return LW_TRUE; |
219 | | |
220 | 0 | if (!curve->points) |
221 | 0 | return LW_TRUE; |
222 | | |
223 | 0 | if (curve->points->npoints == 0) |
224 | 0 | return LW_TRUE; |
225 | | |
226 | 0 | return LW_FALSE; |
227 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwnurbscurve_is_empty(LWNURBSCURVE const*) Unexecuted instantiation: lwgeom.c:lwnurbscurve_is_empty Unexecuted instantiation: lwpoint.c:lwnurbscurve_is_empty Unexecuted instantiation: lwline.c:lwnurbscurve_is_empty Unexecuted instantiation: lwpoly.c:lwnurbscurve_is_empty Unexecuted instantiation: lwtriangle.c:lwnurbscurve_is_empty Unexecuted instantiation: lwmpoint.c:lwnurbscurve_is_empty Unexecuted instantiation: lwmline.c:lwnurbscurve_is_empty Unexecuted instantiation: lwmpoly.c:lwnurbscurve_is_empty Unexecuted instantiation: lwcollection.c:lwnurbscurve_is_empty Unexecuted instantiation: lwcircstring.c:lwnurbscurve_is_empty Unexecuted instantiation: lwcompound.c:lwnurbscurve_is_empty Unexecuted instantiation: lwcurvepoly.c:lwnurbscurve_is_empty Unexecuted instantiation: lwpsurface.c:lwnurbscurve_is_empty Unexecuted instantiation: lwtin.c:lwnurbscurve_is_empty Unexecuted instantiation: lwin_geojson.c:lwnurbscurve_is_empty Unexecuted instantiation: lwiterator.c:lwnurbscurve_is_empty Unexecuted instantiation: lwout_wkt.c:lwnurbscurve_is_empty Unexecuted instantiation: lwutil.c:lwnurbscurve_is_empty Unexecuted instantiation: lwhomogenize.c:lwnurbscurve_is_empty Unexecuted instantiation: lwalgorithm.c:lwnurbscurve_is_empty Unexecuted instantiation: lwstroke.c:lwnurbscurve_is_empty Unexecuted instantiation: lwprint.c:lwnurbscurve_is_empty Unexecuted instantiation: gbox.c:lwnurbscurve_is_empty Unexecuted instantiation: lwgeodetic.c:lwnurbscurve_is_empty Unexecuted instantiation: lwgeom_geos.c:lwnurbscurve_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwnurbscurve_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwnurbscurve_is_empty Unexecuted instantiation: lwnurbscurve.c:lwnurbscurve_is_empty Unexecuted instantiation: lwspheroid.c:lwnurbscurve_is_empty Unexecuted instantiation: stringbuffer.c:lwnurbscurve_is_empty Unexecuted instantiation: measures.c:lwnurbscurve_is_empty Unexecuted instantiation: measures3d.c:lwnurbscurve_is_empty Unexecuted instantiation: ptarray.c:lwnurbscurve_is_empty Unexecuted instantiation: lwgeom_api.c:lwnurbscurve_is_empty Unexecuted instantiation: lwout_wkb.c:lwnurbscurve_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwnurbscurve_is_empty |
228 | | |
229 | | /** |
230 | | * Determine whether a geometry contains no vertices. |
231 | | * |
232 | | * Returns LW_TRUE if the provided LWGEOM has no coordinate vertices according to |
233 | | * its concrete type (points, lines, rings, polygons, collections, NURBS curves, etc.). |
234 | | * The check is delegated to type-specific emptiness helpers; unrecognized geometry |
235 | | * types are treated as non-empty (returns LW_FALSE). |
236 | | * |
237 | | * The caller must pass a non-NULL geom pointer whose ->type field is valid. |
238 | | * |
239 | | * @param geom Geometry to test for emptiness. |
240 | | * @return LW_TRUE if the geometry is empty, otherwise LW_FALSE. |
241 | | */ |
242 | | static inline int |
243 | | lwgeom_is_empty(const LWGEOM *geom) |
244 | 657k | { |
245 | 657k | switch (geom->type) |
246 | 657k | { |
247 | 355k | case POINTTYPE: |
248 | 355k | return lwpoint_is_empty((LWPOINT *)geom); |
249 | 0 | break; |
250 | 125k | case LINETYPE: |
251 | 125k | return lwline_is_empty((LWLINE *)geom); |
252 | 0 | break; |
253 | 0 | case CIRCSTRINGTYPE: |
254 | 0 | return lwcircstring_is_empty((LWCIRCSTRING *)geom); |
255 | 0 | break; |
256 | 167k | case POLYGONTYPE: |
257 | 167k | return lwpoly_is_empty((LWPOLY *)geom); |
258 | 0 | break; |
259 | 0 | case TRIANGLETYPE: |
260 | 0 | return lwtriangle_is_empty((LWTRIANGLE *)geom); |
261 | 0 | break; |
262 | 3.66k | case MULTIPOINTTYPE: |
263 | 5.07k | case MULTILINETYPE: |
264 | 6.58k | case MULTIPOLYGONTYPE: |
265 | 6.58k | case COMPOUNDTYPE: |
266 | 6.58k | case CURVEPOLYTYPE: |
267 | 6.58k | case MULTICURVETYPE: |
268 | 6.58k | case MULTISURFACETYPE: |
269 | 6.58k | case POLYHEDRALSURFACETYPE: |
270 | 6.58k | case TINTYPE: |
271 | 9.73k | case COLLECTIONTYPE: |
272 | 9.73k | return lwcollection_is_empty((LWCOLLECTION *)geom); |
273 | 0 | break; |
274 | 0 | case NURBSCURVETYPE: |
275 | 0 | return lwnurbscurve_is_empty((LWNURBSCURVE*)geom); |
276 | 0 | break; |
277 | 0 | default: |
278 | 0 | return LW_FALSE; |
279 | 0 | break; |
280 | 657k | } |
281 | 657k | } Unexecuted instantiation: geojson_import_fuzzer.cpp:lwgeom_is_empty(LWGEOM const*) Line | Count | Source | 244 | 221k | { | 245 | 221k | switch (geom->type) | 246 | 221k | { | 247 | 126k | case POINTTYPE: | 248 | 126k | return lwpoint_is_empty((LWPOINT *)geom); | 249 | 0 | break; | 250 | 58.0k | case LINETYPE: | 251 | 58.0k | return lwline_is_empty((LWLINE *)geom); | 252 | 0 | break; | 253 | 0 | case CIRCSTRINGTYPE: | 254 | 0 | return lwcircstring_is_empty((LWCIRCSTRING *)geom); | 255 | 0 | break; | 256 | 34.0k | case POLYGONTYPE: | 257 | 34.0k | return lwpoly_is_empty((LWPOLY *)geom); | 258 | 0 | break; | 259 | 0 | case TRIANGLETYPE: | 260 | 0 | return lwtriangle_is_empty((LWTRIANGLE *)geom); | 261 | 0 | break; | 262 | 1.57k | case MULTIPOINTTYPE: | 263 | 2.04k | case MULTILINETYPE: | 264 | 2.61k | case MULTIPOLYGONTYPE: | 265 | 2.61k | case COMPOUNDTYPE: | 266 | 2.61k | case CURVEPOLYTYPE: | 267 | 2.61k | case MULTICURVETYPE: | 268 | 2.61k | case MULTISURFACETYPE: | 269 | 2.61k | case POLYHEDRALSURFACETYPE: | 270 | 2.61k | case TINTYPE: | 271 | 3.37k | case COLLECTIONTYPE: | 272 | 3.37k | return lwcollection_is_empty((LWCOLLECTION *)geom); | 273 | 0 | break; | 274 | 0 | case NURBSCURVETYPE: | 275 | 0 | return lwnurbscurve_is_empty((LWNURBSCURVE*)geom); | 276 | 0 | break; | 277 | 0 | default: | 278 | 0 | return LW_FALSE; | 279 | 0 | break; | 280 | 221k | } | 281 | 221k | } |
Unexecuted instantiation: lwpoint.c:lwgeom_is_empty Unexecuted instantiation: lwline.c:lwgeom_is_empty Unexecuted instantiation: lwpoly.c:lwgeom_is_empty Unexecuted instantiation: lwtriangle.c:lwgeom_is_empty Unexecuted instantiation: lwmpoint.c:lwgeom_is_empty Unexecuted instantiation: lwmline.c:lwgeom_is_empty Unexecuted instantiation: lwmpoly.c:lwgeom_is_empty lwcollection.c:lwgeom_is_empty Line | Count | Source | 244 | 436k | { | 245 | 436k | switch (geom->type) | 246 | 436k | { | 247 | 229k | case POINTTYPE: | 248 | 229k | return lwpoint_is_empty((LWPOINT *)geom); | 249 | 0 | break; | 250 | 67.3k | case LINETYPE: | 251 | 67.3k | return lwline_is_empty((LWLINE *)geom); | 252 | 0 | break; | 253 | 0 | case CIRCSTRINGTYPE: | 254 | 0 | return lwcircstring_is_empty((LWCIRCSTRING *)geom); | 255 | 0 | break; | 256 | 133k | case POLYGONTYPE: | 257 | 133k | return lwpoly_is_empty((LWPOLY *)geom); | 258 | 0 | break; | 259 | 0 | case TRIANGLETYPE: | 260 | 0 | return lwtriangle_is_empty((LWTRIANGLE *)geom); | 261 | 0 | break; | 262 | 2.08k | case MULTIPOINTTYPE: | 263 | 3.02k | case MULTILINETYPE: | 264 | 3.97k | case MULTIPOLYGONTYPE: | 265 | 3.97k | case COMPOUNDTYPE: | 266 | 3.97k | case CURVEPOLYTYPE: | 267 | 3.97k | case MULTICURVETYPE: | 268 | 3.97k | case MULTISURFACETYPE: | 269 | 3.97k | case POLYHEDRALSURFACETYPE: | 270 | 3.97k | case TINTYPE: | 271 | 6.35k | case COLLECTIONTYPE: | 272 | 6.35k | return lwcollection_is_empty((LWCOLLECTION *)geom); | 273 | 0 | break; | 274 | 0 | case NURBSCURVETYPE: | 275 | 0 | return lwnurbscurve_is_empty((LWNURBSCURVE*)geom); | 276 | 0 | break; | 277 | 0 | default: | 278 | 0 | return LW_FALSE; | 279 | 0 | break; | 280 | 436k | } | 281 | 436k | } |
Unexecuted instantiation: lwcircstring.c:lwgeom_is_empty Unexecuted instantiation: lwcompound.c:lwgeom_is_empty Unexecuted instantiation: lwcurvepoly.c:lwgeom_is_empty Unexecuted instantiation: lwpsurface.c:lwgeom_is_empty Unexecuted instantiation: lwtin.c:lwgeom_is_empty Unexecuted instantiation: lwin_geojson.c:lwgeom_is_empty Unexecuted instantiation: lwiterator.c:lwgeom_is_empty Unexecuted instantiation: lwout_wkt.c:lwgeom_is_empty Unexecuted instantiation: lwutil.c:lwgeom_is_empty Unexecuted instantiation: lwhomogenize.c:lwgeom_is_empty Unexecuted instantiation: lwalgorithm.c:lwgeom_is_empty Unexecuted instantiation: lwstroke.c:lwgeom_is_empty Unexecuted instantiation: lwprint.c:lwgeom_is_empty Unexecuted instantiation: gbox.c:lwgeom_is_empty Unexecuted instantiation: lwgeodetic.c:lwgeom_is_empty Unexecuted instantiation: lwgeom_geos.c:lwgeom_is_empty Unexecuted instantiation: lwgeom_geos_node.c:lwgeom_is_empty Unexecuted instantiation: lwgeom_geos_split.c:lwgeom_is_empty Unexecuted instantiation: lwnurbscurve.c:lwgeom_is_empty Unexecuted instantiation: lwspheroid.c:lwgeom_is_empty Unexecuted instantiation: stringbuffer.c:lwgeom_is_empty Unexecuted instantiation: measures.c:lwgeom_is_empty Unexecuted instantiation: measures3d.c:lwgeom_is_empty Unexecuted instantiation: ptarray.c:lwgeom_is_empty Unexecuted instantiation: lwgeom_api.c:lwgeom_is_empty Unexecuted instantiation: lwout_wkb.c:lwgeom_is_empty Unexecuted instantiation: lwlinearreferencing.c:lwgeom_is_empty |
282 | | |
283 | | inline static uint64_t |
284 | | uint64_interleave_2(uint64_t x, uint64_t y) |
285 | 0 | { |
286 | 0 | x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL; |
287 | 0 | x = (x | (x << 8)) & 0x00FF00FF00FF00FFULL; |
288 | 0 | x = (x | (x << 4)) & 0x0F0F0F0F0F0F0F0FULL; |
289 | 0 | x = (x | (x << 2)) & 0x3333333333333333ULL; |
290 | 0 | x = (x | (x << 1)) & 0x5555555555555555ULL; |
291 | |
|
292 | 0 | y = (y | (y << 16)) & 0x0000FFFF0000FFFFULL; |
293 | 0 | y = (y | (y << 8)) & 0x00FF00FF00FF00FFULL; |
294 | 0 | y = (y | (y << 4)) & 0x0F0F0F0F0F0F0F0FULL; |
295 | 0 | y = (y | (y << 2)) & 0x3333333333333333ULL; |
296 | 0 | y = (y | (y << 1)) & 0x5555555555555555ULL; |
297 | |
|
298 | 0 | return x | (y << 1); |
299 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:uint64_interleave_2(unsigned long, unsigned long) Unexecuted instantiation: lwgeom.c:uint64_interleave_2 Unexecuted instantiation: lwpoint.c:uint64_interleave_2 Unexecuted instantiation: lwline.c:uint64_interleave_2 Unexecuted instantiation: lwpoly.c:uint64_interleave_2 Unexecuted instantiation: lwtriangle.c:uint64_interleave_2 Unexecuted instantiation: lwmpoint.c:uint64_interleave_2 Unexecuted instantiation: lwmline.c:uint64_interleave_2 Unexecuted instantiation: lwmpoly.c:uint64_interleave_2 Unexecuted instantiation: lwcollection.c:uint64_interleave_2 Unexecuted instantiation: lwcircstring.c:uint64_interleave_2 Unexecuted instantiation: lwcompound.c:uint64_interleave_2 Unexecuted instantiation: lwcurvepoly.c:uint64_interleave_2 Unexecuted instantiation: lwpsurface.c:uint64_interleave_2 Unexecuted instantiation: lwtin.c:uint64_interleave_2 Unexecuted instantiation: lwin_geojson.c:uint64_interleave_2 Unexecuted instantiation: lwiterator.c:uint64_interleave_2 Unexecuted instantiation: lwout_wkt.c:uint64_interleave_2 Unexecuted instantiation: lwutil.c:uint64_interleave_2 Unexecuted instantiation: lwhomogenize.c:uint64_interleave_2 Unexecuted instantiation: lwalgorithm.c:uint64_interleave_2 Unexecuted instantiation: lwstroke.c:uint64_interleave_2 Unexecuted instantiation: lwprint.c:uint64_interleave_2 Unexecuted instantiation: gbox.c:uint64_interleave_2 Unexecuted instantiation: lwgeodetic.c:uint64_interleave_2 Unexecuted instantiation: lwgeom_geos.c:uint64_interleave_2 Unexecuted instantiation: lwgeom_geos_node.c:uint64_interleave_2 Unexecuted instantiation: lwgeom_geos_split.c:uint64_interleave_2 Unexecuted instantiation: lwnurbscurve.c:uint64_interleave_2 Unexecuted instantiation: lwspheroid.c:uint64_interleave_2 Unexecuted instantiation: stringbuffer.c:uint64_interleave_2 Unexecuted instantiation: measures.c:uint64_interleave_2 Unexecuted instantiation: measures3d.c:uint64_interleave_2 Unexecuted instantiation: ptarray.c:uint64_interleave_2 Unexecuted instantiation: lwgeom_api.c:uint64_interleave_2 Unexecuted instantiation: lwout_wkb.c:uint64_interleave_2 Unexecuted instantiation: lwlinearreferencing.c:uint64_interleave_2 |
300 | | |
301 | | /* Based on https://github.com/rawrunprotected/hilbert_curves Public Domain code */ |
302 | | inline static uint64_t |
303 | | uint32_hilbert(uint32_t px, uint32_t py) |
304 | 0 | { |
305 | 0 | uint64_t x = px; |
306 | 0 | uint64_t y = py; |
307 | |
|
308 | 0 | uint64_t A, B, C, D; |
309 | 0 | uint64_t a, b, c, d; |
310 | 0 | uint64_t i0, i1; |
311 | | |
312 | | // Initial prefix scan round, prime with x and y |
313 | 0 | { |
314 | 0 | a = x ^ y; |
315 | 0 | b = 0xFFFFFFFFULL ^ a; |
316 | 0 | c = 0xFFFFFFFFULL ^ (x | y); |
317 | 0 | d = x & (y ^ 0xFFFFFFFFULL); |
318 | |
|
319 | 0 | A = a | (b >> 1); |
320 | 0 | B = (a >> 1) ^ a; |
321 | 0 | C = ((c >> 1) ^ (b & (d >> 1))) ^ c; |
322 | 0 | D = ((a & (c >> 1)) ^ (d >> 1)) ^ d; |
323 | 0 | } |
324 | |
|
325 | 0 | { |
326 | 0 | a = A; |
327 | 0 | b = B; |
328 | 0 | c = C; |
329 | 0 | d = D; |
330 | |
|
331 | 0 | A = ((a & (a >> 2)) ^ (b & (b >> 2))); |
332 | 0 | B = ((a & (b >> 2)) ^ (b & ((a ^ b) >> 2))); |
333 | 0 | C ^= ((a & (c >> 2)) ^ (b & (d >> 2))); |
334 | 0 | D ^= ((b & (c >> 2)) ^ ((a ^ b) & (d >> 2))); |
335 | 0 | } |
336 | |
|
337 | 0 | { |
338 | 0 | a = A; |
339 | 0 | b = B; |
340 | 0 | c = C; |
341 | 0 | d = D; |
342 | |
|
343 | 0 | A = ((a & (a >> 4)) ^ (b & (b >> 4))); |
344 | 0 | B = ((a & (b >> 4)) ^ (b & ((a ^ b) >> 4))); |
345 | 0 | C ^= ((a & (c >> 4)) ^ (b & (d >> 4))); |
346 | 0 | D ^= ((b & (c >> 4)) ^ ((a ^ b) & (d >> 4))); |
347 | 0 | } |
348 | |
|
349 | 0 | { |
350 | 0 | a = A; |
351 | 0 | b = B; |
352 | 0 | c = C; |
353 | 0 | d = D; |
354 | |
|
355 | 0 | A = ((a & (a >> 8)) ^ (b & (b >> 8))); |
356 | 0 | B = ((a & (b >> 8)) ^ (b & ((a ^ b) >> 8))); |
357 | 0 | C ^= ((a & (c >> 8)) ^ (b & (d >> 8))); |
358 | 0 | D ^= ((b & (c >> 8)) ^ ((a ^ b) & (d >> 8))); |
359 | 0 | } |
360 | |
|
361 | 0 | { |
362 | 0 | a = A; |
363 | 0 | b = B; |
364 | 0 | c = C; |
365 | 0 | d = D; |
366 | |
|
367 | 0 | C ^= ((a & (c >> 16)) ^ (b & (d >> 16))); |
368 | 0 | D ^= ((b & (c >> 16)) ^ ((a ^ b) & (d >> 16))); |
369 | 0 | } |
370 | | |
371 | | // Undo transformation prefix scan |
372 | 0 | a = C ^ (C >> 1); |
373 | 0 | b = D ^ (D >> 1); |
374 | | |
375 | | // Recover index bits |
376 | 0 | i0 = x ^ y; |
377 | 0 | i1 = b | (0xFFFFFFFFULL ^ (i0 | a)); |
378 | |
|
379 | 0 | return uint64_interleave_2(i0, i1); |
380 | 0 | } Unexecuted instantiation: geojson_import_fuzzer.cpp:uint32_hilbert(unsigned int, unsigned int) Unexecuted instantiation: lwgeom.c:uint32_hilbert Unexecuted instantiation: lwpoint.c:uint32_hilbert Unexecuted instantiation: lwline.c:uint32_hilbert Unexecuted instantiation: lwpoly.c:uint32_hilbert Unexecuted instantiation: lwtriangle.c:uint32_hilbert Unexecuted instantiation: lwmpoint.c:uint32_hilbert Unexecuted instantiation: lwmline.c:uint32_hilbert Unexecuted instantiation: lwmpoly.c:uint32_hilbert Unexecuted instantiation: lwcollection.c:uint32_hilbert Unexecuted instantiation: lwcircstring.c:uint32_hilbert Unexecuted instantiation: lwcompound.c:uint32_hilbert Unexecuted instantiation: lwcurvepoly.c:uint32_hilbert Unexecuted instantiation: lwpsurface.c:uint32_hilbert Unexecuted instantiation: lwtin.c:uint32_hilbert Unexecuted instantiation: lwin_geojson.c:uint32_hilbert Unexecuted instantiation: lwiterator.c:uint32_hilbert Unexecuted instantiation: lwout_wkt.c:uint32_hilbert Unexecuted instantiation: lwutil.c:uint32_hilbert Unexecuted instantiation: lwhomogenize.c:uint32_hilbert Unexecuted instantiation: lwalgorithm.c:uint32_hilbert Unexecuted instantiation: lwstroke.c:uint32_hilbert Unexecuted instantiation: lwprint.c:uint32_hilbert Unexecuted instantiation: gbox.c:uint32_hilbert Unexecuted instantiation: lwgeodetic.c:uint32_hilbert Unexecuted instantiation: lwgeom_geos.c:uint32_hilbert Unexecuted instantiation: lwgeom_geos_node.c:uint32_hilbert Unexecuted instantiation: lwgeom_geos_split.c:uint32_hilbert Unexecuted instantiation: lwnurbscurve.c:uint32_hilbert Unexecuted instantiation: lwspheroid.c:uint32_hilbert Unexecuted instantiation: stringbuffer.c:uint32_hilbert Unexecuted instantiation: measures.c:uint32_hilbert Unexecuted instantiation: measures3d.c:uint32_hilbert Unexecuted instantiation: ptarray.c:uint32_hilbert Unexecuted instantiation: lwgeom_api.c:uint32_hilbert Unexecuted instantiation: lwout_wkb.c:uint32_hilbert Unexecuted instantiation: lwlinearreferencing.c:uint32_hilbert |
381 | | |
382 | | /* |
383 | | * This macro is based on PG_FREE_IF_COPY, except that it accepts two pointers. |
384 | | * See PG_FREE_IF_COPY comment in src/include/fmgr.h in postgres source code |
385 | | * for more details. |
386 | | */ |
387 | | #define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori) \ |
388 | | do \ |
389 | | { \ |
390 | | if ((Pointer)(ptrsrc) != (Pointer)(ptrori)) \ |
391 | | pfree(ptrsrc); \ |
392 | | } while (0) |