Warning fixes for 64bit visual c++ on Windows

This commit is contained in:
William S Fulton 2015-07-03 19:06:39 +01:00
commit edcdaaec16
17 changed files with 55 additions and 55 deletions

View file

@ -2629,7 +2629,7 @@ private:
// exponentiation. Treat anything else as too complicated to
// handle as a Go constant.
char *p = Char(value);
int len = strlen(p);
int len = (int)strlen(p);
bool need_copy = false;
while (len > 0) {
char c = p[len - 1];

View file

@ -595,7 +595,7 @@ void SWIG_getoptions(int argc, char *argv[]) {
Swig_filename_correct(outfile_name);
if (!outfile_name_h || !dependencies_file) {
char *ext = strrchr(Char(outfile_name), '.');
String *basename = ext ? NewStringWithSize(Char(outfile_name), Char(ext) - Char(outfile_name)) : NewString(outfile_name);
String *basename = ext ? NewStringWithSize(Char(outfile_name), (int)(Char(ext) - Char(outfile_name))) : NewString(outfile_name);
if (!dependencies_file) {
dependencies_file = NewStringf("%s.%s", basename, depends_extension);
}
@ -899,7 +899,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
String *vers = NewString("SWIG_VERSION 0x");
int count = 0;
while (token) {
int len = strlen(token);
int len = (int)strlen(token);
assert(len == 1 || len == 2);
Printf(vers, "%s%s", (len == 1) ? "0" : "", token);
token = strtok(NULL, ".");

View file

@ -990,7 +990,7 @@ public:
find_marker += strlen("(*Stream:");
if (next) {
int num_chars = next - find_marker;
int num_chars = (int)(next - find_marker);
String *stream_name = NewString(find_marker);
Delslice(stream_name, num_chars, Len(stream_name));
File *fout = Swig_filebyname(stream_name);
@ -1001,7 +1001,7 @@ public:
if (!following)
following = next + strlen(next);
String *chunk = NewString(next);
Delslice(chunk, following - next, Len(chunk));
Delslice(chunk, (int)(following - next), Len(chunk));
Printv(fout, chunk, NIL);
}
}

View file

@ -190,7 +190,7 @@ class PHP : public Language {
p = strchr(p, '"');
if (p) {
++p;
Insert(action, p - Char(action), " TSRMLS_CC");
Insert(action, (int)(p - Char(action)), " TSRMLS_CC");
}
}
}
@ -2424,7 +2424,7 @@ done:
String *target = Swig_method_decl(0, decl, classname, parms, 0, 0);
const char * p = Char(target);
const char * comma = strchr(p, ',');
size_t ins = comma ? comma - p : Len(target) - 1;
int ins = comma ? (int)(comma - p) : Len(target) - 1;
Insert(target, ins, " TSRMLS_DC");
call = Swig_csuperclass_call(0, basetype, superparms);
@ -2443,7 +2443,7 @@ done:
String *target = Swig_method_decl(0, decl, classname, parms, 0, 1);
const char * p = Char(target);
const char * comma = strchr(p, ',');
size_t ins = comma ? comma - p : Len(target) - 1;
int ins = comma ? (int)(comma - p) : Len(target) - 1;
Insert(target, ins, " TSRMLS_DC");
Printf(f_directors_h, " %s;\n", target);

View file

@ -1184,7 +1184,7 @@ public:
const char *py3_end1 = Strchr(rpkg, '.');
if (!py3_end1)
py3_end1 = (Char(rpkg)) + Len(rpkg);
py3_rlen1 = py3_end1 - (Char(rpkg));
py3_rlen1 = (int)(py3_end1 - Char(rpkg));
} else {
rpkg = NewString("");
}
@ -1916,7 +1916,7 @@ public:
// Avoid unnecessary string allocation in the common case when we don't
// need to remove any suffix.
return *end == '\0' ? v : NewStringWithSize(s, end - s);
return *end == '\0' ? v : NewStringWithSize(s, (int)(end - s));
}
return NIL;
@ -1998,7 +1998,7 @@ public:
if (py3) {
if (end - s > 1) {
result = NewString("0o");
Append(result, NewStringWithSize(s + 1, end - s - 1));
Append(result, NewStringWithSize(s + 1, (int)(end - s - 1)));
}
}
}
@ -2007,7 +2007,7 @@ public:
// Avoid unnecessary string allocation in the common case when we don't
// need to remove any suffix.
if (!result)
result = *end == '\0' ? v : NewStringWithSize(s, end - s);
result = *end == '\0' ? v : NewStringWithSize(s, (int)(end - s));
}
}
}