mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Trent Mick: use size_t instead of int where appropriate (various spots).
This commit is contained in:
parent
7d0ae5e14e
commit
b6f657c0cc
1 changed files with 9 additions and 9 deletions
|
|
@ -163,7 +163,7 @@ static void
|
||||||
reduce(dir)
|
reduce(dir)
|
||||||
char *dir;
|
char *dir;
|
||||||
{
|
{
|
||||||
int i = strlen(dir);
|
size_t i = strlen(dir);
|
||||||
while (i > 0 && dir[i] != SEP)
|
while (i > 0 && dir[i] != SEP)
|
||||||
--i;
|
--i;
|
||||||
dir[i] = '\0';
|
dir[i] = '\0';
|
||||||
|
|
@ -241,7 +241,7 @@ joinpath(buffer, stuff)
|
||||||
char *buffer;
|
char *buffer;
|
||||||
char *stuff;
|
char *stuff;
|
||||||
{
|
{
|
||||||
int n, k;
|
size_t n, k;
|
||||||
if (stuff[0] == SEP)
|
if (stuff[0] == SEP)
|
||||||
n = 0;
|
n = 0;
|
||||||
else {
|
else {
|
||||||
|
|
@ -262,7 +262,7 @@ search_for_prefix(argv0_path, home)
|
||||||
char *argv0_path;
|
char *argv0_path;
|
||||||
char *home;
|
char *home;
|
||||||
{
|
{
|
||||||
int n;
|
size_t n;
|
||||||
char *vpath;
|
char *vpath;
|
||||||
|
|
||||||
/* If PYTHONHOME is set, we believe it unconditionally */
|
/* If PYTHONHOME is set, we believe it unconditionally */
|
||||||
|
|
@ -331,7 +331,7 @@ search_for_exec_prefix(argv0_path, home)
|
||||||
char *argv0_path;
|
char *argv0_path;
|
||||||
char *home;
|
char *home;
|
||||||
{
|
{
|
||||||
int n;
|
size_t n;
|
||||||
|
|
||||||
/* If PYTHONHOME is set, we believe it unconditionally */
|
/* If PYTHONHOME is set, we believe it unconditionally */
|
||||||
if (home) {
|
if (home) {
|
||||||
|
|
@ -393,8 +393,8 @@ calculate_path()
|
||||||
char argv0_path[MAXPATHLEN+1];
|
char argv0_path[MAXPATHLEN+1];
|
||||||
int pfound, efound; /* 1 if found; -1 if found build directory */
|
int pfound, efound; /* 1 if found; -1 if found build directory */
|
||||||
char *buf;
|
char *buf;
|
||||||
int bufsz;
|
size_t bufsz;
|
||||||
int prefixsz;
|
size_t prefixsz;
|
||||||
char *defpath = pythonpath;
|
char *defpath = pythonpath;
|
||||||
#ifdef WITH_NEXT_FRAMEWORK
|
#ifdef WITH_NEXT_FRAMEWORK
|
||||||
NSModule pythonModule;
|
NSModule pythonModule;
|
||||||
|
|
@ -429,7 +429,7 @@ calculate_path()
|
||||||
char *delim = strchr(path, DELIM);
|
char *delim = strchr(path, DELIM);
|
||||||
|
|
||||||
if (delim) {
|
if (delim) {
|
||||||
int len = delim - path;
|
size_t len = delim - path;
|
||||||
strncpy(progpath, path, len);
|
strncpy(progpath, path, len);
|
||||||
*(progpath + len) = '\0';
|
*(progpath + len) = '\0';
|
||||||
}
|
}
|
||||||
|
|
@ -557,8 +557,8 @@ calculate_path()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delim) {
|
if (delim) {
|
||||||
int len = delim - defpath + 1;
|
size_t len = delim - defpath + 1;
|
||||||
int end = strlen(buf) + len;
|
size_t end = strlen(buf) + len;
|
||||||
strncat(buf, defpath, len);
|
strncat(buf, defpath, len);
|
||||||
*(buf + end) = '\0';
|
*(buf + end) = '\0';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue