summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-09-28 22:42:28 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-09-28 22:42:28 (GMT)
commit639418812f11749f99d1160b26325bdfa3a26a6f (patch)
treeeb438b6f5e06b7a5144567ff5c95c190bf850cc1 /PC
parentb9dcffb51e0075f70434febb6ea557cc4d22f5fd (diff)
downloadcpython-639418812f11749f99d1160b26325bdfa3a26a6f.zip
cpython-639418812f11749f99d1160b26325bdfa3a26a6f.tar.gz
cpython-639418812f11749f99d1160b26325bdfa3a26a6f.tar.bz2
Use the new Py_ARRAY_LENGTH macro
Diffstat (limited to 'PC')
-rw-r--r--PC/frozen_dllmain.c4
-rw-r--r--PC/getpathp.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/PC/frozen_dllmain.c b/PC/frozen_dllmain.c
index a8cc885..e1e4eda 100644
--- a/PC/frozen_dllmain.c
+++ b/PC/frozen_dllmain.c
@@ -77,7 +77,7 @@ void PyWinFreeze_ExeTerm(void)
{
// Must go backwards
char **modName;
- for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
+ for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
modName >= possibleModules;
*modName--) {
/* printf("Terminating '%s'\n", *modName);*/
@@ -103,7 +103,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Must go backwards
char **modName;
- for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
+ for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
modName >= possibleModules;
*modName--)
CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
diff --git a/PC/getpathp.c b/PC/getpathp.c
index cd3a4b2..8921aa0 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -251,7 +251,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
if (keyBuf==NULL) goto done;
memcpy(keyBufPtr, keyPrefix, sizeof(keyPrefix)-sizeof(WCHAR));
- keyBufPtr += sizeof(keyPrefix)/sizeof(WCHAR) - 1;
+ keyBufPtr += Py_ARRAY_LENGTH(keyPrefix) - 1;
mbstowcs(keyBufPtr, PyWin_DLLVersionString, versionLen);
keyBufPtr += versionLen;
/* NULL comes with this one! */
@@ -708,8 +708,8 @@ Py_GetProgramFullPath(void)
return progpath;
}
-/* Load python3.dll before loading any extension module that might refer
- to it. That way, we can be sure that always the python3.dll corresponding
+/* Load python3.dll before loading any extension module that might refer
+ to it. That way, we can be sure that always the python3.dll corresponding
to this python DLL is loaded, not a python3.dll that might be on the path
by chance.
Return whether the DLL was found.