Permalink
Browse files

src: fix type mismatch warnings from missing priv

Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: #24737
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information...
sam-github committed Nov 30, 2018
1 parent 02cd706 commit 0c65314e0e8602f4a7e0ace43ebd63de233eac62
@@ -440,7 +440,8 @@ Local<FunctionTemplate> AsyncWrap::GetConstructorTemplate(Environment* env) {
void AsyncWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
HandleScope scope(isolate);
@@ -116,7 +116,8 @@ class AsyncWrap : public BaseObject {
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
static void GetAsyncId(const v8::FunctionCallbackInfo<v8::Value>& args);
static void PushAsyncIds(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -171,7 +171,8 @@ namespace symbols {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
#define V(PropertyName, StringValue) \
target->Set(env->context(), \
@@ -2172,7 +2172,8 @@ void StrError(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "getaddrinfo", GetAddrInfo);
@@ -52,7 +52,8 @@ class FSEventWrap: public HandleWrap {
public:
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context);
Local<Context> context,
void* priv);
static void New(const FunctionCallbackInfo<Value>& args);
static void Start(const FunctionCallbackInfo<Value>& args);
static void GetInitialized(const FunctionCallbackInfo<Value>& args);
@@ -95,7 +96,8 @@ void FSEventWrap::GetInitialized(const FunctionCallbackInfo<Value>& args) {
void FSEventWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
auto fsevent_string = FIXED_ONE_BYTE_STRING(env->isolate(), "FSEvent");
@@ -247,7 +247,8 @@ void CreateHeapDump(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethodNoSideEffect(target, "buildEmbedderGraph", BuildEmbedderGraph);
@@ -196,7 +196,8 @@ void JSStream::EmitEOF(const FunctionCallbackInfo<Value>& args) {
void JSStream::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
@@ -14,7 +14,8 @@ class JSStream : public AsyncWrap, public StreamBase {
public:
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
bool IsAlive() override;
bool IsClosing() override;
@@ -821,7 +821,8 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
void ModuleWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
@@ -38,7 +38,8 @@ class ModuleWrap : public BaseObject {
static const std::string EXTENSIONS[];
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
static void HostInitializeImportMetaObjectCallback(
v8::Local<v8::Context> context,
v8::Local<v8::Module> module,
@@ -1085,7 +1085,8 @@ void SetupBufferJS(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "setupBufferJS", SetupBufferJS);
@@ -1075,7 +1075,8 @@ void ContextifyContext::CompileFunction(
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
ContextifyContext::Init(env, target);
ContextifyScript::Init(env, target);
@@ -22,7 +22,8 @@ void Enable(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "enable", Enable);
@@ -317,7 +317,8 @@ MaybeLocal<Value> NativeModuleLoader::LookupAndCompile(
void NativeModuleLoader::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(
@@ -37,7 +37,8 @@ class NativeModuleLoader {
NativeModuleLoader();
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
v8::Local<v8::Object> GetSourceObject(v8::Local<v8::Context> context) const;
v8::Local<v8::String> GetSource(v8::Isolate* isolate, const char* id) const;
@@ -483,7 +483,8 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
env->SetMethodNoSideEffect(target, "getOptions", GetOptions);
@@ -446,7 +446,8 @@ static void GetPriority(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "getHostname", GetHostname);
env->SetMethod(target, "getLoadAvg", GetLoadAvg);
@@ -376,7 +376,8 @@ void Timerify(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
performance_state* state = env->performance_state();
@@ -440,7 +440,8 @@ void DeserializerContext::ReadRawBytes(
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> ser =
env->NewFunctionTemplate(SerializerContext::New);
@@ -21,6 +21,11 @@ using v8::Value;
class NodeCategorySet : public BaseObject {
public:
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv);
static void New(const FunctionCallbackInfo<Value>& args);
static void Enable(const FunctionCallbackInfo<Value>& args);
static void Disable(const FunctionCallbackInfo<Value>& args);
@@ -97,7 +102,7 @@ void GetEnabledCategories(const FunctionCallbackInfo<Value>& args) {
}
}
void Initialize(Local<Object> target,
void NodeCategorySet::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
@@ -136,4 +141,5 @@ void Initialize(Local<Object> target,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(trace_events, node::Initialize)
NODE_MODULE_CONTEXT_AWARE_INTERNAL(trace_events,
node::NodeCategorySet::Initialize)
@@ -62,7 +62,8 @@ static void IsBoxedPrimitive(const FunctionCallbackInfo<Value>& args) {
void InitializeTypes(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
#define V(type) env->SetMethodNoSideEffect(target, \
@@ -56,6 +56,7 @@ static void GetOwnNonIndexProperties(
}
static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
// Return undefined if it's not a Promise.
if (!args[0]->IsPromise())
return;
@@ -74,6 +75,7 @@ static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
}
static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
// Return undefined if it's not a proxy.
if (!args[0]->IsProxy())
return;
@@ -194,7 +196,8 @@ void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
#define V(name, _) \
@@ -119,7 +119,8 @@ void SetFlagsFromString(const FunctionCallbackInfo<Value>& args) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethodNoSideEffect(target, "cachedDataVersionTag",
@@ -69,7 +69,8 @@ Local<Object> PipeWrap::Instantiate(Environment* env,
void PipeWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
@@ -43,7 +43,8 @@ class PipeWrap : public ConnectionWrap<PipeWrap, uv_pipe_t> {
SocketType type);
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
SET_NO_MEMORY_INFO()
SET_MEMORY_INFO_NAME(PipeWrap)
@@ -49,7 +49,8 @@ class ProcessWrap : public HandleWrap {
public:
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
@@ -43,7 +43,8 @@ class SignalWrap : public HandleWrap {
public:
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
@@ -365,7 +365,8 @@ void SyncProcessStdioPipe::CloseCallback(uv_handle_t* handle) {
void SyncProcessRunner::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "spawn", Spawn);
}
@@ -141,7 +141,8 @@ class SyncProcessRunner {
public:
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
static void Spawn(const v8::FunctionCallbackInfo<v8::Value>& args);
private:
@@ -248,7 +248,8 @@ namespace {
void InitializeStreamPipe(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
// Create FunctionTemplate for FileHandle::CloseReq
@@ -52,7 +52,8 @@ using v8::Value;
void LibuvStreamWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
auto is_construct_call_callback =
@@ -37,7 +37,8 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase {
public:
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
int GetFD() override;
bool IsAlive() override;
@@ -276,7 +276,8 @@ void FlushData(const FunctionCallbackInfo<Value>& args) {
void InitializeStringDecoder(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
@@ -73,7 +73,8 @@ Local<Object> TCPWrap::Instantiate(Environment* env,
void TCPWrap::Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
@@ -42,7 +42,8 @@ class TCPWrap : public ConnectionWrap<TCPWrap, uv_tcp_t> {
SocketType type);
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context);
v8::Local<v8::Context> context,
void* priv);
SET_NO_MEMORY_INFO()
SET_SELF_SIZE(TCPWrap)
Oops, something went wrong.

0 comments on commit 0c65314

Please sign in to comment.