mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-07 17:51:57 -04:00
...
This commit is contained in:
parent
272ca315ea
commit
741abb24d7
@ -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];
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user