Skip to content

Commit

Permalink
Merge pull request #36 from orangejulius/remove_eio_references
Browse files Browse the repository at this point in the history
Rename async methods with lingering EIO references
  • Loading branch information
orangejulius committed May 12, 2016
2 parents b155bca + 6892daf commit 46feeca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cpp/geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
bool result; \
} geosmethod##_baton_t; \
\
void Geometry::EIO_##cppmethod(uv_work_t *req) { \
void Geometry::cppmethod##Async(uv_work_t *req) { \
geosmethod##_baton_t *closure = static_cast<geosmethod##_baton_t *>(req->data); \
closure->result = closure->geom->_geom->geosmethod(); \
} \
\
void Geometry::EIO_After##cppmethod(uv_work_t *req, int status) { \
void Geometry::cppmethod##AsyncComplete(uv_work_t *req, int status) { \
Isolate* isolate = Isolate::GetCurrent(); \
HandleScope scope(isolate); \
\
Expand Down Expand Up @@ -55,7 +55,7 @@
closure->cb.Reset(isolate, Local<Function>::Cast(args[0])); \
uv_work_t *req = new uv_work_t; \
req->data = closure; \
uv_queue_work(uv_default_loop(), req, EIO_##cppmethod, EIO_After##cppmethod);\
uv_queue_work(uv_default_loop(), req, cppmethod##Async, cppmethod##AsyncComplete);\
geom->Ref(); \
args.GetReturnValue().Set(Undefined(isolate)); \
} else { \
Expand All @@ -82,12 +82,12 @@
bool result; \
} geosmethod##_baton_t; \
\
void Geometry::EIO_##cppmethod(uv_work_t *req) { \
void Geometry::cppmethod##Async(uv_work_t *req) { \
geosmethod##_baton_t *closure = static_cast<geosmethod##_baton_t *>(req->data); \
closure->result = closure->geom->_geom->geosmethod(closure->geom2->_geom); \
} \
\
void Geometry::EIO_After##cppmethod(uv_work_t *req, int status) { \
void Geometry::cppmethod##AsyncComplete(uv_work_t *req, int status) { \
Isolate* isolate = Isolate::GetCurrent(); \
HandleScope scope(isolate); \
\
Expand Down Expand Up @@ -126,7 +126,7 @@
closure->cb.Reset(isolate, Persistent<Function>(isolate, f)); \
uv_work_t *req = new uv_work_t; \
req->data = closure; \
uv_queue_work(uv_default_loop(), req, EIO_##cppmethod, EIO_After##cppmethod);\
uv_queue_work(uv_default_loop(), req, cppmethod##Async, cppmethod##AsyncComplete);\
geom->Ref(); \
geom2->_ref(); \
args.GetReturnValue().Set(Undefined(isolate)); \
Expand Down Expand Up @@ -169,8 +169,8 @@

#define NODE_GEOS_V8_FUNCTION(cppmethod) \
static void cppmethod(const FunctionCallbackInfo<Value>& args); \
static void EIO_##cppmethod(uv_work_t *req); \
static void EIO_After##cppmethod(uv_work_t *req, int status); \
static void cppmethod##Async(uv_work_t *req); \
static void cppmethod##AsyncComplete(uv_work_t *req, int status); \

class Geometry : public ObjectWrap {
public:
Expand Down

0 comments on commit 46feeca

Please sign in to comment.