Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
OCDoResource: Initialize structure by assignment
Browse files Browse the repository at this point in the history
Fixes gh-3
  • Loading branch information
Gabriel Schulhof committed Jun 3, 2015
1 parent 561e217 commit 947f11a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/functions/oc-do-resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ NAN_METHOD(bind_OCDoResource) {

OCHeaderOption *options = 0;
OCDoHandle handle;
OCCallbackData data = {0, defaultOCClientResponseHandler,
(OCClientContextDeleter)persistentJSCallback_free};

VALIDATE_ARGUMENT_COUNT(args, 9);
VALIDATE_ARGUMENT_TYPE(args, 0, IsObject);
Expand All @@ -97,8 +95,10 @@ NAN_METHOD(bind_OCDoResource) {
VALIDATE_ARGUMENT_TYPE_OR_NULL(args, 8, IsArray);
VALIDATE_ARGUMENT_TYPE(args, 9, IsUint32);

data.context =
(void *)persistentJSCallback_new(Local<Function>::Cast(args[7]));
OCCallbackData data(
(void *)persistentJSCallback_new(Local<Function>::Cast(args[7])),
defaultOCClientResponseHandler,
(OCClientContextDeleter)persistentJSCallback_free );

if (args[8]->IsArray()) {
options = oc_header_options_new(Handle<Array>::Cast(args[8]));
Expand Down

1 comment on commit 947f11a

@poussa
Copy link

@poussa poussa commented on 947f11a Jun 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works with Ubuntu 14.04 LTS (gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2)

Merge to master.

Please sign in to comment.