From a7f97ad7d7613d1129a6f0344506a12ff0d46c78 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Aug 27 2015 20:43:53 +0000 Subject: fixes --- diff --git a/c++/contourgl/cl/hello.cl b/c++/contourgl/cl/hello.cl index 7d453ad..b93cfc1 100644 --- a/c++/contourgl/cl/hello.cl +++ b/c++/contourgl/cl/hello.cl @@ -1,5 +1,5 @@ -//#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable __constant char s[] = "Hello!"; + __kernel void hello(__global char *out) { size_t tid = get_global_id(0); out[tid] = s[tid]; diff --git a/c++/contourgl/polyspan.cpp b/c++/contourgl/polyspan.cpp index 6967c88..2e39124 100644 --- a/c++/contourgl/polyspan.cpp +++ b/c++/contourgl/polyspan.cpp @@ -260,7 +260,7 @@ void Polyspan::line_to(Real x, Real y) { flags |= NotClosed | NotSorted; } -bool Polyspan::clip_conic(const Vector * const p, const ContextRect &r) { +bool Polyspan::clip_conic(const Vector *p, const ContextRect &r) { const Real minx = min(min(p[0][0], p[1][0]), p[2][0]); const Real miny = min(min(p[0][1], p[1][1]), p[2][1]); const Real maxx = max(max(p[0][0], p[1][0]), p[2][0]); @@ -272,7 +272,7 @@ bool Polyspan::clip_conic(const Vector * const p, const ContextRect &r) { (maxy < r.miny); } -Real Polyspan::max_edges_conic(const Vector *const p) { +Real Polyspan::max_edges_conic(const Vector *p) { const Real x1 = p[1][0] - p[0][0]; const Real y1 = p[1][1] - p[0][1]; @@ -389,14 +389,14 @@ void Polyspan::conic_to(Real x1, Real y1, Real x, Real y) { } } -bool Polyspan::clip_cubic(const Vector *const p, const ContextRect &r) { +bool Polyspan::clip_cubic(const Vector *p, const ContextRect &r) { return ((p[0][0] > r.maxx) && (p[1][0] > r.maxx) && (p[2][0] > r.maxx) && (p[3][0] > r.maxx)) || ((p[0][0] < r.minx) && (p[1][0] < r.minx) && (p[2][0] < r.minx) && (p[3][0] < r.minx)) || ((p[0][1] > r.maxy) && (p[1][1] > r.maxy) && (p[2][1] > r.maxy) && (p[3][1] > r.maxy)) || ((p[0][1] < r.miny) && (p[1][1] < r.miny) && (p[2][1] < r.miny) && (p[3][1] < r.miny)); } -Real Polyspan::max_edges_cubic(const Vector *const p) { +Real Polyspan::max_edges_cubic(const Vector *p) { const Real x1 = p[1][0] - p[0][0]; const Real y1 = p[1][1] - p[0][1]; diff --git a/c++/contourgl/polyspan.h b/c++/contourgl/polyspan.h index c0267fc..bb19648 100644 --- a/c++/contourgl/polyspan.h +++ b/c++/contourgl/polyspan.h @@ -87,12 +87,12 @@ private: //move to the next cell (cover values 0 initially), keeping the current if necessary void move_pen(int x, int y); - static bool clip_conic(const Vector *const p, const ContextRect &r); - static Real max_edges_conic(const Vector *const p); + static bool clip_conic(const Vector *p, const ContextRect &r); + static Real max_edges_conic(const Vector *p); static void subd_conic_stack(Vector *arc); - static bool clip_cubic(const Vector *const p, const ContextRect &r); - static Real max_edges_cubic(const Vector *const p); + static bool clip_cubic(const Vector *p, const ContextRect &r); + static Real max_edges_cubic(const Vector *p); static void subd_cubic_stack(Vector *arc); public: