[Python-checkins] CVS: python/dist/src/PC getpathp.c,1.14,1.15 import_nt.c,1.11,1.12

Guido van Rossum python-dev@python.org
Wed, 28 Jun 2000 15:20:09 -0700


Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13719

Modified Files:
	getpathp.c import_nt.c 
Log Message:
Trent Mick: familiar simple Win64 patches

Index: getpathp.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/getpathp.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** getpathp.c	2000/05/26 21:49:07	1.14
--- getpathp.c	2000/06/28 22:20:06	1.15
***************
*** 135,139 ****
  	char *dir;
  {
! 	int i = strlen(dir);
  	while (i > 0 && !is_sep(dir[i]))
  		--i;
--- 135,139 ----
  	char *dir;
  {
! 	size_t i = strlen(dir);
  	while (i > 0 && !is_sep(dir[i]))
  		--i;
***************
*** 173,177 ****
  	char *stuff;
  {
! 	int n, k;
  	if (is_sep(stuff[0]))
  		n = 0;
--- 173,177 ----
  	char *stuff;
  {
! 	size_t n, k;
  	if (is_sep(stuff[0]))
  		n = 0;
***************
*** 208,212 ****
  	char *landmark;
  {
- 
  	/* Search from argv0_path, until landmark is found */
  	strcpy(prefix, argv0_path);
--- 208,211 ----
***************
*** 245,249 ****
  	static const TCHAR keyPrefix[] = _T("Software\\Python\\PythonCore\\");
  	static const TCHAR keySuffix[] = _T("\\PythonPath");
! 	int versionLen;
  	DWORD index;
  	TCHAR *keyBuf = NULL;
--- 244,248 ----
  	static const TCHAR keyPrefix[] = _T("Software\\Python\\PythonCore\\");
  	static const TCHAR keySuffix[] = _T("\\PythonPath");
! 	size_t versionLen;
  	DWORD index;
  	TCHAR *keyBuf = NULL;
***************
*** 403,407 ****
  
  			if (delim) {
! 				int len = delim - path;
  				strncpy(progpath, path, len);
  				*(progpath + len) = '\0';
--- 402,406 ----
  
  			if (delim) {
! 				size_t len = delim - path;
  				strncpy(progpath, path, len);
  				*(progpath + len) = '\0';
***************
*** 430,434 ****
  	char argv0_path[MAXPATHLEN+1];
  	char *buf;
! 	int bufsz;
  	char *pythonhome = Py_GetPythonHome();
  	char *envpath = getenv("PYTHONPATH");
--- 429,433 ----
  	char argv0_path[MAXPATHLEN+1];
  	char *buf;
! 	size_t bufsz;
  	char *pythonhome = Py_GetPythonHome();
  	char *envpath = getenv("PYTHONPATH");
***************
*** 555,559 ****
  		char *p = PYTHONPATH;
  		char *q;
! 		int n;
  		for (;;) {
  			q = strchr(p, DELIM);
--- 554,558 ----
  		char *p = PYTHONPATH;
  		char *q;
! 		size_t n;
  		for (;;) {
  			q = strchr(p, DELIM);

Index: import_nt.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/import_nt.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** import_nt.c	2000/04/04 22:48:55	1.11
--- import_nt.c	2000/06/28 22:20:06	1.12
***************
*** 34,38 ****
  	// 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;
  	// alloca == no free required, but memory only local to fn, also no heap fragmentation!
  	moduleKey = alloca(bufSize); 
--- 34,38 ----
  	// Calculate the size for the sprintf buffer.
  	// Get the size of the chars only, plus 1 NULL.
! 	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); 
***************
*** 45,49 ****
  	// use the file extension to locate the type entry.
  	for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
! 		int extLen=strlen(fdp->suffix);
  		if (modNameSize>extLen && strnicmp(pathBuf+(modNameSize-extLen-1),fdp->suffix,extLen)==0)
  			break;
--- 45,49 ----
  	// use the file extension to locate the type entry.
  	for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
! 		size_t extLen = strlen(fdp->suffix);
  		if (modNameSize>extLen && strnicmp(pathBuf+(modNameSize-extLen-1),fdp->suffix,extLen)==0)
  			break;