GeezerVison is showing github.com — src, tools: add check for left leaning pointers · nodejs/node@cbdc1fd
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/cares_wrap.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -633,7 +633,7 @@ class QueryWrap : public AsyncWrap { | 633 | 633 | wrap->env()->CloseHandle(handle, CaresAsyncClose); | 634 | 634 | } | 635 | 635 |
| 636 | | - static void Callback(void *arg, int status, int timeouts, | | 636 | + static void Callback(void* arg, int status, int timeouts, | 637 | 637 | unsigned char* answer_buf, int answer_len) { | 638 | 638 | QueryWrap* wrap = static_cast<QueryWrap*>(arg); | 639 | 639 |
| @@ -661,7 +661,7 @@ class QueryWrap : public AsyncWrap { | 661 | 661 | uv_async_send(async_handle); | 662 | 662 | } | 663 | 663 |
| 664 | | - static void Callback(void *arg, int status, int timeouts, | | 664 | + static void Callback(void* arg, int status, int timeouts, | 665 | 665 | struct hostent* host) { | 666 | 666 | QueryWrap* wrap = static_cast<QueryWrap*>(arg); | 667 | 667 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/env-inl.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -349,7 +349,7 @@ inline uv_idle_t* Environment::immediate_idle_handle() { | 349 | 349 |
| 350 | 350 | inline void Environment::RegisterHandleCleanup(uv_handle_t* handle, | 351 | 351 | HandleCleanupCb cb, | 352 | | - void *arg) { | | 352 | + void* arg) { | 353 | 353 | handle_cleanup_queue_.push_back(HandleCleanup{handle, cb, arg}); | 354 | 354 | } | 355 | 355 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/env.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -615,7 +615,7 @@ class Environment { | 615 | 615 | // Register clean-up cb to be called on environment destruction. | 616 | 616 | inline void RegisterHandleCleanup(uv_handle_t* handle, | 617 | 617 | HandleCleanupCb cb, | 618 | | - void *arg); | | 618 | + void* arg); | 619 | 619 |
| 620 | 620 | template <typename T, typename OnCloseCallback> | 621 | 621 | inline void CloseHandle(T* handle, OnCloseCallback callback); | |
Collapse file Copy file name to clipboardExpand all lines: src/exceptions.cc +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,9 +22,9 @@ using v8::Value; | 22 | 22 |
| 23 | 23 | Local<Value> ErrnoException(Isolate* isolate, | 24 | 24 | int errorno, | 25 | | - const char *syscall, | 26 | | - const char *msg, | 27 | | - const char *path) { | | 25 | + const char* syscall, | | 26 | + const char* msg, | | 27 | + const char* path) { | 28 | 28 | Environment* env = Environment::GetCurrent(isolate); | 29 | 29 |
| 30 | 30 | Local<Value> e; | @@ -143,8 +143,8 @@ Local<Value> UVException(Isolate* isolate, | 143 | 143 | #ifdef _WIN32 | 144 | 144 | // Does about the same as strerror(), | 145 | 145 | // but supports all windows error messages | 146 | | -static const char *winapi_strerror(const int errorno, bool* must_free) { | 147 | | - char *errmsg = nullptr; | | 146 | +static const char* winapi_strerror(const int errorno, bool* must_free) { | | 147 | + char* errmsg = nullptr; | 148 | 148 |
| 149 | 149 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | | 150 | 150 | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, errorno, | |
Collapse file Copy file name to clipboardExpand all lines: src/node.cc +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -315,15 +315,15 @@ static struct { | 315 | 315 | } | 316 | 316 |
| 317 | 317 | #if HAVE_INSPECTOR | 318 | | - bool StartInspector(Environment *env, const char* script_path, | | 318 | + bool StartInspector(Environment* env, const char* script_path, | 319 | 319 | const DebugOptions& options) { | 320 | 320 | // Inspector agent can't fail to start, but if it was configured to listen | 321 | 321 | // right away on the websocket port and fails to bind/etc, this will return | 322 | 322 | // false. | 323 | 323 | return env->inspector_agent()->Start(platform_, script_path, options); | 324 | 324 | } | 325 | 325 |
| 326 | | - bool InspectorStarted(Environment *env) { | | 326 | + bool InspectorStarted(Environment* env) { | 327 | 327 | return env->inspector_agent()->IsStarted(); | 328 | 328 | } | 329 | 329 | #endif // HAVE_INSPECTOR | @@ -352,7 +352,7 @@ static struct { | 352 | 352 | void Dispose() {} | 353 | 353 | void DrainVMTasks(Isolate* isolate) {} | 354 | 354 | void CancelVMTasks(Isolate* isolate) {} | 355 | | - bool StartInspector(Environment *env, const char* script_path, | | 355 | + bool StartInspector(Environment* env, const char* script_path, | 356 | 356 | const DebugOptions& options) { | 357 | 357 | env->ThrowError("Node compiled with NODE_USE_V8_PLATFORM=0"); | 358 | 358 | return true; | @@ -374,7 +374,7 @@ static struct { | 374 | 374 | #endif // !NODE_USE_V8_PLATFORM | 375 | 375 |
| 376 | 376 | #if !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR | 377 | | - bool InspectorStarted(Environment *env) { | | 377 | + bool InspectorStarted(Environment* env) { | 378 | 378 | return false; | 379 | 379 | } | 380 | 380 | #endif // !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR | @@ -419,7 +419,7 @@ static void PrintErrorString(const char* format, ...) { | 419 | 419 | va_end(ap); | 420 | 420 | } | 421 | 421 |
| 422 | | -const char *signo_string(int signo) { | | 422 | +const char* signo_string(int signo) { | 423 | 423 | #define SIGNO_CASE(e) case e: return #e; | 424 | 424 | switch (signo) { | 425 | 425 | #ifdef SIGHUP | @@ -2452,7 +2452,7 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) { | 2452 | 2452 | Local<Array> envarr = Array::New(isolate); | 2453 | 2453 | WCHAR* p = environment; | 2454 | 2454 | while (*p) { | 2455 | | - WCHAR *s; | | 2455 | + WCHAR* s; | 2456 | 2456 | if (*p == L'=') { | 2457 | 2457 | // If the key starts with '=' it is a hidden environment variable. | 2458 | 2458 | p += wcslen(p) + 1; | |
Collapse file Copy file name to clipboardExpand all lines: src/node.h +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -208,7 +208,7 @@ NODE_EXTERN extern bool force_fips_crypto; | 208 | 208 | # endif | 209 | 209 | #endif | 210 | 210 |
| 211 | | -NODE_EXTERN int Start(int argc, char *argv[]); | | 211 | +NODE_EXTERN int Start(int argc, char* argv[]); | 212 | 212 | NODE_EXTERN void Init(int* argc, | 213 | 213 | const char** argv, | 214 | 214 | int* exec_argc, | @@ -455,14 +455,14 @@ NODE_DEPRECATED("Use DecodeWrite(isolate, ...)", | 455 | 455 | NODE_EXTERN v8::Local<v8::Value> WinapiErrnoException( | 456 | 456 | v8::Isolate* isolate, | 457 | 457 | int errorno, | 458 | | - const char *syscall = nullptr, | 459 | | - const char *msg = "", | 460 | | - const char *path = nullptr); | | 458 | + const char* syscall = nullptr, | | 459 | + const char* msg = "", | | 460 | + const char* path = nullptr); | 461 | 461 |
| 462 | 462 | NODE_DEPRECATED("Use WinapiErrnoException(isolate, ...)", | 463 | 463 | inline v8::Local<v8::Value> WinapiErrnoException(int errorno, | 464 | | - const char *syscall = nullptr, const char *msg = "", | 465 | | - const char *path = nullptr) { | | 464 | + const char* syscall = nullptr, const char* msg = "", | | 465 | + const char* path = nullptr) { | 466 | 466 | return WinapiErrnoException(v8::Isolate::GetCurrent(), | 467 | 467 | errorno, | 468 | 468 | syscall, | @@ -471,7 +471,7 @@ NODE_DEPRECATED("Use WinapiErrnoException(isolate, ...)", | 471 | 471 | }) | 472 | 472 | #endif | 473 | 473 |
| 474 | | -const char *signo_string(int errorno); | | 474 | +const char* signo_string(int errorno); | 475 | 475 |
| 476 | 476 |
| 477 | 477 | typedef void (*addon_register_func)( | |
Collapse file Copy file name to clipboardExpand all lines: src/node_api_types.h +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 |
| 11 | 11 | // JSVM API types are all opaque pointers for ABI stability | 12 | 12 | // typedef undefined structs instead of void* for compile time type safety | 13 | | -typedef struct napi_env__ *napi_env; | 14 | | -typedef struct napi_value__ *napi_value; | 15 | | -typedef struct napi_ref__ *napi_ref; | 16 | | -typedef struct napi_handle_scope__ *napi_handle_scope; | 17 | | -typedef struct napi_escapable_handle_scope__ *napi_escapable_handle_scope; | 18 | | -typedef struct napi_callback_scope__ *napi_callback_scope; | 19 | | -typedef struct napi_callback_info__ *napi_callback_info; | 20 | | -typedef struct napi_async_context__ *napi_async_context; | 21 | | -typedef struct napi_async_work__ *napi_async_work; | 22 | | -typedef struct napi_deferred__ *napi_deferred; | | 13 | +typedef struct napi_env__* napi_env; | | 14 | +typedef struct napi_value__* napi_value; | | 15 | +typedef struct napi_ref__* napi_ref; | | 16 | +typedef struct napi_handle_scope__* napi_handle_scope; | | 17 | +typedef struct napi_escapable_handle_scope__* napi_escapable_handle_scope; | | 18 | +typedef struct napi_callback_scope__* napi_callback_scope; | | 19 | +typedef struct napi_callback_info__* napi_callback_info; | | 20 | +typedef struct napi_async_context__* napi_async_context; | | 21 | +typedef struct napi_async_work__* napi_async_work; | | 22 | +typedef struct napi_deferred__* napi_deferred; | 23 | 23 |
| 24 | 24 | typedef enum { | 25 | 25 | napi_default = 0, | |
Collapse file Copy file name to clipboardExpand all lines: src/node_crypto.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3988,8 +3988,8 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) { | 3988 | 3988 |
| 3989 | 3989 | bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { | 3990 | 3990 | dh_.reset(DH_new()); | 3991 | | - BIGNUM *bn_p = BN_bin2bn(reinterpret_cast<const unsigned char*>(p), p_len, 0); | 3992 | | - BIGNUM *bn_g = BN_bin2bn(reinterpret_cast<const unsigned char*>(g), g_len, 0); | | 3991 | + BIGNUM* bn_p = BN_bin2bn(reinterpret_cast<const unsigned char*>(p), p_len, 0); | | 3992 | + BIGNUM* bn_g = BN_bin2bn(reinterpret_cast<const unsigned char*>(g), g_len, 0); | 3993 | 3993 | if (!DH_set0_pqg(dh_.get(), bn_p, nullptr, bn_g)) { | 3994 | 3994 | BN_free(bn_p); | 3995 | 3995 | BN_free(bn_g); | |
Collapse file Copy file name to clipboardExpand all lines: src/node_crypto.h +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -368,12 +368,12 @@ class CipherBase : public BaseObject { | 368 | 368 | const char* iv, | 369 | 369 | int iv_len, | 370 | 370 | unsigned int auth_tag_len); | 371 | | - bool InitAuthenticated(const char *cipher_type, int iv_len, | | 371 | + bool InitAuthenticated(const char* cipher_type, int iv_len, | 372 | 372 | unsigned int auth_tag_len); | 373 | 373 | bool CheckCCMMessageLength(int message_len); | 374 | 374 | UpdateResult Update(const char* data, int len, unsigned char** out, | 375 | 375 | int* out_len); | 376 | | - bool Final(unsigned char** out, int *out_len); | | 376 | + bool Final(unsigned char** out, int* out_len); | 377 | 377 | bool SetAutoPadding(bool auto_padding); | 378 | 378 |
| 379 | 379 | bool IsAuthenticatedMode() const; | @@ -492,7 +492,7 @@ class Sign : public SignBase { | 492 | 492 | int key_pem_len, | 493 | 493 | const char* passphrase, | 494 | 494 | unsigned char* sig, | 495 | | - unsigned int *sig_len, | | 495 | + unsigned int* sig_len, | 496 | 496 | int padding, | 497 | 497 | int saltlen); | 498 | 498 |
| @@ -532,10 +532,10 @@ class Verify : public SignBase { | 532 | 532 |
| 533 | 533 | class PublicKeyCipher { | 534 | 534 | public: | 535 | | - typedef int (*EVP_PKEY_cipher_init_t)(EVP_PKEY_CTX *ctx); | 536 | | - typedef int (*EVP_PKEY_cipher_t)(EVP_PKEY_CTX *ctx, | 537 | | - unsigned char *out, size_t *outlen, | 538 | | - const unsigned char *in, size_t inlen); | | 535 | + typedef int (*EVP_PKEY_cipher_init_t)(EVP_PKEY_CTX* ctx); | | 536 | + typedef int (*EVP_PKEY_cipher_t)(EVP_PKEY_CTX* ctx, | | 537 | + unsigned char* out, size_t* outlen, | | 538 | + const unsigned char* in, size_t inlen); | 539 | 539 |
| 540 | 540 | enum Operation { | 541 | 541 | kPublic, | |
Collapse file Copy file name to clipboardExpand all lines: src/node_dtrace.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -194,7 +194,7 @@ void DTRACE_HTTP_SERVER_RESPONSE(const FunctionCallbackInfo<Value>& args) { | 194 | 194 |
| 195 | 195 | void DTRACE_HTTP_CLIENT_REQUEST(const FunctionCallbackInfo<Value>& args) { | 196 | 196 | node_dtrace_http_client_request_t req; | 197 | | - char *header; | | 197 | + char* header; | 198 | 198 |
| 199 | 199 | if (!NODE_HTTP_CLIENT_REQUEST_ENABLED()) | 200 | 200 | return; | @@ -259,7 +259,7 @@ void InitDTrace(Environment* env, Local<Object> target) { | 259 | 259 | HandleScope scope(env->isolate()); | 260 | 260 |
| 261 | 261 | static struct { | 262 | | - const char *name; | | 262 | + const char* name; | 263 | 263 | void (*func)(const FunctionCallbackInfo<Value>&); | 264 | 264 | } tab[] = { | 265 | 265 | #define NODE_PROBE(name) #name, name | |
|