Skip to content

Commit 824be6d

Browse files
danbevtargos
authored andcommitted
src: node_dtrace line continuations clean up
PR-URL: #15777 Reviewed-By: Lance Ball <lball@redhat.com>
1 parent 859ce10 commit 824be6d

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
@@ -59,76 +59,76 @@ using v8::Object;
5959
using v8::String;
6060
using v8::Value;
6161

62-
#define SLURP_STRING(obj, member, valp) \
63-
if (!(obj)->IsObject()) { \
64-
return env->ThrowError( \
62+
#define SLURP_STRING(obj, member, valp) \
63+
if (!(obj)->IsObject()) { \
64+
return env->ThrowError( \
6565
"expected object for " #obj " to contain string member " #member); \
66-
} \
67-
node::Utf8Value _##member(env->isolate(), \
68-
obj->Get(OneByteString(env->isolate(), #member))); \
69-
if ((*(const char **)valp = *_##member) == nullptr) \
66+
} \
67+
node::Utf8Value _##member(env->isolate(), \
68+
obj->Get(OneByteString(env->isolate(), #member))); \
69+
if ((*(const char **)valp = *_##member) == nullptr) \
7070
*(const char **)valp = "<unknown>";
7171

72-
#define SLURP_INT(obj, member, valp) \
73-
if (!(obj)->IsObject()) { \
74-
return env->ThrowError( \
75-
"expected object for " #obj " to contain integer member " #member); \
76-
} \
77-
*valp = obj->Get(OneByteString(env->isolate(), #member)) \
72+
#define SLURP_INT(obj, member, valp) \
73+
if (!(obj)->IsObject()) { \
74+
return env->ThrowError( \
75+
"expected object for " #obj " to contain integer member " #member); \
76+
} \
77+
*valp = obj->Get(OneByteString(env->isolate(), #member)) \
7878
->Int32Value();
7979

80-
#define SLURP_OBJECT(obj, member, valp) \
81-
if (!(obj)->IsObject()) { \
82-
return env->ThrowError( \
83-
"expected object for " #obj " to contain object member " #member); \
84-
} \
80+
#define SLURP_OBJECT(obj, member, valp) \
81+
if (!(obj)->IsObject()) { \
82+
return env->ThrowError( \
83+
"expected object for " #obj " to contain object member " #member); \
84+
} \
8585
*valp = Local<Object>::Cast(obj->Get(OneByteString(env->isolate(), #member)));
8686

87-
#define SLURP_CONNECTION(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-
Local<Value> _handle = \
95-
(_##conn)->Get(FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")); \
96-
if (_handle->IsObject()) { \
97-
SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
98-
} else { \
99-
conn.fd = -1; \
100-
} \
101-
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
102-
SLURP_INT(_##conn, remotePort, &conn.port); \
87+
#define SLURP_CONNECTION(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+
Local<Value> _handle = \
95+
(_##conn)->Get(FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")); \
96+
if (_handle->IsObject()) { \
97+
SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
98+
} else { \
99+
conn.fd = -1; \
100+
} \
101+
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
102+
SLURP_INT(_##conn, remotePort, &conn.port); \
103103
SLURP_INT(_##conn, bufferSize, &conn.buffered);
104104

105-
#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \
106-
if (!(arg)->IsObject()) { \
107-
return env->ThrowError( \
108-
"expected argument " #arg " to be a connection object"); \
109-
} \
110-
node_dtrace_connection_t conn; \
111-
Local<Object> _##conn = Local<Object>::Cast(arg); \
112-
SLURP_INT(_##conn, fd, &conn.fd); \
113-
SLURP_STRING(_##conn, host, &conn.remote); \
114-
SLURP_INT(_##conn, port, &conn.port); \
105+
#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \
106+
if (!(arg)->IsObject()) { \
107+
return env->ThrowError( \
108+
"expected argument " #arg " to be a connection object"); \
109+
} \
110+
node_dtrace_connection_t conn; \
111+
Local<Object> _##conn = Local<Object>::Cast(arg); \
112+
SLURP_INT(_##conn, fd, &conn.fd); \
113+
SLURP_STRING(_##conn, host, &conn.remote); \
114+
SLURP_INT(_##conn, port, &conn.port); \
115115
SLURP_INT(_##conn, bufferSize, &conn.buffered);
116116

117-
#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \
118-
if (!(arg0)->IsObject()) { \
119-
return env->ThrowError( \
120-
"expected argument " #arg0 " to be a connection object"); \
121-
} \
122-
if (!(arg1)->IsObject()) { \
123-
return env->ThrowError( \
124-
"expected argument " #arg1 " to be a connection object"); \
125-
} \
126-
node_dtrace_connection_t conn; \
127-
Local<Object> _##conn = Local<Object>::Cast(arg0); \
128-
SLURP_INT(_##conn, fd, &conn.fd); \
129-
SLURP_INT(_##conn, bufferSize, &conn.buffered); \
130-
_##conn = Local<Object>::Cast(arg1); \
131-
SLURP_STRING(_##conn, host, &conn.remote); \
117+
#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \
118+
if (!(arg0)->IsObject()) { \
119+
return env->ThrowError( \
120+
"expected argument " #arg0 " to be a connection object"); \
121+
} \
122+
if (!(arg1)->IsObject()) { \
123+
return env->ThrowError( \
124+
"expected argument " #arg1 " to be a connection object"); \
125+
} \
126+
node_dtrace_connection_t conn; \
127+
Local<Object> _##conn = Local<Object>::Cast(arg0); \
128+
SLURP_INT(_##conn, fd, &conn.fd); \
129+
SLURP_INT(_##conn, bufferSize, &conn.buffered); \
130+
_##conn = Local<Object>::Cast(arg1); \
131+
SLURP_STRING(_##conn, host, &conn.remote); \
132132
SLURP_INT(_##conn, port, &conn.port);
133133

134134

0 commit comments

Comments
 (0)