Browse Source

cpplint: disallow comma-first in C++

v0.11.8-release
Fedor Indutny 11 years ago
parent
commit
7063c59b97
  1. 20
      src/env-inl.h
  2. 6
      src/handle_wrap.cc
  3. 10
      src/node_contextify.cc
  4. 64
      src/node_crypto.h
  5. 6
      src/node_file.cc
  6. 8
      src/node_http_parser.cc
  7. 6
      src/node_stat_watcher.cc
  8. 30
      src/node_zlib.cc
  9. 8
      src/stream_wrap.cc
  10. 4
      src/stream_wrap.h
  11. 4
      src/udp_wrap.cc
  12. 3
      tools/cpplint.py

20
src/env-inl.h

@ -52,14 +52,14 @@ inline void Environment::IsolateData::Put() {
} }
inline Environment::IsolateData::IsolateData(v8::Isolate* isolate) inline Environment::IsolateData::IsolateData(v8::Isolate* isolate)
: event_loop_(uv_default_loop()) : event_loop_(uv_default_loop()),
, isolate_(isolate) isolate_(isolate),
#define V(PropertyName, StringValue) \ #define V(PropertyName, StringValue) \
, PropertyName ## _index_( \ PropertyName ## _index_( \
FIXED_ONE_BYTE_STRING(isolate, StringValue).Eternalize(isolate)) FIXED_ONE_BYTE_STRING(isolate, StringValue).Eternalize(isolate)),
PER_ISOLATE_STRING_PROPERTIES(V) PER_ISOLATE_STRING_PROPERTIES(V)
#undef V #undef V
, ref_count_(0) { ref_count_(0) {
} }
inline uv_loop_t* Environment::IsolateData::event_loop() const { inline uv_loop_t* Environment::IsolateData::event_loop() const {
@ -155,11 +155,11 @@ inline Environment* Environment::GetCurrentChecked(
} }
inline Environment::Environment(v8::Local<v8::Context> context) inline Environment::Environment(v8::Local<v8::Context> context)
: isolate_(context->GetIsolate()) : isolate_(context->GetIsolate()),
, isolate_data_(IsolateData::GetOrCreate(context->GetIsolate())) isolate_data_(IsolateData::GetOrCreate(context->GetIsolate())),
, using_smalloc_alloc_cb_(false) using_smalloc_alloc_cb_(false),
, using_domains_(false) using_domains_(false),
, context_(context->GetIsolate(), context) { context_(context->GetIsolate(), context) {
// We'll be creating new objects so make sure we've entered the context. // We'll be creating new objects so make sure we've entered the context.
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
v8::HandleScope handle_scope(isolate()); v8::HandleScope handle_scope(isolate());

6
src/handle_wrap.cc

@ -89,9 +89,9 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
HandleWrap::HandleWrap(Environment* env, HandleWrap::HandleWrap(Environment* env,
Handle<Object> object, Handle<Object> object,
uv_handle_t* handle) uv_handle_t* handle)
: env_(env) : env_(env),
, flags_(0) flags_(0),
, handle__(handle) { handle__(handle) {
handle__->data = this; handle__->data = this;
HandleScope scope(node_isolate); HandleScope scope(node_isolate);
persistent().Reset(node_isolate, object); persistent().Reset(node_isolate, object);

10
src/node_contextify.cc

@ -64,12 +64,12 @@ class ContextifyContext {
public: public:
explicit ContextifyContext(Environment* env, Local<Object> sandbox) explicit ContextifyContext(Environment* env, Local<Object> sandbox)
: env_(env) : env_(env),
, sandbox_(env->isolate(), sandbox) sandbox_(env->isolate(), sandbox),
, context_(env->isolate(), CreateV8Context(env)) context_(env->isolate(), CreateV8Context(env)),
, proxy_global_(env->isolate(), context()->Global()) proxy_global_(env->isolate(), context()->Global()),
// Wait for sandbox_, proxy_global_, and context_ to die // Wait for sandbox_, proxy_global_, and context_ to die
, references_(3) { references_(3) {
sandbox_.MakeWeak(this, WeakCallback); sandbox_.MakeWeak(this, WeakCallback);
sandbox_.MarkIndependent(); sandbox_.MarkIndependent();
context_.MakeWeak(this, WeakCallback); context_.MakeWeak(this, WeakCallback);

64
src/node_crypto.h

@ -94,10 +94,10 @@ class SecureContext : public WeakObject {
static void SetTicketKeys(const v8::FunctionCallbackInfo<v8::Value>& args); static void SetTicketKeys(const v8::FunctionCallbackInfo<v8::Value>& args);
SecureContext(Environment* env, v8::Local<v8::Object> wrap) SecureContext(Environment* env, v8::Local<v8::Object> wrap)
: WeakObject(env->isolate(), wrap) : WeakObject(env->isolate(), wrap),
, ca_store_(NULL) ca_store_(NULL),
, ctx_(NULL) ctx_(NULL),
, env_(env) { env_(env) {
} }
void FreeCTXMem() { void FreeCTXMem() {
@ -134,10 +134,10 @@ class SSLWrap {
}; };
SSLWrap(Environment* env, SecureContext* sc, Kind kind) SSLWrap(Environment* env, SecureContext* sc, Kind kind)
: env_(env) : env_(env),
, kind_(kind) kind_(kind),
, next_sess_(NULL) next_sess_(NULL),
, session_callbacks_(false) { session_callbacks_(false) {
ssl_ = SSL_new(sc->ctx_); ssl_ = SSL_new(sc->ctx_);
assert(ssl_ != NULL); assert(ssl_ != NULL);
} }
@ -285,11 +285,11 @@ class Connection : public SSLWrap<Connection>, public WeakObject {
v8::Local<v8::Object> wrap, v8::Local<v8::Object> wrap,
SecureContext* sc, SecureContext* sc,
SSLWrap<Connection>::Kind kind) SSLWrap<Connection>::Kind kind)
: SSLWrap<Connection>(env, sc, kind) : SSLWrap<Connection>(env, sc, kind),
, WeakObject(env->isolate(), wrap) WeakObject(env->isolate(), wrap),
, bio_read_(NULL) bio_read_(NULL),
, bio_write_(NULL) bio_write_(NULL),
, hello_offset_(0) { hello_offset_(0) {
hello_parser_.Start(SSLWrap<Connection>::OnClientHello, hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
OnClientHelloParseEnd, OnClientHelloParseEnd,
this); this);
@ -347,10 +347,10 @@ class CipherBase : public WeakObject {
CipherBase(v8::Isolate* isolate, CipherBase(v8::Isolate* isolate,
v8::Local<v8::Object> wrap, v8::Local<v8::Object> wrap,
CipherKind kind) CipherKind kind)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, cipher_(NULL) cipher_(NULL),
, initialised_(false) initialised_(false),
, kind_(kind) { kind_(kind) {
} }
~CipherBase() { ~CipherBase() {
@ -380,9 +380,9 @@ class Hmac : public WeakObject {
static void HmacDigest(const v8::FunctionCallbackInfo<v8::Value>& args); static void HmacDigest(const v8::FunctionCallbackInfo<v8::Value>& args);
Hmac(v8::Isolate* isolate, v8::Local<v8::Object> wrap) Hmac(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, md_(NULL) md_(NULL),
, initialised_(false) { initialised_(false) {
} }
~Hmac() { ~Hmac() {
@ -409,9 +409,9 @@ class Hash : public WeakObject {
static void HashDigest(const v8::FunctionCallbackInfo<v8::Value>& args); static void HashDigest(const v8::FunctionCallbackInfo<v8::Value>& args);
Hash(v8::Isolate* isolate, v8::Local<v8::Object> wrap) Hash(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, md_(NULL) md_(NULL),
, initialised_(false) { initialised_(false) {
} }
~Hash() { ~Hash() {
@ -443,9 +443,9 @@ class Sign : public WeakObject {
static void SignFinal(const v8::FunctionCallbackInfo<v8::Value>& args); static void SignFinal(const v8::FunctionCallbackInfo<v8::Value>& args);
Sign(v8::Isolate* isolate, v8::Local<v8::Object> wrap) Sign(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, md_(NULL) md_(NULL),
, initialised_(false) { initialised_(false) {
} }
~Sign() { ~Sign() {
@ -477,9 +477,9 @@ class Verify : public WeakObject {
static void VerifyFinal(const v8::FunctionCallbackInfo<v8::Value>& args); static void VerifyFinal(const v8::FunctionCallbackInfo<v8::Value>& args);
Verify(v8::Isolate* isolate, v8::Local<v8::Object> wrap) Verify(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, md_(NULL) md_(NULL),
, initialised_(false) { initialised_(false) {
} }
~Verify() { ~Verify() {
@ -515,9 +515,9 @@ class DiffieHellman : public WeakObject {
static void SetPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args); static void SetPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args);
DiffieHellman(v8::Isolate* isolate, v8::Local<v8::Object> wrap) DiffieHellman(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
: WeakObject(isolate, wrap) : WeakObject(isolate, wrap),
, initialised_(false) initialised_(false),
, dh(NULL) { dh(NULL) {
} }
~DiffieHellman() { ~DiffieHellman() {

6
src/node_file.cc

@ -67,9 +67,9 @@ using v8::Value;
class FSReqWrap: public ReqWrap<uv_fs_t> { class FSReqWrap: public ReqWrap<uv_fs_t> {
public: public:
FSReqWrap(Environment* env, const char* syscall, char* data = NULL) FSReqWrap(Environment* env, const char* syscall, char* data = NULL)
: ReqWrap<uv_fs_t>(env) : ReqWrap<uv_fs_t>(env),
, syscall_(syscall) syscall_(syscall),
, data_(data) { data_(data) {
} }
void ReleaseEarly() { void ReleaseEarly() {

8
src/node_http_parser.cc

@ -190,10 +190,10 @@ struct StringPtr {
class Parser : public WeakObject { class Parser : public WeakObject {
public: public:
Parser(Environment* env, Local<Object> wrap, enum http_parser_type type) Parser(Environment* env, Local<Object> wrap, enum http_parser_type type)
: WeakObject(env->isolate(), wrap) : WeakObject(env->isolate(), wrap),
, env_(env) env_(env),
, current_buffer_len_(0) current_buffer_len_(0),
, current_buffer_data_(NULL) { current_buffer_data_(NULL) {
Init(type); Init(type);
} }

6
src/node_stat_watcher.cc

@ -64,9 +64,9 @@ static void Delete(uv_handle_t* handle) {
StatWatcher::StatWatcher(Environment* env, Local<Object> wrap) StatWatcher::StatWatcher(Environment* env, Local<Object> wrap)
: WeakObject(env->isolate(), wrap) : WeakObject(env->isolate(), wrap),
, watcher_(new uv_fs_poll_t) watcher_(new uv_fs_poll_t),
, env_(env) { env_(env) {
uv_fs_poll_init(env->event_loop(), watcher_); uv_fs_poll_init(env->event_loop(), watcher_);
watcher_->data = static_cast<void*>(this); watcher_->data = static_cast<void*>(this);
} }

30
src/node_zlib.cc

@ -71,21 +71,21 @@ class ZCtx : public WeakObject {
public: public:
ZCtx(Environment* env, Local<Object> wrap, node_zlib_mode mode) ZCtx(Environment* env, Local<Object> wrap, node_zlib_mode mode)
: WeakObject(env->isolate(), wrap) : WeakObject(env->isolate(), wrap),
, chunk_size_(0) chunk_size_(0),
, dictionary_(NULL) dictionary_(NULL),
, dictionary_len_(0) dictionary_len_(0),
, env_(env) env_(env),
, err_(0) err_(0),
, flush_(0) flush_(0),
, init_done_(false) init_done_(false),
, level_(0) level_(0),
, memLevel_(0) memLevel_(0),
, mode_(mode) mode_(mode),
, strategy_(0) strategy_(0),
, windowBits_(0) windowBits_(0),
, write_in_progress_(false) write_in_progress_(false),
, refs_(0) { refs_(0) {
} }

8
src/stream_wrap.cc

@ -54,10 +54,10 @@ using v8::Value;
StreamWrap::StreamWrap(Environment* env, StreamWrap::StreamWrap(Environment* env,
Local<Object> object, Local<Object> object,
uv_stream_t* stream) uv_stream_t* stream)
: HandleWrap(env, object, reinterpret_cast<uv_handle_t*>(stream)) : HandleWrap(env, object, reinterpret_cast<uv_handle_t*>(stream)),
, stream_(stream) stream_(stream),
, default_callbacks_(this) default_callbacks_(this),
, callbacks_(&default_callbacks_) { callbacks_(&default_callbacks_) {
} }

4
src/stream_wrap.h

@ -38,8 +38,8 @@ typedef class ReqWrap<uv_shutdown_t> ShutdownWrap;
class WriteWrap: public ReqWrap<uv_write_t> { class WriteWrap: public ReqWrap<uv_write_t> {
public: public:
WriteWrap(Environment* env, v8::Local<v8::Object> obj, StreamWrap* wrap) WriteWrap(Environment* env, v8::Local<v8::Object> obj, StreamWrap* wrap)
: ReqWrap<uv_write_t>(env, obj) : ReqWrap<uv_write_t>(env, obj),
, wrap_(wrap) { wrap_(wrap) {
} }
void* operator new(size_t size, char* storage) { return storage; } void* operator new(size_t size, char* storage) { return storage; }

4
src/udp_wrap.cc

@ -60,8 +60,8 @@ class SendWrap : public ReqWrap<uv_udp_send_t> {
SendWrap::SendWrap(Environment* env, SendWrap::SendWrap(Environment* env,
Local<Object> req_wrap_obj, Local<Object> req_wrap_obj,
bool have_callback) bool have_callback)
: ReqWrap<uv_udp_send_t>(env, req_wrap_obj) : ReqWrap<uv_udp_send_t>(env, req_wrap_obj),
, have_callback_(have_callback) { have_callback_(have_callback) {
} }

3
tools/cpplint.py

@ -2108,6 +2108,9 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, error):
'the base class list in a class definition, the colon should ' 'the base class list in a class definition, the colon should '
'be on the following line.') 'be on the following line.')
if len(line) > initial_spaces and line[initial_spaces] == ',':
error(filename, linenum, 'whitespace/commafirst', 4,
'Comma-first style is not allowed')
# Check if the line is a header guard. # Check if the line is a header guard.
is_header_guard = False is_header_guard = False

Loading…
Cancel
Save