From 2a7dd808a13f9e6a609c845c76966b7b8b6491bc Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Thu, 7 Mar 2013 22:35:05 -0800 Subject: [PATCH] Don't use C99 compound literals Does not compile with msvc --- _imaging.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_imaging.c b/_imaging.c index 5c429aba6..d21debf0f 100644 --- a/_imaging.c +++ b/_imaging.c @@ -254,8 +254,16 @@ int PyImaging_GetBuffer(PyObject* buffer, Py_buffer *view) /* Pretend we support the new protocol; PyBuffer_Release happily ignores calling bf_releasebuffer on objects that don't support it */ - *view = (Py_buffer) {0}; + view->buf = NULL; + view->len = 0; view->readonly = 1; + view->format = NULL; + view->ndim = 0; + view->shape = NULL; + view->strides = NULL; + view->suboffsets = NULL; + view->itemsize = 0; + view->internal = NULL; Py_INCREF(buffer); view->obj = buffer;