From 9b4f63c100dada73b63c8cae20488bf215af0397 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Jan 2023 15:59:12 +0530 Subject: [PATCH] Cleanup some warnings from clang --- src/calibre/utils/windows/winutil.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/calibre/utils/windows/winutil.cpp b/src/calibre/utils/windows/winutil.cpp index 757b325ad3..d4a38b5ef1 100644 --- a/src/calibre/utils/windows/winutil.cpp +++ b/src/calibre/utils/windows/winutil.cpp @@ -311,7 +311,7 @@ known_folder_path(PyObject *self, PyObject *args) { DWORD flags = KF_FLAG_DEFAULT; if (!PyArg_ParseTuple(args, "O!|k", &PyGUIDType, &id, &flags)) return NULL; com_wchar_raii path; - HRESULT hr = SHGetKnownFolderPath(id->guid, flags, NULL, path.unsafe_address()); + SHGetKnownFolderPath(id->guid, flags, NULL, path.unsafe_address()); return PyUnicode_FromWideChar(path.ptr(), -1); } @@ -473,7 +473,7 @@ static PyObject* winutil_get_file_size(PyObject *self, PyObject *args) { HANDLE handle; if (!PyArg_ParseTuple(args, "O&", convert_handle, &handle)) return NULL; - LARGE_INTEGER ans = {0}; + LARGE_INTEGER ans = {{0}}; if (!GetFileSizeEx(handle, &ans)) return set_error_from_handle(args); return PyLong_FromLongLong(ans.QuadPart); } @@ -482,9 +482,9 @@ static PyObject* winutil_set_file_pointer(PyObject *self, PyObject *args) { unsigned long move_method = FILE_BEGIN; HANDLE handle; - LARGE_INTEGER pos = {0}; + LARGE_INTEGER pos = {{0}}; if (!PyArg_ParseTuple(args, "O&L|k", convert_handle, &handle, &pos.QuadPart, &move_method)) return NULL; - LARGE_INTEGER ans = {0}; + LARGE_INTEGER ans = {{0}}; if (!SetFilePointerEx(handle, pos, &ans, move_method)) return set_error_from_handle(args); return PyLong_FromLongLong(ans.QuadPart); } @@ -1019,7 +1019,6 @@ EnumResProc(HMODULE handle, LPWSTR type, LPWSTR name, ResourceData *data) { static const wchar_t* get_resource_id_for_index(HMODULE handle, const int index, LPCWSTR type = RT_GROUP_ICON) { ResourceData data = {index, NULL}; - int count = index; EnumResourceNamesW(handle, type, reinterpret_cast(EnumResProc), reinterpret_cast(&data)); return data.resource_id; }