[Python-checkins] r81845 - in python/branches/release31-maint: PC/winreg.c
brian.curtin
python-checkins at python.org
Tue Jun 8 23:00:35 CEST 2010
Author: brian.curtin
Date: Tue Jun 8 23:00:35 2010
New Revision: 81845
Log:
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.
........
Modified:
python/branches/release31-maint/ (props changed)
python/branches/release31-maint/PC/winreg.c
Modified: python/branches/release31-maint/PC/winreg.c
==============================================================================
--- python/branches/release31-maint/PC/winreg.c (original)
+++ python/branches/release31-maint/PC/winreg.c Tue Jun 8 23:00:35 2010
@@ -1036,6 +1036,7 @@
int index;
long rc;
wchar_t *retValueBuf;
+ wchar_t *tmpBuf;
BYTE *retDataBuf;
DWORD retValueSize, bufValueSize;
DWORD retDataSize, bufDataSize;
@@ -1068,7 +1069,6 @@
}
while (1) {
- wchar_t *tmp;
Py_BEGIN_ALLOW_THREADS
rc = RegEnumValueW(hKey,
index,
@@ -1084,13 +1084,13 @@
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;
}
More information about the Python-checkins
mailing list