From db241a971cd9da3e2af798a5fedd94f6f2f0ed6d Mon Sep 17 00:00:00 2001 From: Robert Xiao Date: Sat, 25 Jun 2016 18:36:20 -0700 Subject: [PATCH] Avoid compound literal to fix MSVC compilation. This fixes #3. --- lz4/frame/_frame.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lz4/frame/_frame.c b/lz4/frame/_frame.c index 5f9f5400..3a971dca 100644 --- a/lz4/frame/_frame.c +++ b/lz4/frame/_frame.c @@ -153,7 +153,6 @@ static PyObject * py_lz4f_makePrefs (PyObject * Py_UNUSED (self), PyObject * args, PyObject * keywds) { - LZ4F_frameInfo_t frameInfo; LZ4F_preferences_t *prefs; PyObject *result = PyDict_New (); static char *kwlist[] = { "blockSizeID", "blockMode", "chkFlag" @@ -171,12 +170,13 @@ py_lz4f_makePrefs (PyObject * Py_UNUSED (self), PyObject * args, } prefs = calloc (1, sizeof (LZ4F_preferences_t)); - frameInfo = (LZ4F_frameInfo_t) { - blkID, blkMode, chkSumFlag, 0, 0, - {0, 0} - }; - prefs->frameInfo = frameInfo; + LZ4F_frameInfo_t frameInfo = { + blkID, blkMode, chkSumFlag, 0, 0, + {0, 0} + }; + prefs->frameInfo = frameInfo; + } prefs->autoFlush = autoFlush; result = PyCapsule_New (prefs, NULL, NULL);