Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
lwgeom_geos.c: clean up copy-paste #217
A large part of
There are a number of similar headers/footers and error clean up branches. "Let's do this on exit" or "let's validate input more thoroughly for paranoia mode" aren't easy as they will lead to increasingly more copy-paste.
Copy-paste artifacts in comments and error messages are also cleaned up.
There are several cases were
const can be removed (returning a const int is the same as returning an int). Also, as srid can be positive I think
int32_t is better than
uint32_t (it's been used several times more than what I initially pointed out).
I get a new issue with the sanitizers (apart from the ones pending in my PR, and a whole lot of memory access issues coming from geos itself):
Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x55699a33e3c1 in __interceptor_malloc (/home/raul/dev/public/postgis/liblwgeom/cunit/.libs/lt-cu_tester+0x13b3c1) #1 0x7fb9c41da4cd in lwcollection_clone_deep /home/raul/dev/public/postgis/liblwgeom/lwcollection.c:152:22 #2 0x7fb9c41c794f in lwgeom_clone_deep /home/raul/dev/public/postgis/liblwgeom/lwgeom.c:543:20 #3 0x7fb9c426a634 in lwgeom_linemerge /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:623:29 #4 0x55699a38ef16 in test_geos_linemerge /home/raul/dev/public/postgis/liblwgeom/cunit/cu_geos.c:88:10 #5 0x7fb9c3d26087 in run_single_test.constprop.5 /tmp/yaourt-tmp-raul/aur-cunit/src/CUnit-2.1-3/CUnit/Sources/Framework/TestRun.c:991
return in lwgeom_linemerge?