Skip to content

Commit 0326d89

Browse files
committed
remove unneccesary compat calls
1 parent 126582e commit 0326d89

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

deps/build.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using BinDeps, Compat
22
@BinDeps.setup
33

44
libgeos = library_dependency("libgeos",aliases=["libgeos_c", "libgeos_c-1"], validate = function(path, handle)
5-
return @compat(Libdl.dlsym_e(handle,:initGEOS)) != C_NULL && @compat(Libdl.dlsym_e(handle,:GEOSDelaunayTriangulation)) != C_NULL
5+
return Libdl.dlsym_e(handle,:initGEOS) != C_NULL && Libdl.dlsym_e(handle,:GEOSDelaunayTriangulation) != C_NULL
66
end)
77

88
version = "3.4.2"
@@ -13,19 +13,19 @@ provides(BuildProcess,Autotools(libtarget = "capi/.libs/libgeos_c."*BinDeps.shli
1313
# TODO: provides(Yum,"libgeos-dev", libgeos)
1414
# TODO: provides(Pacman,"libgeos-dev", libgeos)
1515

16-
@windows_only begin
16+
if is_windows()
1717
using WinRPM
1818
push!(WinRPM.sources, "http://download.opensuse.org/repositories/home:yeesian/openSUSE_13.2")
1919
WinRPM.update()
2020
provides(WinRPM.RPM, "libgeos", [libgeos], os = :Windows)
2121
end
2222

23-
@osx_only begin
23+
if is_apple()
2424
if Pkg.installed("Homebrew") === nothing
2525
error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")")
2626
end
2727
using Homebrew
2828
provides(Homebrew.HB, "geos", libgeos, os = :Darwin)
2929
end
3030

31-
@BinDeps.install @compat Dict(:libgeos => :libgeos)
31+
@BinDeps.install Dict(:libgeos => :libgeos)

src/geos_functions.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
# GEOSGeom objects to avoid memory leaks, and to GEOSFree()
66
# all returned char * (unless const).
77

8-
GEOMTYPE = @compat Dict( GEOS_POINT => :Point,
9-
GEOS_LINESTRING => :LineString,
10-
GEOS_LINEARRING => :LinearRing,
11-
GEOS_POLYGON => :Polygon,
12-
GEOS_MULTIPOINT => :MultiPoint,
13-
GEOS_MULTILINESTRING => :MultiLineString,
14-
GEOS_MULTIPOLYGON => :MultiPolygon,
15-
GEOS_GEOMETRYCOLLECTION => :GeometryCollection)
8+
GEOMTYPE = Dict( GEOS_POINT => :Point,
9+
GEOS_LINESTRING => :LineString,
10+
GEOS_LINEARRING => :LinearRing,
11+
GEOS_POLYGON => :Polygon,
12+
GEOS_MULTIPOINT => :MultiPoint,
13+
GEOS_MULTILINESTRING => :MultiLineString,
14+
GEOS_MULTIPOLYGON => :MultiPolygon,
15+
GEOS_GEOMETRYCOLLECTION => :GeometryCollection)
1616

1717

1818
function geomFromWKT(geom::Compat.ASCIIString)
@@ -22,7 +22,7 @@ function geomFromWKT(geom::Compat.ASCIIString)
2222
end
2323
result
2424
end
25-
geomToWKT(geom::Ptr{GEOSGeometry}) = Compat.unsafe_string(GEOSGeomToWKT(geom))
25+
geomToWKT(geom::Ptr{GEOSGeometry}) = unsafe_string(GEOSGeomToWKT(geom))
2626

2727
# -----
2828
# Coordinate Sequence functions
@@ -113,7 +113,7 @@ let out = Array(UInt32, 1)
113113
if result == 0
114114
error("LibGEOS: Error in GEOSCoordSeq_getSize")
115115
end
116-
@compat Int(out[1])
116+
Int(out[1])
117117
end
118118
end
119119

@@ -125,7 +125,7 @@ let out = Array(UInt32, 1)
125125
if result == 0
126126
error("LibGEOS: Error in GEOSCoordSeq_getDimensions")
127127
end
128-
@compat Int(out[1])
128+
Int(out[1])
129129
end
130130
end
131131

@@ -288,7 +288,7 @@ end
288288
# The user can control the accuracy of the curve approximation by specifying the number of linear segments with which to approximate a curve.
289289

290290
# Always returns a polygon. The negative or zero-distance buffer of lines and points is always an empty Polygon.
291-
buffer(ptr::GEOSGeom, width::Real, quadsegs::Integer=8) = GEOSBuffer(ptr, width, @compat(Int32(quadsegs)))
291+
buffer(ptr::GEOSGeom, width::Real, quadsegs::Integer=8) = GEOSBuffer(ptr, width, Int32(quadsegs))
292292

293293
# enum GEOSBufCapStyles
294294
# enum GEOSBufJoinStyles
@@ -552,7 +552,7 @@ end
552552
#
553553
# @return a newly allocated geometry, or NULL on exception
554554
function delaunayTriangulation(ptr::GEOSGeom, tol::Real=0.0, onlyEdges::Bool=false)
555-
result = GEOSDelaunayTriangulation(ptr, tol, @compat(Int32(onlyEdges)))
555+
result = GEOSDelaunayTriangulation(ptr, tol, Int32(onlyEdges))
556556
if result == C_NULL
557557
error("LibGEOS: Error in GEOSDelaunayTriangulation")
558558
end

src/geos_operations.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ isClosed(obj::LineString) = isClosed(obj.ptr) # Call only on LINESTRING
278278
# # Up to GEOS 3.2.0 the input geometry must be a Collection, in
279279
# # later version it doesn't matter (i.e. getGeometryN(0) for a single will return the input).
280280
# function getGeometry(ptr::GEOSGeom, n::Integer)
281-
# result = GEOSGetGeometryN(ptr, @compat(Int32(n-1)))
281+
# result = GEOSGetGeometryN(ptr, Int32(n-1))
282282
# if result == C_NULL
283283
# error("LibGEOS: Error in GEOSGetGeometryN")
284284
# end
@@ -344,7 +344,7 @@ exteriorRing(obj::Polygon) = LinearRing(exteriorRing(obj.ptr))
344344

345345
# # Call only on LINESTRING, and must be freed by caller (Returns NULL on exception)
346346
# function getPoint(ptr::GEOSGeom, n::Integer)
347-
# result = GEOSGeomGetPointN(ptr, @compat(Int32(n-1)))
347+
# result = GEOSGeomGetPointN(ptr, Int32(n-1))
348348
# if result == C_NULL
349349
# error("LibGEOS: Error in GEOSGeomGetPointN")
350350
# end
@@ -386,4 +386,3 @@ for g1 in (:Point, :MultiPoint, :LineString, :MultiLineString, :LinearRing, :Pol
386386
end
387387
end
388388
end
389-

0 commit comments

Comments
 (0)