Skip to content

Commit

Permalink
src: replace template<template <
Browse files Browse the repository at this point in the history
PR-URL: #20675
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
addaleax committed May 14, 2018
1 parent 7bff6d1 commit 28b58b5
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ class QueryWrap : public AsyncWrap {
};


template<typename T>
template <typename T>
Local<Array> AddrTTLToArray(Environment* env,
const T* addrttls,
size_t naddrttls) {
Expand Down
4 changes: 2 additions & 2 deletions src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using AsyncAndAgent = std::pair<uv_async_t, Agent*>;
using v8_inspector::StringBuffer;
using v8_inspector::StringView;

template<typename Transport>
template <typename Transport>
using TransportAndIo = std::pair<Transport*, InspectorIo*>;

std::string ScriptPath(uv_loop_t* loop, const std::string& script_name) {
Expand Down Expand Up @@ -284,7 +284,7 @@ void InspectorIo::IoThreadAsyncCb(uv_async_t* async) {
}
}

template<typename Transport>
template <typename Transport>
void InspectorIo::ThreadMain() {
uv_loop_t loop;
loop.data = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_js_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void* GetAsyncTask(int64_t asyncId) {
return reinterpret_cast<void*>(asyncId << 1);
}

template<void (Agent::*asyncTaskFn)(void*)>
template <void (Agent::*asyncTaskFn)(void*)>
static void InvokeAsyncTaskFnWithId(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
CHECK(args[0]->IsNumber());
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_socket_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class ServerSocket {
private:
explicit ServerSocket(InspectorSocketServer* server)
: tcp_socket_(uv_tcp_t()), server_(server), port_(-1) {}
template<typename UvHandle>
template <typename UvHandle>
static ServerSocket* FromTcpSocket(UvHandle* socket) {
return node::ContainerOf(&ServerSocket::tcp_socket_,
reinterpret_cast<uv_tcp_t*>(socket));
Expand Down
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ enum ResolveExtensionsOptions {
ONLY_VIA_EXTENSIONS
};

template<ResolveExtensionsOptions options>
template <ResolveExtensionsOptions options>
Maybe<URL> ResolveExtensions(const URL& search) {
if (options == TRY_EXACT_NAME) {
std::string filePath = search.ToFilePath();
Expand Down
2 changes: 1 addition & 1 deletion src/node_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ class ExternalHeader :
vec.len);
}

template<bool may_internalize>
template <bool may_internalize>
static MaybeLocal<String> New(Environment* env, nghttp2_rcbuf* buf) {
if (nghttp2_rcbuf_is_static(buf)) {
auto& static_str_map = env->isolate_data()->http2_static_strs;
Expand Down
2 changes: 1 addition & 1 deletion src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ void URLHost::ParseHost(const char* input,

// Locates the longest sequence of 0 segments in an IPv6 address
// in order to use the :: compression when serializing
template<typename T>
template <typename T>
inline T* FindLongestZeroSequence(T* values, size_t len) {
T* start = values;
T* end = start + len;
Expand Down
6 changes: 3 additions & 3 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ struct OnScopeLeave {
};

// Simple RAII wrapper for contiguous data that uses malloc()/free().
template<typename T>
template <typename T>
struct MallocedBuffer {
T* data;
size_t size;
Expand Down Expand Up @@ -448,10 +448,10 @@ struct MallocedBuffer {
};

// Test whether some value can be called with ().
template<typename T, typename = void>
template <typename T, typename = void>
struct is_callable : std::is_function<T> { };

template<typename T>
template <typename T>
struct is_callable<T, typename std::enable_if<
std::is_same<decltype(void(&T::operator())), void>::value
>::type> : std::true_type { };
Expand Down
12 changes: 6 additions & 6 deletions test/cctest/test_aliased_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ using node::AliasedBuffer;

class AliasBufferTest : public NodeTestFixture {};

template<class NativeT>
template <class NativeT>
void CreateOracleValues(std::vector<NativeT>* buf) {
for (size_t i = 0, j = buf->size(); i < buf->size(); i++, j--) {
(*buf)[i] = static_cast<NativeT>(j);
}
}

template<class NativeT, class V8T>
template <class NativeT, class V8T>
void WriteViaOperator(AliasedBuffer<NativeT, V8T>* aliasedBuffer,
const std::vector<NativeT>& oracle) {
// write through the API
Expand All @@ -23,7 +23,7 @@ void WriteViaOperator(AliasedBuffer<NativeT, V8T>* aliasedBuffer,
}
}

template<class NativeT, class V8T>
template <class NativeT, class V8T>
void WriteViaSetValue(AliasedBuffer<NativeT, V8T>* aliasedBuffer,
const std::vector<NativeT>& oracle) {
// write through the API
Expand All @@ -32,7 +32,7 @@ void WriteViaSetValue(AliasedBuffer<NativeT, V8T>* aliasedBuffer,
}
}

template<class NativeT, class V8T>
template <class NativeT, class V8T>
void ReadAndValidate(v8::Isolate* isolate,
v8::Local<v8::Context> context,
AliasedBuffer<NativeT, V8T>* aliasedBuffer,
Expand Down Expand Up @@ -68,7 +68,7 @@ void ReadAndValidate(v8::Isolate* isolate,
}
}

template<class NativeT, class V8T>
template <class NativeT, class V8T>
void ReadWriteTest(v8::Isolate* isolate) {
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
Expand All @@ -92,7 +92,7 @@ void ReadWriteTest(v8::Isolate* isolate) {
ReadAndValidate(isolate, context, &ab, oracle);
}

template<
template <
class NativeT_A, class V8T_A,
class NativeT_B, class V8T_B,
class NativeT_C, class V8T_C>
Expand Down

0 comments on commit 28b58b5

Please sign in to comment.