diff --git a/src/calibre/srv/fast_css_transform.cpp b/src/calibre/srv/fast_css_transform.cpp index 53a1baaf14..bb4dbc171a 100644 --- a/src/calibre/srv/fast_css_transform.cpp +++ b/src/calibre/srv/fast_css_transform.cpp @@ -242,7 +242,7 @@ class Token { out.push_back('\\'); if (is_whitespace(ch) || is_hex_digit(ch)) { char buf[8]; - int num = std::snprintf(buf, sizeof(buf), "%x ", ch); + int num = std::snprintf(buf, sizeof(buf), "%x ", (unsigned int)ch); if (num > 0) { out.resize(out.size() + num); for (int i = 0; i < num; i++) out[i + out.size() - num] = buf[i]; diff --git a/src/calibre/utils/windows/winutil.cpp b/src/calibre/utils/windows/winutil.cpp index a769e76846..6d48a537b2 100644 --- a/src/calibre/utils/windows/winutil.cpp +++ b/src/calibre/utils/windows/winutil.cpp @@ -61,7 +61,7 @@ PyGUID_dealloc(PyGUID *self) { } static PyObject* PyGUID_repr(PyGUID *self) { com_wchar_raii s; - HRESULT hr = StringFromIID(self->guid, s.address()); + HRESULT hr = StringFromIID(self->guid, s.unsafe_address()); if (FAILED(hr)) return error_from_hresult(hr); return PyUnicode_FromWideChar(s.ptr(), -1); } @@ -317,7 +317,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.address()); + HRESULT hr = SHGetKnownFolderPath(id->guid, flags, NULL, path.unsafe_address()); return PyUnicode_FromWideChar(path.ptr(), -1); }