mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Use macro versions instead of function versions when we already know the type.
This will hopefully get rid of some Coverity warnings, be a hint to developers, and be marginally faster. Some asserts were added when the type is currently known, but depends on values from another function.
This commit is contained in:
		
							parent
							
								
									70f05c5d7f
								
							
						
					
					
						commit
						2aa9a5dfdd
					
				
					 7 changed files with 19 additions and 16 deletions
				
			
		|  | @ -1216,12 +1216,12 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, | |||
| #endif | ||||
| 		if (!PyString_Check(v)) | ||||
| 			continue; | ||||
| 		len = PyString_Size(v); | ||||
| 		len = PyString_GET_SIZE(v); | ||||
| 		if (len + 2 + namelen + MAXSUFFIXSIZE >= buflen) { | ||||
| 			Py_XDECREF(copy); | ||||
| 			continue; /* Too long */ | ||||
| 		} | ||||
| 		strcpy(buf, PyString_AsString(v)); | ||||
| 		strcpy(buf, PyString_AS_STRING(v)); | ||||
| 		if (strlen(buf) != len) { | ||||
| 			Py_XDECREF(copy); | ||||
| 			continue; /* v contains '\0' */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Neal Norwitz
						Neal Norwitz