From 495213e545de5f041cfa0f659cbcd068654db776 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Wed, 23 Nov 2016 11:53:13 +0100 Subject: [PATCH] url: mark ignored return value in node::url::Parse(...) This is to resolve an unused result warning in node_url.cc. Resolve macro redefinition warning on Windows PR-URL: https://github.com/nodejs/node/pull/10141 Reviewed-By: Anna Henningsen Reviewed-By: Michael Dawson Reviewed-By: James M Snell Reviewed-By: Sam Roberts --- src/node_url.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index 7502461114a7b4..9bf58944d6b927 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -62,7 +62,7 @@ using v8::Value; url.flags |= URL_FLAGS_TERMINATED; \ goto done; \ } -#define FAILED() \ +#define URL_FAILED() \ { \ url.flags |= URL_FLAGS_FAILED; \ goto done; \ @@ -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; @@ -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) @@ -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) @@ -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: @@ -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; @@ -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& args) {