Kaydet (Commit) 7f99f092 authored tarafından Brian Curtin's avatar Brian Curtin

Merged revisions 81843 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r81843 | brian.curtin | 2010-06-08 15:57:52 -0500 (Tue, 08 Jun 2010) | 3 lines

  Fix a compile warning missed during porting (wchar_t/char) and move a
  variable declaration outside of a loop. #2810 was when this first went in.
........
üst a01c6b3c
...@@ -1036,6 +1036,7 @@ PyEnumValue(PyObject *self, PyObject *args) ...@@ -1036,6 +1036,7 @@ PyEnumValue(PyObject *self, PyObject *args)
int index; int index;
long rc; long rc;
wchar_t *retValueBuf; wchar_t *retValueBuf;
wchar_t *tmpBuf;
BYTE *retDataBuf; BYTE *retDataBuf;
DWORD retValueSize, bufValueSize; DWORD retValueSize, bufValueSize;
DWORD retDataSize, bufDataSize; DWORD retDataSize, bufDataSize;
...@@ -1068,7 +1069,6 @@ PyEnumValue(PyObject *self, PyObject *args) ...@@ -1068,7 +1069,6 @@ PyEnumValue(PyObject *self, PyObject *args)
} }
while (1) { while (1) {
wchar_t *tmp;
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
rc = RegEnumValueW(hKey, rc = RegEnumValueW(hKey,
index, index,
...@@ -1084,13 +1084,13 @@ PyEnumValue(PyObject *self, PyObject *args) ...@@ -1084,13 +1084,13 @@ PyEnumValue(PyObject *self, PyObject *args)
break; break;
bufDataSize *= 2; bufDataSize *= 2;
tmp = (char *)PyMem_Realloc(retDataBuf, bufDataSize); tmpBuf = (wchar_t *)PyMem_Realloc(retDataBuf, bufDataSize);
if (tmp == NULL) { if (tmpBuf == NULL) {
PyErr_NoMemory(); PyErr_NoMemory();
retVal = NULL; retVal = NULL;
goto fail; goto fail;
} }
retDataBuf = tmp; retDataBuf = tmpBuf;
retDataSize = bufDataSize; retDataSize = bufDataSize;
retValueSize = bufValueSize; retValueSize = bufValueSize;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment