]> granicus.if.org Git - python/commitdiff
Trent Mick: familiar simple Win64 patches
authorGuido van Rossum <guido@python.org>
Wed, 28 Jun 2000 22:20:06 +0000 (22:20 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 28 Jun 2000 22:20:06 +0000 (22:20 +0000)
PC/getpathp.c
PC/import_nt.c

index 4354853522f530f788400f81ddbfc946ec312d80..76ee5e6d4ddc397b90502117484f3f096e173040 100644 (file)
@@ -134,7 +134,7 @@ static void
 reduce(dir)
        char *dir;
 {
-       int i = strlen(dir);
+       size_t i = strlen(dir);
        while (i > 0 && !is_sep(dir[i]))
                --i;
        dir[i] = '\0';
@@ -172,7 +172,7 @@ join(buffer, stuff)
        char *buffer;
        char *stuff;
 {
-       int n, k;
+       size_t n, k;
        if (is_sep(stuff[0]))
                n = 0;
        else {
@@ -207,7 +207,6 @@ search_for_prefix(argv0_path, landmark)
        char *argv0_path;
        char *landmark;
 {
-
        /* Search from argv0_path, until landmark is found */
        strcpy(prefix, argv0_path);
        do {
@@ -244,7 +243,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
        TCHAR *dataBuf = NULL;
        static const TCHAR keyPrefix[] = _T("Software\\Python\\PythonCore\\");
        static const TCHAR keySuffix[] = _T("\\PythonPath");
-       int versionLen;
+       size_t versionLen;
        DWORD index;
        TCHAR *keyBuf = NULL;
        TCHAR *keyBufPtr;
@@ -402,7 +401,7 @@ get_progpath()
                        char *delim = strchr(path, DELIM);
 
                        if (delim) {
-                               int len = delim - path;
+                               size_t len = delim - path;
                                strncpy(progpath, path, len);
                                *(progpath + len) = '\0';
                        }
@@ -429,7 +428,7 @@ calculate_path()
 {
        char argv0_path[MAXPATHLEN+1];
        char *buf;
-       int bufsz;
+       size_t bufsz;
        char *pythonhome = Py_GetPythonHome();
        char *envpath = getenv("PYTHONPATH");
 
@@ -554,7 +553,7 @@ calculate_path()
        else {
                char *p = PYTHONPATH;
                char *q;
-               int n;
+               size_t n;
                for (;;) {
                        q = strchr(p, DELIM);
                        if (q == NULL)
index 2fe44b68593441f515a8a8a701a641d2feff290c..a31ef30a41fdbc4d648df46d6ebeda30ec849ffc 100644 (file)
@@ -33,7 +33,7 @@ FILE *PyWin_FindRegisteredModule( const char *moduleName, struct filedescr **ppF
 
        // Calculate the size for the sprintf buffer.
        // Get the size of the chars only, plus 1 NULL.
-       int bufSize = sizeof(keyPrefix)-1 + strlen(PyWin_DLLVersionString) + sizeof(keySuffix) + strlen(moduleName) + sizeof(debugString) - 1;
+       size_t bufSize = sizeof(keyPrefix)-1 + strlen(PyWin_DLLVersionString) + sizeof(keySuffix) + strlen(moduleName) + sizeof(debugString) - 1;
        // alloca == no free required, but memory only local to fn, also no heap fragmentation!
        moduleKey = alloca(bufSize); 
        sprintf(moduleKey, "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", PyWin_DLLVersionString, moduleName, debugString);
@@ -44,7 +44,7 @@ FILE *PyWin_FindRegisteredModule( const char *moduleName, struct filedescr **ppF
                return NULL;
        // use the file extension to locate the type entry.
        for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
-               int extLen=strlen(fdp->suffix);
+               size_t extLen = strlen(fdp->suffix);
                if (modNameSize>extLen && strnicmp(pathBuf+(modNameSize-extLen-1),fdp->suffix,extLen)==0)
                        break;
        }