Merge branch 'appveyor-check-test-suite'

* appveyor-check-test-suite:
  Appveyor testing expanded
  Fix array overrun in li_carrays testcase
  Warning fixes in generated Python code for 64bit Visual C++ on Windows.
  Warning fixes in generated C# code for 64bit Visual C++ on Windows.
  Warning fixes for 64bit visual c++ on Windows
  Warning fixes in generated Java code for 64bit Visual C++ on Windows.
  Warning fixes for 64bit visual c++ on Windows
  C# gc tests failure fix
  Add a space between literal and string macro
This commit is contained in:
William S Fulton 2015-07-04 21:34:42 +01:00
commit 41fd7c17e0
28 changed files with 89 additions and 74 deletions

View file

@ -20,7 +20,7 @@ extern int gcd(int x, int y);
if (!PyList_Check($input)) {
SWIG_exception(SWIG_ValueError, "Expecting a list");
}
$1 = PyList_Size($input);
$1 = (int)PyList_Size($input);
if ($1 == 0) {
SWIG_exception(SWIG_ValueError, "List must contain at least 1 element");
}
@ -82,7 +82,7 @@ extern int gcdmain(int argc, char *argv[]);
return NULL;
}
$1 = PyString_AsString($input);
$2 = PyString_Size($input);
$2 = (int)PyString_Size($input);
%#endif
}
@ -110,7 +110,7 @@ extern int count(char *bytes, int len, char c);
$2 = (int)len;
Py_DECREF(utf8str);
%#else
$2 = PyString_Size($input);
$2 = (int)PyString_Size($input);
$1 = (char *) malloc($2+1);
memmove($1,PyString_AsString($input),$2);
%#endif

View file

@ -46,7 +46,7 @@ public class runme
}
int actualCount = Klass.getTotal_count();
if (actualCount != expectedCount)
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
}
int wrapper_count = li_boost_shared_ptr.shared_ptr_wrapper_count();

View file

@ -32,7 +32,7 @@ public class li_std_auto_ptr_runme {
};
int actualCount = Klass.getTotal_count();
if (actualCount != expectedCount)
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
}
if (k2.getLabel() != "second")
@ -51,7 +51,7 @@ public class li_std_auto_ptr_runme {
}
int actualCount = Klass.getTotal_count();
if (actualCount != expectedCount)
throw new ApplicationException("Expected count: " + expectedCount + " Actual count: " + actualCount);
Console.Error.WriteLine("Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
}
}
}

View file

@ -31,7 +31,7 @@ public class li_carrays_runme {
{
// global array variable
int length = 5;
int length = 3;
XY xyArrayPointer = li_carrays.getGlobalXYArray();
XYArray xyArray = XYArray.frompointer(xyArrayPointer);
for (int i=0; i<length; i++) {

View file

@ -23,7 +23,7 @@ require_ok('li_carrays');
{
# global array variable
my $length = 5;
my $length = 3;
my $xyArrayPointer = $li_carrays::globalXYArray;
my $xyArray = li_carrays::XYArray::frompointer($xyArrayPointer);
for (my $i=0; $i<$length; $i++) {

View file

@ -6,7 +6,7 @@
%typemap(in) (...)(char *vargs[10]) {
int i;
int argc;
Py_ssize_t argc;
for (i = 0; i < 10; i++) vargs[i] = 0;
argc = PyTuple_Size(varargs);
if (argc > 10) {

View file

@ -203,7 +203,7 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
%typemap(directorin) int "$input = $1;"
%typemap(directorin) unsigned int "$input = $1;"
%typemap(directorin) long "$input = $1;"
%typemap(directorin) unsigned long "$input = $1;"
%typemap(directorin) unsigned long "$input = (unsigned long)$1;"
%typemap(directorin) long long "$input = $1;"
%typemap(directorin) unsigned long long "$input = $1;"
%typemap(directorin) float "$input = $1;"

View file

@ -369,7 +369,7 @@ namespace Swig {
static char *copystr(const char *srcmsg) {
char *target = 0;
if (srcmsg) {
int msglen = strlen(srcmsg) + 1;
size_t msglen = strlen(srcmsg) + 1;
target = new char[msglen];
strncpy(target, srcmsg, msglen);
}

View file

@ -1341,12 +1341,12 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
}
%typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
jbyteArray jb = (jenv)->NewByteArray($2);
(jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
jbyteArray jb = (jenv)->NewByteArray((jsize)$2);
(jenv)->SetByteArrayRegion(jb, 0, (jsize)$2, (jbyte *)$1);
$input = jb;
}
%typemap(directorargout) (char *STRING, size_t LENGTH)
%{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1);
%{(jenv)->GetByteArrayRegion($input, 0, (jsize)$2, (jbyte *)$1);
(jenv)->DeleteLocalRef($input);%}
%typemap(javadirectorin, descriptor="[B") (char *STRING, size_t LENGTH) "$jniinput"
%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }

View file

@ -65,7 +65,7 @@
%typemap(out) char **STRING_ARRAY {
if ($1) {
int i;
int len=0;
jsize len=0;
jstring temp_string;
const jclass clazz = JCALL1(FindClass, jenv, "java/lang/String");

View file

@ -744,7 +744,7 @@ static String *remove_block(Node *kw, const String *inputcode) {
String *name = Getattr(kw,"name");
if (name && (Cmp(name,"noblock") == 0)) {
char *cstr = Char(inputcode);
size_t len = Len(inputcode);
int len = Len(inputcode);
if (len && cstr[0] == '{') {
--len; ++cstr;
if (len && cstr[len - 1] == '}') { --len; }

View file

@ -237,7 +237,7 @@ String *partial_arg(String *s, String *p) {
if (!c) {
return Copy(s);
}
prefix = NewStringWithSize(cp, c - cp);
prefix = NewStringWithSize(cp, (int)(c - cp));
newarg = Copy(s);
Replace(newarg, prefix, "", DOH_REPLACE_ANY | DOH_REPLACE_FIRST);
Delete(prefix);

View file

@ -146,7 +146,7 @@ int DohLen(const DOH *obj) {
}
return 0;
} else {
return strlen((char *) obj);
return (int)strlen((char *) obj);
}
}
@ -636,7 +636,7 @@ int DohRead(DOH *obj, void *buffer, int length) {
return -1;
}
/* Hmmm. Not a file. Maybe it's a real FILE */
return fread(buffer, 1, length, (FILE *) b);
return (int)fread(buffer, 1, length, (FILE *) b);
}
/* -----------------------------------------------------------------------------
@ -654,7 +654,7 @@ int DohWrite(DOH *obj, const void *buffer, int length) {
return -1;
}
/* Hmmm. Not a file. Maybe it's a real FILE */
return fwrite(buffer, 1, length, (FILE *) b);
return (int)fwrite(buffer, 1, length, (FILE *) b);
}
/* -----------------------------------------------------------------------------

View file

@ -52,7 +52,7 @@ static int File_read(DOH *fo, void *buffer, int len) {
DohFile *f = (DohFile *) ObjData(fo);
if (f->filep) {
return fread(buffer, 1, len, f->filep);
return (int)fread(buffer, 1, len, f->filep);
} else if (f->fd) {
#ifdef DOH_INTFILE
return read(f->fd, buffer, len);

View file

@ -304,9 +304,9 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
}
if (strlen(encoder)) {
enc = encode(encoder, Sval);
maxwidth = maxwidth + strlen(newformat) + Len(enc);
maxwidth = maxwidth + (int)strlen(newformat) + Len(enc);
} else {
maxwidth = maxwidth + strlen(newformat) + Len(Sval);
maxwidth = maxwidth + (int)strlen(newformat) + Len(Sval);
}
*(fmt++) = 's';
*fmt = 0;
@ -320,7 +320,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
} else {
nbytes += sprintf(stemp, newformat, Data(Sval));
}
if (Writen(so, stemp, strlen(stemp)) < 0)
if (Writen(so, stemp, (int)strlen(stemp)) < 0)
return -1;
if ((DOH *) Sval != doh) {
Delete(Sval);
@ -346,7 +346,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
} else {
enc = 0;
}
maxwidth = maxwidth + strlen(newformat) + strlen((char *) doh);
maxwidth = maxwidth + (int)strlen(newformat) + (int)strlen((char *) doh);
*(fmt++) = 's';
*fmt = 0;
if ((maxwidth + 1) < OBUFLEN) {
@ -355,7 +355,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
stemp = (char *) DohMalloc(maxwidth + 1);
}
nbytes += sprintf(stemp, newformat, doh);
if (Writen(so, stemp, strlen(stemp)) < 0)
if (Writen(so, stemp, (int)strlen(stemp)) < 0)
return -1;
if (stemp != obuffer) {
DohFree(stemp);
@ -366,7 +366,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
} else {
*(fmt++) = *p;
*fmt = 0;
maxwidth = maxwidth + strlen(newformat) + 64;
maxwidth = maxwidth + (int)strlen(newformat) + 64;
/* Only allocate a buffer if it is too big to fit. Shouldn't have to do
this very often */
@ -401,7 +401,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
default:
break;
}
if (Writen(so, stemp, strlen(stemp)) < 0)
if (Writen(so, stemp, (int)strlen(stemp)) < 0)
return -1;
if (stemp != obuffer)
DohFree(stemp);
@ -414,7 +414,7 @@ int DohvPrintf(DOH *so, const char *format, va_list ap) {
if (state) {
int r;
*fmt = 0;
r = Writen(so, fmt, strlen(fmt));
r = Writen(so, fmt, (int)strlen(fmt));
if (r < 0)
return -1;
nbytes += r;
@ -455,7 +455,7 @@ int DohPrintv(DOHFile * f, ...) {
if (DohCheck(obj)) {
ret += DohDump(obj, f);
} else {
ret += DohWrite(f, obj, strlen((char *) obj));
ret += DohWrite(f, obj, (int)strlen((char *) obj));
}
}
va_end(ap);

View file

@ -687,7 +687,7 @@ static int replace_simple(String *str, char *token, char *rep, int flags, int co
return 0;
base = str->str;
tokenlen = strlen(token);
tokenlen = (int)strlen(token);
s = (*match) (base, base, token, tokenlen);
if (!s)
@ -724,7 +724,7 @@ static int replace_simple(String *str, char *token, char *rep, int flags, int co
}
first = s;
replen = strlen(rep);
replen = (int)strlen(rep);
delta = (replen - tokenlen);

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");
}
}
}
@ -1722,7 +1722,7 @@ public:
Printf(output, "\t\t\treturn new %s%s($r);\n", prefix, Getattr(classLookup(d), "sym:name"));
} else {
Printf(output, "\t\t\t$c = new stdClass();\n");
Printf(output, "\t\t\t$c->"SWIG_PTR" = $r;\n");
Printf(output, "\t\t\t$c->" SWIG_PTR " = $r;\n");
Printf(output, "\t\t\treturn $c;\n");
}
Printf(output, "\t\t}\n\t\treturn $r;\n");
@ -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));
}
}
}

View file

@ -194,7 +194,7 @@ static FILE *Swig_open_file(const_String_or_char_ptr name, int sysfile, int use_
lastpath = filename;
/* Skip the UTF-8 BOM if it's present */
nbytes = fread(bom, 1, 3, f);
nbytes = (int)fread(bom, 1, 3, f);
if (nbytes == 3 && bom[0] == (char)0xEF && bom[1] == (char)0xBB && bom[2] == (char)0xBF) {
/* skip */
} else {
@ -369,7 +369,7 @@ String *Swig_file_filename(const_String_or_char_ptr filename) {
String *Swig_file_dirname(const_String_or_char_ptr filename) {
const char *delim = SWIG_FILE_DELIMITER;
const char *c = strrchr(Char(filename), *delim);
return c ? NewStringWithSize(filename, c - Char(filename) + 1) : NewString("");
return c ? NewStringWithSize(filename, (int)(c - Char(filename) + 1)) : NewString("");
}
/*

View file

@ -127,7 +127,7 @@ String *Swig_strip_c_comments(const String *s) {
}
if (comment_begin && comment_end) {
int size = comment_begin - Char(s);
int size = (int)(comment_begin - Char(s));
String *stripmore = 0;
stripped = NewStringWithSize(s, size);
Printv(stripped, comment_end + 1, NIL);
@ -808,7 +808,7 @@ void Swig_scopename_split(const String *s, String **rprefix, String **rlast) {
*rlast = Copy(s);
return;
} else {
*rprefix = NewStringWithSize(cc, co - cc - 2);
*rprefix = NewStringWithSize(cc, (int)(co - cc - 2));
*rlast = NewString(co);
return;
}
@ -835,7 +835,7 @@ void Swig_scopename_split(const String *s, String **rprefix, String **rlast) {
}
if (cc != tmp) {
*rprefix = NewStringWithSize(tmp, cc - tmp);
*rprefix = NewStringWithSize(tmp, (int)(cc - tmp));
*rlast = NewString(cc + 2);
return;
} else {
@ -858,7 +858,7 @@ String *Swig_scopename_prefix(const String *s) {
if (co == cc) {
return 0;
} else {
String *prefix = NewStringWithSize(cc, co - cc - 2);
String *prefix = NewStringWithSize(cc, (int)(co - cc - 2));
return prefix;
}
}
@ -884,7 +884,7 @@ String *Swig_scopename_prefix(const String *s) {
}
if (cc != tmp) {
return NewStringWithSize(tmp, cc - tmp);
return NewStringWithSize(tmp, (int)(cc - tmp));
} else {
return 0;
}
@ -977,7 +977,7 @@ String *Swig_scopename_first(const String *s) {
}
}
if (*c && (c != tmp)) {
return NewStringWithSize(tmp, c - tmp);
return NewStringWithSize(tmp, (int)(c - tmp));
} else {
return 0;
}
@ -1219,8 +1219,8 @@ static int split_regex_pattern_subst(String *s, String **pattern, String **subst
if (!p) goto err_out;
sube = p;
*pattern = NewStringWithSize(pats, pate - pats);
*subst = NewStringWithSize(subs, sube - subs);
*pattern = NewStringWithSize(pats, (int)(pate - pats));
*subst = NewStringWithSize(subs, (int)(sube - subs));
*input = p + 1;
return 1;
@ -1270,10 +1270,10 @@ String *replace_captures(int num_captures, const char *input, String *subst, int
/* Copy part without substitutions */
const char *q = strchr(p, '\\');
if (!q) {
copy_with_maybe_case_conversion(result, p, strlen(p), &convertCase, convertNextOnly);
copy_with_maybe_case_conversion(result, p, (int)strlen(p), &convertCase, convertNextOnly);
break;
}
copy_with_maybe_case_conversion(result, p, q - p, &convertCase, convertNextOnly);
copy_with_maybe_case_conversion(result, p, (int)(q - p), &convertCase, convertNextOnly);
p = q + 1;
/* Handle substitution */
@ -1350,7 +1350,7 @@ String *Swig_string_regex(String *s) {
pcre_error, Char(pattern), pcre_errorpos);
exit(1);
}
rc = pcre_exec(compiled_pat, NULL, input, strlen(input), 0, 0, captures, 30);
rc = pcre_exec(compiled_pat, NULL, input, (int)strlen(input), 0, 0, captures, 30);
if (rc >= 0) {
res = replace_captures(rc, input, subst, captures, pattern, s);
} else if (rc != PCRE_ERROR_NOMATCH) {

View file

@ -578,7 +578,7 @@ void Swig_name_object_inherit(Hash *namehash, String *base, String *derived) {
bprefix = NewStringf("%s::", base);
dprefix = NewStringf("%s::", derived);
cbprefix = Char(bprefix);
plen = strlen(cbprefix);
plen = (int)strlen(cbprefix);
for (ki = First(namehash); ki.key; ki = Next(ki)) {
char *k = Char(ki.key);
if (strncmp(k, cbprefix, plen) == 0) {
@ -1074,7 +1074,7 @@ static List *Swig_make_attrlist(const char *ckey) {
String *nattr;
const char *rattr = strchr(++cattr, '$');
while (rattr) {
nattr = NewStringWithSize(cattr, rattr - cattr);
nattr = NewStringWithSize(cattr, (int)(rattr - cattr));
Append(list, nattr);
Delete(nattr);
cattr = rattr + 1;

View file

@ -195,7 +195,7 @@ int SwigType_ispointer_return(const SwigType *t) {
if (!t)
return 0;
c = Char(t);
idx = strlen(c) - 4;
idx = (int)strlen(c) - 4;
if (idx >= 0) {
return (strcmp(c + idx, ").p.") == 0);
}
@ -208,7 +208,7 @@ int SwigType_isreference_return(const SwigType *t) {
if (!t)
return 0;
c = Char(t);
idx = strlen(c) - 4;
idx = (int)strlen(c) - 4;
if (idx >= 0) {
return (strcmp(c + idx, ").r.") == 0);
}
@ -485,7 +485,7 @@ String *SwigType_namestr(const SwigType *t) {
if (!c || !strstr(c + 2, ")>"))
return NewString(t);
r = NewStringWithSize(d, c - d);
r = NewStringWithSize(d, (int)(c - d));
if (*(c - 1) == '<')
Putc(' ', r);
Putc('<', r);

View file

@ -1844,7 +1844,7 @@ static List *split_embedded_typemap(String *s) {
}
}
if ((level == 0) && angle_level == 0 && ((*c == ',') || (*c == ')'))) {
String *tmp = NewStringWithSize(start, c - start);
String *tmp = NewStringWithSize(start, (int)(c - start));
Append(args, tmp);
Delete(tmp);
start = c + 1;
@ -1915,10 +1915,10 @@ static void replace_embedded_typemap(String *s, ParmList *parm_sublist, Wrapper
c++;
}
if (end) {
dollar_typemap = NewStringWithSize(start, (end - start));
dollar_typemap = NewStringWithSize(start, (int)((end - start)));
syntax_error = 0;
} else {
dollar_typemap = NewStringWithSize(start, (c - start));
dollar_typemap = NewStringWithSize(start, (int)((c - start)));
}
if (!syntax_error) {
@ -1963,7 +1963,7 @@ static void replace_embedded_typemap(String *s, ParmList *parm_sublist, Wrapper
char *eq = strchr(Char(parm), '=');
char *c = Char(parm);
if (eq && (eq - c > 0)) {
String *name = NewStringWithSize(c, eq - c);
String *name = NewStringWithSize(c, (int)(eq - c));
String *value = NewString(eq + 1);
Insert(name, 0, "$");
Setattr(vars, name, value);

View file

@ -361,7 +361,7 @@ SwigType *SwigType_del_pointer(SwigType *t) {
printf("Fatal error. SwigType_del_pointer applied to non-pointer.\n");
abort();
}
Delslice(t, 0, (c - s) + 2);
Delslice(t, 0, (int)((c - s) + 2));
return t;
}
@ -915,7 +915,7 @@ SwigType *SwigType_add_template(SwigType *t, ParmList *parms) {
String *SwigType_templateprefix(const SwigType *t) {
const char *s = Char(t);
const char *c = strstr(s, "<(");
return c ? NewStringWithSize(s, c - s) : NewString(s);
return c ? NewStringWithSize(s, (int)(c - s)) : NewString(s);
}
/* -----------------------------------------------------------------------------
@ -966,7 +966,7 @@ String *SwigType_templatesuffix(const SwigType *t) {
String *SwigType_istemplate_templateprefix(const SwigType *t) {
const char *s = Char(t);
const char *c = strstr(s, "<(");
return c ? NewStringWithSize(s, c - s) : 0;
return c ? NewStringWithSize(s, (int)(c - s)) : 0;
}
/* -----------------------------------------------------------------------------
@ -989,7 +989,7 @@ String *SwigType_istemplate_only_templateprefix(const SwigType *t) {
const char *s = Char(t);
if (len >= 4 && strcmp(s + len - 2, ")>") == 0) {
const char *c = strstr(s, "<(");
return c ? NewStringWithSize(s, c - s) : 0;
return c ? NewStringWithSize(s, (int)(c - s)) : 0;
} else {
return 0;
}
@ -1022,7 +1022,7 @@ String *SwigType_templateargs(const SwigType *t) {
nest--;
c++;
}
return NewStringWithSize(start, c - start);
return NewStringWithSize(start, (int)(c - start));
}
c++;
}

View file

@ -5,13 +5,26 @@ platform:
environment:
matrix:
- SWIGLANG: csharp
VSVER: 14
- SWIGLANG: csharp
VSVER: 12
- SWIGLANG: java
VSVER: 12
- SWIGLANG: python
VSVER: 12
VER: 27
- SWIGLANG: python
VSVER: 12
VER: 34
PY3: 1
matrix:
allow_failures:
- platform: x64
SWIGLANG: python
VSVER: 12
VER: 27
install:
- date /T & time /T
- set PATH=C:\cygwin\bin;%PATH%
@ -30,7 +43,9 @@ install:
$env:VCVARS_PLATFORM="amd64"
$env:LANG_PLATFORM="-x64"
}
- call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
- echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- nuget install pcre -Verbosity detailed -Version 8.33.0.1 -OutputDirectory C:\pcre
- set PCRE_ROOT=C:/pcre/pcre.8.33.0.1/build/native
- set PATH=C:\Python%VER%%LANG_PLATFORM%;%PATH%
@ -64,7 +79,7 @@ test_script:
- bash -c "file ./swig.exe"
- bash -c "time make -k check-%SWIGLANG%-version"
- bash -c "time make -k check-%SWIGLANG%-examples %CHECK_OPTIONS%"
- bash -c "time make -k partialcheck-%SWIGLANG%-test-suite %CHECK_OPTIONS%"
- bash -c "time make -k check-%SWIGLANG%-test-suite %CHECK_OPTIONS%"
# Do not build on tags (GitHub only)
skip_tags: true