From 340efb9c01a2abcb8feaa98a840b754a152c1a1c Mon Sep 17 00:00:00 2001 From: behackett Date: Wed, 15 Aug 2012 12:39:51 -0700 Subject: [PATCH] MS VC++ compatibility PYTHON-387 --- bson/_cbsonmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bson/_cbsonmodule.c b/bson/_cbsonmodule.c index ce9cd8bf8..a3631f351 100644 --- a/bson/_cbsonmodule.c +++ b/bson/_cbsonmodule.c @@ -476,6 +476,8 @@ static int _write_element_to_buffer(PyObject* self, buffer_t buffer, int type_by } else if (state->UUID && PyObject_IsInstance(value, state->UUID)) { // Just a special case of Binary above, but simpler to do as a separate case + PyObject* bytes; + // Could be bytes, bytearray, str... const char* binarr; // UUID is always 16 bytes @@ -488,8 +490,6 @@ static int _write_element_to_buffer(PyObject* self, buffer_t buffer, int type_by subtype = (char)uuid_subtype; } - PyObject* bytes; - *(buffer_get_buffer(buffer) + type_byte) = 0x05; if (!buffer_write_bytes(buffer, (const char*)&length, 4)) { return 0;