Skip to content

Commit cf4be6b

Browse files
committed
more small fixes
1 parent 9b2c1cb commit cf4be6b

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ node_js:
33
- "0.11"
44
- "0.10"
55
- "0.8"
6-
- "0.6"

src/node_snap7_client.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ namespace node_snap7{
407407
return NanThrowTypeError("Wrong arguments");
408408

409409
if (!args[6]->IsFunction()){
410-
NanReturnValue(NanNew<v8::Boolean>(s7client->snap7Client->WriteArea(args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value(), args[3]->Int32Value(), args[4]->Int32Value(), node::Buffer::Data(args[5])) == 0));
410+
NanReturnValue(NanNew<v8::Boolean>(s7client->snap7Client->WriteArea(args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value(), args[3]->Int32Value(), args[4]->Int32Value(), node::Buffer::Data(args[5].As<v8::Object>())) == 0));
411411
}
412412
else{
413413
NanCallback *callback = new NanCallback(args[6].As<v8::Function>());
414-
NanAsyncQueueWorker(new IOWorker(callback, s7client, WRITEAREA, args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value(), args[3]->Int32Value(), args[4]->Uint32Value(), node::Buffer::Data(args[5])));
414+
NanAsyncQueueWorker(new IOWorker(callback, s7client, WRITEAREA, args[0]->Int32Value(), args[1]->Int32Value(), args[2]->Int32Value(), args[3]->Int32Value(), args[4]->Uint32Value(), node::Buffer::Data(args[5].As<v8::Object>())));
415415
NanReturnUndefined();
416416
}
417417
}
@@ -553,7 +553,7 @@ namespace node_snap7{
553553
Items[i].DBNumber = data_obj->Get(NanNew<v8::String>("DBNumber"))->Int32Value();
554554
Items[i].Start = data_obj->Get(NanNew<v8::String>("Start"))->Int32Value();
555555
Items[i].Amount = data_obj->Get(NanNew<v8::String>("Amount"))->Int32Value();
556-
Items[i].pdata = node::Buffer::Data(data_obj->Get(NanNew<v8::String>("Data")));
556+
Items[i].pdata = node::Buffer::Data(data_obj->Get(NanNew<v8::String>("Data")).As<v8::Object>());
557557
}
558558

559559
int returnValue = s7client->snap7Client->WriteMultiVars(Items, len);
@@ -663,7 +663,7 @@ namespace node_snap7{
663663

664664
PS7BlockInfo BlockInfo = new TS7BlockInfo;
665665

666-
int returnValue = s7client->snap7Client->GetPgBlockInfo(node::Buffer::Data(args[0]), BlockInfo, node::Buffer::Length(args[0]));
666+
int returnValue = s7client->snap7Client->GetPgBlockInfo(node::Buffer::Data(args[0].As<v8::Object>()), BlockInfo, node::Buffer::Length(args[0].As<v8::Object>()));
667667

668668
v8::Local<v8::Object> block_info = NanNew<v8::Object>();
669669
block_info->Set(NanNew<v8::String>("BlkType"), NanNew<v8::Number>(BlockInfo->BlkType));
@@ -784,7 +784,7 @@ namespace node_snap7{
784784

785785

786786
if (!args[2]->IsFunction()){
787-
NanReturnValue(NanNew<v8::Boolean>(s7client->snap7Client->Download(args[0]->Int32Value(), node::Buffer::Data(args[1]), node::Buffer::Length(args[1])) == 0));
787+
NanReturnValue(NanNew<v8::Boolean>(s7client->snap7Client->Download(args[0]->Int32Value(), node::Buffer::Data(args[1].As<v8::Object>()), node::Buffer::Length(args[1].As<v8::Object>())) == 0));
788788
}
789789
else{
790790
NanReturnUndefined();

0 commit comments

Comments
 (0)