@@ -66,7 +66,6 @@ namespace zk {
6666#else
6767 #define ZERO_MEM (member ) bzero(&(member), sizeof (member))
6868#endif
69- #define _LL_CAST_ (long long )
7069#define _LLP_CAST_ (long long *)
7170
7271#define THROW_IF_NOT (condition, text ) if (!(condition)) { \
@@ -514,7 +513,7 @@ class ZooKeeper: public Nan::ObjectWrap {
514513 static Local<String> idAsString (int64_t id) {
515514 Nan::EscapableHandleScope scope;
516515 char idbuff [128 ] = {0 };
517- sprintf (idbuff, " %llx" , _LL_CAST_ id);
516+ snprintf (idbuff, sizeof (idbuff), " %llx" , ( unsigned long long ) id);
518517 return scope.Escape (LOCAL_STRING (idbuff));
519518 }
520519
@@ -1027,7 +1026,7 @@ class ZooKeeper: public Nan::ObjectWrap {
10271026 CALLBACK_EPILOG ();
10281027 }
10291028
1030- static NAN_PROPERTY_GETTER (StatePropertyGetter) {
1029+ static NAN_GETTER (StatePropertyGetter) {
10311030 assert (info.This ().IsEmpty () == false );
10321031 assert (info.This ()->IsObject ());
10331032 ZooKeeper *zk = ObjectWrap::Unwrap<ZooKeeper>(info.This ());
@@ -1036,25 +1035,25 @@ class ZooKeeper: public Nan::ObjectWrap {
10361035 RETURN_VALUE (info, Nan::New<Integer> (zk->zhandle != 0 ? zoo_state (zk->zhandle ) : 0 ));
10371036 }
10381037
1039- static NAN_PROPERTY_GETTER (ClientidPropertyGetter) {
1038+ static NAN_GETTER (ClientidPropertyGetter) {
10401039 ZooKeeper *zk = ObjectWrap::Unwrap<ZooKeeper>(info.This ());
10411040 assert (zk);
10421041 RETURN_VALUE (info, zk->idAsString (zk->zhandle != 0 ? zoo_client_id (zk->zhandle )->client_id : zk->myid .client_id ));
10431042 }
10441043
1045- static NAN_PROPERTY_GETTER (ClientPasswordPropertyGetter) {
1044+ static NAN_GETTER (ClientPasswordPropertyGetter) {
10461045 ZooKeeper *zk = ObjectWrap::Unwrap<ZooKeeper>(info.This ());
10471046 assert (zk);
10481047 RETURN_VALUE (info, zk->PasswordToHexString (zk->zhandle != 0 ? zoo_client_id (zk->zhandle )->passwd : zk->myid .passwd ));
10491048 }
10501049
1051- static NAN_PROPERTY_GETTER (SessionTimeoutPropertyGetter) {
1050+ static NAN_GETTER (SessionTimeoutPropertyGetter) {
10521051 ZooKeeper *zk = ObjectWrap::Unwrap<ZooKeeper>(info.This ());
10531052 assert (zk);
10541053 RETURN_VALUE (info, Nan::New<Integer> (zk->zhandle != 0 ? zoo_recv_timeout (zk->zhandle ) : -1 ));
10551054 }
10561055
1057- static NAN_PROPERTY_GETTER (IsUnrecoverablePropertyGetter) {
1056+ static NAN_GETTER (IsUnrecoverablePropertyGetter) {
10581057 ZooKeeper *zk = ObjectWrap::Unwrap<ZooKeeper>(info.This ());
10591058 assert (zk);
10601059 RETURN_VALUE (info, Nan::New<Integer> (zk->zhandle != 0 ? is_unrecoverable (zk->zhandle ) : 0 ));
0 commit comments