summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-06-08 20:57:52 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-06-08 20:57:52 (GMT)
commit9b7e2d1e542ccecd031818229773d7836c437992 (patch)
treee3138591cf6b1493e9336958f69716c35ef3ad3b /PC
parentecccc4f9b888ddfba057119e33e03b4c1ffdfe0e (diff)
downloadcpython-9b7e2d1e542ccecd031818229773d7836c437992.zip
cpython-9b7e2d1e542ccecd031818229773d7836c437992.tar.gz
cpython-9b7e2d1e542ccecd031818229773d7836c437992.tar.bz2
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.
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 8f89a00..c134a35 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1129,6 +1129,7 @@ PyEnumValue(PyObject *self, PyObject *args)
int index;
long rc;
wchar_t *retValueBuf;
+ wchar_t *tmpBuf;
BYTE *retDataBuf;
DWORD retValueSize, bufValueSize;
DWORD retDataSize, bufDataSize;
@@ -1161,7 +1162,6 @@ PyEnumValue(PyObject *self, PyObject *args)
}
while (1) {
- wchar_t *tmp;
Py_BEGIN_ALLOW_THREADS
rc = RegEnumValueW(hKey,
index,
@@ -1177,13 +1177,13 @@ PyEnumValue(PyObject *self, PyObject *args)
break;
bufDataSize *= 2;
- tmp = (char *)PyMem_Realloc(retDataBuf, bufDataSize);
- if (tmp == NULL) {
+ tmpBuf = (wchar_t *)PyMem_Realloc(retDataBuf, bufDataSize);
+ if (tmpBuf == NULL) {
PyErr_NoMemory();
retVal = NULL;
goto fail;
}
- retDataBuf = tmp;
+ retDataBuf = tmpBuf;
retDataSize = bufDataSize;
retValueSize = bufValueSize;
}