diff --git a/src/calibre/devices/mtp/windows/wpd.cpp b/src/calibre/devices/mtp/windows/wpd.cpp index 9edd9d4110..b8a074dde7 100644 --- a/src/calibre/devices/mtp/windows/wpd.cpp +++ b/src/calibre/devices/mtp/windows/wpd.cpp @@ -18,7 +18,7 @@ CComPtr wpd::portable_device_manager = NULL; // Flag indicating if COM has been initialized static int _com_initialized = 0; // Application Info -wpd::ClientInfo wpd::client_info = {0}; +wpd::ClientInfo wpd::client_info; // Module startup/shutdown {{{ static PyObject * diff --git a/src/calibre/utils/windows/common.h b/src/calibre/utils/windows/common.h index ae78ef4192..ebcda47a80 100644 --- a/src/calibre/utils/windows/common.h +++ b/src/calibre/utils/windows/common.h @@ -34,11 +34,11 @@ class generic_raii { generic_raii & operator=( const generic_raii & ) ; public: - generic_raii(T h = null) : handle(h) {} + explicit generic_raii(T h = null) : handle(h) {} ~generic_raii() { release(); } void release() { - if (handle) { + if (handle != null) { free_T(handle); handle = null; } @@ -49,7 +49,6 @@ class generic_raii { void set_ptr(T val) { handle = val; } T* address() { return &handle; } explicit operator bool() const { return handle != null; } - T operator->() { return handle; } }; typedef generic_raii wchar_raii;