Skip to content

Commit

Permalink
src: initialize encoding_ data member
Browse files Browse the repository at this point in the history
Pointed out by Coverity.  Not really a bug because it's assigned before
use but explicit assignment in the constructor is more obviously
correct.

PR-URL: #7374
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
bnoordhuis authored and Fishrock123 committed Jul 5, 2016
1 parent c795d1e commit 3b1c19f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/fs_event_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ class FSEventWrap: public HandleWrap {
size_t self_size() const override { return sizeof(*this); }

private:
static const encoding kDefaultEncoding = UTF8;

FSEventWrap(Environment* env, Local<Object> object);
~FSEventWrap() override;

static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
int status);

uv_fs_event_t handle_;
bool initialized_;
enum encoding encoding_;
bool initialized_ = false;
enum encoding encoding_ = kDefaultEncoding;
};


FSEventWrap::FSEventWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
AsyncWrap::PROVIDER_FSEVENTWRAP) {
initialized_ = false;
}
AsyncWrap::PROVIDER_FSEVENTWRAP) {}


FSEventWrap::~FSEventWrap() {
Expand Down Expand Up @@ -101,7 +101,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
if (args[2]->IsTrue())
flags |= UV_FS_EVENT_RECURSIVE;

wrap->encoding_ = ParseEncoding(env->isolate(), args[3], UTF8);
wrap->encoding_ = ParseEncoding(env->isolate(), args[3], kDefaultEncoding);

int err = uv_fs_event_init(wrap->env()->event_loop(), &wrap->handle_);
if (err == 0) {
Expand Down

0 comments on commit 3b1c19f

Please sign in to comment.