Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d39d861

Browse files
committed
Fix icc warnings: strlen() returns size_t
1 parent 2841af4 commit d39d861

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Modules/zipimport.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int
6262
zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
6363
{
6464
char *path, *p, *prefix, buf[MAXPATHLEN+2];
65-
int len;
65+
size_t len;
6666

6767
if (!_PyArg_NoKeywords("zipimporter()", kwds))
6868
return -1;
@@ -231,7 +231,7 @@ get_subname(char *fullname)
231231
static int
232232
make_filename(char *prefix, char *name, char *path)
233233
{
234-
int len;
234+
size_t len;
235235
char *p;
236236

237237
len = strlen(prefix);
@@ -249,7 +249,7 @@ make_filename(char *prefix, char *name, char *path)
249249
*p = SEP;
250250
}
251251
len += strlen(name);
252-
return len;
252+
return (int)len;
253253
}
254254

255255
enum zi_module_info {
@@ -659,7 +659,8 @@ read_directory(char *archive)
659659
FILE *fp;
660660
long compress, crc, data_size, file_size, file_offset, date, time;
661661
long header_offset, name_size, header_size, header_position;
662-
long i, l, length, count;
662+
long i, l, count;
663+
size_t length;
663664
char path[MAXPATHLEN + 5];
664665
char name[MAXPATHLEN + 5];
665666
char *p, endof_central_dir[22];

Python/pystrtod.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PyOS_ascii_strtod(const char *nptr, char **endptr)
4444
double val = -1.0;
4545
struct lconv *locale_data;
4646
const char *decimal_point;
47-
int decimal_point_len;
47+
size_t decimal_point_len;
4848
const char *p, *decimal_point_pos;
4949
const char *end = NULL; /* Silence gcc */
5050

@@ -165,9 +165,8 @@ PyOS_ascii_formatd(char *buffer,
165165
{
166166
struct lconv *locale_data;
167167
const char *decimal_point;
168-
int decimal_point_len;
168+
size_t decimal_point_len, rest_len;
169169
char *p;
170-
int rest_len;
171170
char format_char;
172171

173172
/* g_return_val_if_fail (buffer != NULL, NULL); */

0 commit comments

Comments
 (0)