Skip to content

Commit cf80089

Browse files
danbevMylesBorins
authored andcommitted
src: node_dtrace line continuations clean up
PR-URL: #15777 Reviewed-By: Lance Ball <lball@redhat.com>
1 parent 0f23836 commit cf80089

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

src/node_dtrace.cc

+59-59
Original file line numberDiff line numberDiff line change
@@ -41,76 +41,76 @@ using v8::Object;
4141
using v8::String;
4242
using v8::Value;
4343

44-
#define SLURP_STRING(obj, member, valp) \
45-
if (!(obj)->IsObject()) { \
46-
return env->ThrowError( \
44+
#define SLURP_STRING(obj, member, valp) \
45+
if (!(obj)->IsObject()) { \
46+
return env->ThrowError( \
4747
"expected object for " #obj " to contain string member " #member); \
48-
} \
49-
node::Utf8Value _##member(env->isolate(), \
50-
obj->Get(OneByteString(env->isolate(), #member))); \
51-
if ((*(const char **)valp = *_##member) == nullptr) \
48+
} \
49+
node::Utf8Value _##member(env->isolate(), \
50+
obj->Get(OneByteString(env->isolate(), #member))); \
51+
if ((*(const char **)valp = *_##member) == nullptr) \
5252
*(const char **)valp = "<unknown>";
5353

54-
#define SLURP_INT(obj, member, valp) \
55-
if (!(obj)->IsObject()) { \
56-
return env->ThrowError( \
57-
"expected object for " #obj " to contain integer member " #member); \
58-
} \
59-
*valp = obj->Get(OneByteString(env->isolate(), #member)) \
54+
#define SLURP_INT(obj, member, valp) \
55+
if (!(obj)->IsObject()) { \
56+
return env->ThrowError( \
57+
"expected object for " #obj " to contain integer member " #member); \
58+
} \
59+
*valp = obj->Get(OneByteString(env->isolate(), #member)) \
6060
->Int32Value();
6161

62-
#define SLURP_OBJECT(obj, member, valp) \
63-
if (!(obj)->IsObject()) { \
64-
return env->ThrowError( \
65-
"expected object for " #obj " to contain object member " #member); \
66-
} \
62+
#define SLURP_OBJECT(obj, member, valp) \
63+
if (!(obj)->IsObject()) { \
64+
return env->ThrowError( \
65+
"expected object for " #obj " to contain object member " #member); \
66+
} \
6767
*valp = Local<Object>::Cast(obj->Get(OneByteString(env->isolate(), #member)));
6868

69-
#define SLURP_CONNECTION(arg, conn) \
70-
if (!(arg)->IsObject()) { \
71-
return env->ThrowError( \
72-
"expected argument " #arg " to be a connection object"); \
73-
} \
74-
node_dtrace_connection_t conn; \
75-
Local<Object> _##conn = Local<Object>::Cast(arg); \
76-
Local<Value> _handle = \
77-
(_##conn)->Get(FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")); \
78-
if (_handle->IsObject()) { \
79-
SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
80-
} else { \
81-
conn.fd = -1; \
82-
} \
83-
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
84-
SLURP_INT(_##conn, remotePort, &conn.port); \
69+
#define SLURP_CONNECTION(arg, conn) \
70+
if (!(arg)->IsObject()) { \
71+
return env->ThrowError( \
72+
"expected argument " #arg " to be a connection object"); \
73+
} \
74+
node_dtrace_connection_t conn; \
75+
Local<Object> _##conn = Local<Object>::Cast(arg); \
76+
Local<Value> _handle = \
77+
(_##conn)->Get(FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")); \
78+
if (_handle->IsObject()) { \
79+
SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
80+
} else { \
81+
conn.fd = -1; \
82+
} \
83+
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
84+
SLURP_INT(_##conn, remotePort, &conn.port); \
8585
SLURP_INT(_##conn, bufferSize, &conn.buffered);
8686

87-
#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \
88-
if (!(arg)->IsObject()) { \
89-
return env->ThrowError( \
90-
"expected argument " #arg " to be a connection object"); \
91-
} \
92-
node_dtrace_connection_t conn; \
93-
Local<Object> _##conn = Local<Object>::Cast(arg); \
94-
SLURP_INT(_##conn, fd, &conn.fd); \
95-
SLURP_STRING(_##conn, host, &conn.remote); \
96-
SLURP_INT(_##conn, port, &conn.port); \
87+
#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \
88+
if (!(arg)->IsObject()) { \
89+
return env->ThrowError( \
90+
"expected argument " #arg " to be a connection object"); \
91+
} \
92+
node_dtrace_connection_t conn; \
93+
Local<Object> _##conn = Local<Object>::Cast(arg); \
94+
SLURP_INT(_##conn, fd, &conn.fd); \
95+
SLURP_STRING(_##conn, host, &conn.remote); \
96+
SLURP_INT(_##conn, port, &conn.port); \
9797
SLURP_INT(_##conn, bufferSize, &conn.buffered);
9898

99-
#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \
100-
if (!(arg0)->IsObject()) { \
101-
return env->ThrowError( \
102-
"expected argument " #arg0 " to be a connection object"); \
103-
} \
104-
if (!(arg1)->IsObject()) { \
105-
return env->ThrowError( \
106-
"expected argument " #arg1 " to be a connection object"); \
107-
} \
108-
node_dtrace_connection_t conn; \
109-
Local<Object> _##conn = Local<Object>::Cast(arg0); \
110-
SLURP_INT(_##conn, fd, &conn.fd); \
111-
SLURP_INT(_##conn, bufferSize, &conn.buffered); \
112-
_##conn = Local<Object>::Cast(arg1); \
113-
SLURP_STRING(_##conn, host, &conn.remote); \
99+
#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \
100+
if (!(arg0)->IsObject()) { \
101+
return env->ThrowError( \
102+
"expected argument " #arg0 " to be a connection object"); \
103+
} \
104+
if (!(arg1)->IsObject()) { \
105+
return env->ThrowError( \
106+
"expected argument " #arg1 " to be a connection object"); \
107+
} \
108+
node_dtrace_connection_t conn; \
109+
Local<Object> _##conn = Local<Object>::Cast(arg0); \
110+
SLURP_INT(_##conn, fd, &conn.fd); \
111+
SLURP_INT(_##conn, bufferSize, &conn.buffered); \
112+
_##conn = Local<Object>::Cast(arg1); \
113+
SLURP_STRING(_##conn, host, &conn.remote); \
114114
SLURP_INT(_##conn, port, &conn.port);
115115

116116

0 commit comments

Comments
 (0)