Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: build warning fixes #10141

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ using v8::Value;
url.flags |= URL_FLAGS_TERMINATED; \
goto done; \
}
#define FAILED() \
#define URL_FAILED() \
Copy link
Contributor

Choose a reason for hiding this comment

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

How about just an #undef FAILED? It would decrease churn in the code below.

{ \
url.flags |= URL_FLAGS_FAILED; \
goto done; \
Expand Down Expand Up @@ -744,7 +744,7 @@ namespace url {
break;
case kNoScheme:
if (!has_base || (IS_CANNOT_BE_BASE(base.flags) && ch != '#')) {
FAILED()
URL_FAILED()
} else if (IS_CANNOT_BE_BASE(base.flags) && ch == '#') {
SET_HAVE_SCHEME()
url.scheme = base.scheme;
Expand Down Expand Up @@ -982,10 +982,10 @@ namespace url {
case kHostname:
if (ch == ':' && !sbflag) {
if (special && buffer.size() == 0)
FAILED()
URL_FAILED()
SET_HAVE_HOST()
if (ParseHost(&buffer, &url.host) < 0)
FAILED()
URL_FAILED()
buffer.clear();
state = kPort;
if (override == kHostname)
Expand All @@ -997,10 +997,10 @@ namespace url {
special_back_slash) {
p--;
if (special && buffer.size() == 0)
FAILED()
URL_FAILED()
SET_HAVE_HOST()
if (ParseHost(&buffer, &url.host) < 0)
FAILED()
URL_FAILED()
buffer.clear();
state = kPathStart;
if (state_override)
Expand Down Expand Up @@ -1029,14 +1029,14 @@ namespace url {
if (port >= 0 && port <= 0xffff) {
url.port = NormalizePort(url.scheme, port);
} else if (!state_override) {
FAILED()
URL_FAILED()
}
buffer.clear();
}
state = kPathStart;
continue;
} else {
FAILED();
URL_FAILED();
}
break;
case kFile:
Expand Down Expand Up @@ -1151,7 +1151,7 @@ namespace url {
if (buffer != "localhost") {
SET_HAVE_HOST()
if (ParseHost(&buffer, &url.host) < 0)
FAILED()
URL_FAILED()
}
buffer.clear();
state = kPathStart;
Expand Down Expand Up @@ -1294,7 +1294,7 @@ namespace url {
argv[ARG_PATH] = Copy(isolate, url.path);
}

cb->Call(context, recv, 9, argv);
(void)cb->Call(context, recv, 9, argv);
}

static void Parse(const FunctionCallbackInfo<Value>& args) {
Expand Down