This commit is contained in:
Kovid Goyal 2021-04-21 12:19:32 +05:30
parent 272ca315ea
commit 741abb24d7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -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];

View File

@ -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);
}