diff options
author | Olly Betts <olly@survex.com> | 2022-03-20 18:42:50 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2022-03-20 18:42:50 +1300 |
commit | 029ddab8b55311b54fdd9ca1ac8acef596d34d46 (patch) | |
tree | 7d86fd19a22855fa0953d960f9fa6bccd119ee23 | |
parent | 90aa3f75ba0d4d1ac6984be31f3711968f590c4c (diff) | |
download | swig-029ddab8b55311b54fdd9ca1ac8acef596d34d46.tar.gz |
[ci] Try to fix failing appveyor python builds
-rw-r--r-- | Doc/Manual/Extending.html | 2 | ||||
-rw-r--r-- | Lib/perl5/perlrun.swg | 2 | ||||
-rw-r--r-- | Lib/swigrun.swg | 4 | ||||
-rw-r--r-- | Source/CParse/parser.y | 2 | ||||
-rw-r--r-- | Source/CParse/templ.c | 4 | ||||
-rw-r--r-- | Source/DOH/fio.c | 4 | ||||
-rw-r--r-- | Source/Modules/lang.cxx | 8 | ||||
-rw-r--r-- | Source/Modules/lua.cxx | 4 | ||||
-rw-r--r-- | Source/Modules/octave.cxx | 2 | ||||
-rw-r--r-- | Source/Modules/overload.cxx | 4 | ||||
-rw-r--r-- | Source/Modules/perl5.cxx | 6 | ||||
-rw-r--r-- | Source/Modules/python.cxx | 6 | ||||
-rw-r--r-- | Source/Modules/r.cxx | 6 | ||||
-rw-r--r-- | Source/Modules/tcl8.cxx | 2 | ||||
-rw-r--r-- | Source/Modules/typepass.cxx | 2 | ||||
-rw-r--r-- | Source/Preprocessor/cpp.c | 6 | ||||
-rw-r--r-- | Source/Swig/naming.c | 4 | ||||
-rw-r--r-- | Source/Swig/typemap.c | 2 | ||||
-rw-r--r-- | Source/Swig/typeobj.c | 4 | ||||
-rw-r--r-- | appveyor.yml | 5 |
20 files changed, 40 insertions, 39 deletions
diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html index ad90d7b63..302b694c2 100644 --- a/Doc/Manual/Extending.html +++ b/Doc/Manual/Extending.html @@ -2621,7 +2621,7 @@ void Language::main(int argc, char *argv[]) { } else { Swig_arg_error(); } - } else if ((strcmp(argv[i], "-proxy") == 0)) { + } else if (strcmp(argv[i], "-proxy") == 0) { proxy_flag = 1; Swig_mark_arg(i); } else if (strcmp(argv[i], "-keyword") == 0) { diff --git a/Lib/perl5/perlrun.swg b/Lib/perl5/perlrun.swg index 28703d1a6..f81a96840 100644 --- a/Lib/perl5/perlrun.swg +++ b/Lib/perl5/perlrun.swg @@ -372,7 +372,7 @@ SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_ swig_cast_info *tc; const char *c = 0; - if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; + if (!obj || !SvOK(obj)) return SWIG_ERROR; c = SvPV_nolen(obj); /* Pointer values must start with leading underscore */ if (*c != '_') return SWIG_ERROR; diff --git a/Lib/swigrun.swg b/Lib/swigrun.swg index de0db2dc3..d38281d88 100644 --- a/Lib/swigrun.swg +++ b/Lib/swigrun.swg @@ -318,7 +318,7 @@ SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) { */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); + return (!ty || !ty->converter) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -328,7 +328,7 @@ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { + while (ty && ty->dcast) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 7a5ef42c5..83e71fd23 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -1730,7 +1730,7 @@ program : interface { Setattr($1,"classes",classes); Setattr($1,"name",ModuleName); - if ((!module_node) && ModuleName) { + if (!module_node && ModuleName) { module_node = new_node("module"); Setattr(module_node,"name",ModuleName); } diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c index f8c926d37..fcf4a0a2c 100644 --- a/Source/CParse/templ.c +++ b/Source/CParse/templ.c @@ -810,7 +810,7 @@ static Node *template_locate(String *name, Parm *tparms, Symtab *tscope) { success: Delete(tname); Delete(possiblepartials); - if ((template_debug) && (n)) { + if (template_debug && n) { /* Printf(stdout, "Node: %p\n", n); Swig_print_node(n); @@ -868,7 +868,7 @@ Node *Swig_cparse_template_locate(String *name, Parm *tparms, Symtab *tscope) { Swig_error(cparse_file, cparse_line, "Template '%s' undefined.\n", name); } - if ((template_debug) && (n)) { + if (template_debug && n) { Printf(stdout, "Templated function found: %p\n", n); Swig_print_node(n); } diff --git a/Source/DOH/fio.c b/Source/DOH/fio.c index 77419008c..5c03b1b08 100644 --- a/Source/DOH/fio.c +++ b/Source/DOH/fio.c @@ -450,7 +450,7 @@ int DohPrintv(DOHFile * f, ...) { va_start(ap, f); while (1) { obj = va_arg(ap, void *); - if ((!obj) || (obj == DohNone)) + if (!obj || obj == DohNone) break; if (DohCheck(obj)) { ret += DohDump(obj, f); @@ -475,7 +475,7 @@ int DohCopyto(DOH *in, DOH *out) { char *cw; char buffer[16384]; - if ((!in) || (!out)) + if (!in || !out) return 0; while (1) { ret = Read(in, buffer, 16384); diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index eb61752b8..042196a66 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -653,7 +653,7 @@ int Language::includeDirective(Node *n) { int Language::insertDirective(Node *n) { /* %insert directive */ - if ((!ImportMode) || Getattr(n, "generated")) { + if (!ImportMode || Getattr(n, "generated")) { String *code = Getattr(n, "code"); String *section = Getattr(n, "section"); File *f = 0; @@ -2703,7 +2703,7 @@ int Language::constructorDeclaration(Node *n) { over = Swig_symbol_isoverloaded(n); if (over) over = first_nontemplate(over); - if ((over) && (!overloading)) { + if (over && !overloading) { /* If the symbol is overloaded. We check to see if it is a copy constructor. If so, we invoke copyconstructorHandler() as a special case. */ if (Getattr(n, "copy_constructor") && (!Getattr(CurrentClass, "has_copy_constructor"))) { @@ -3332,7 +3332,7 @@ Node *Language::classLookup(const SwigType *s) { break; nstab = Getattr(n, "sym:symtab"); n = 0; - if ((!nstab) || (nstab == stab)) { + if (!nstab || nstab == stab) { break; } stab = nstab; @@ -3420,7 +3420,7 @@ Node *Language::enumLookup(SwigType *s) { break; nstab = Getattr(n, "sym:symtab"); n = 0; - if ((!nstab) || (nstab == stab)) { + if (!nstab || nstab == stab) { break; } stab = nstab; diff --git a/Source/Modules/lua.cxx b/Source/Modules/lua.cxx index 18cf8a346..2a2f4b599 100644 --- a/Source/Modules/lua.cxx +++ b/Source/Modules/lua.cxx @@ -1422,7 +1422,7 @@ public: b = First(baselist); while (b.item) { String *bname = Getattr(b.item, "name"); - if ((!bname) || GetFlag(b.item, "feature:ignore") || (!Getattr(b.item, "module"))) { + if (!bname || GetFlag(b.item, "feature:ignore") || !Getattr(b.item, "module")) { b = Next(b); continue; } @@ -1972,7 +1972,7 @@ public: // For the sake of compiling with -Wall -Werror we print constants // only when necessary int need_constants = 0; - if ( (elua_ltr || eluac_ltr) && (old_metatable_bindings) ) + if ((elua_ltr || eluac_ltr) && old_metatable_bindings) need_constants = 1; else if (!is_instance) // static part need constants tab need_constants = 1; diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 9e5bd17a1..f30032600 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -1007,7 +1007,7 @@ public: b = First(baselist); while (b.item) { String *bname = Getattr(b.item, "name"); - if ((!bname) || GetFlag(b.item, "feature:ignore") || (!Getattr(b.item, "module"))) { + if (!bname || GetFlag(b.item, "feature:ignore") || !Getattr(b.item, "module")) { b = Next(b); continue; } diff --git a/Source/Modules/overload.cxx b/Source/Modules/overload.cxx index 8a4ce48f7..8786e05b0 100644 --- a/Source/Modules/overload.cxx +++ b/Source/Modules/overload.cxx @@ -158,12 +158,12 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) { } String *t1 = Getattr(p1, "tmap:typecheck:precedence"); String *t2 = Getattr(p2, "tmap:typecheck:precedence"); - if ((!t1) && (!nodes[i].error)) { + if (!t1 && !nodes[i].error) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0)); nodes[i].error = 1; - } else if ((!t2) && (!nodes[j].error)) { + } else if (!t2 && !nodes[j].error) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n), "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0)); diff --git a/Source/Modules/perl5.cxx b/Source/Modules/perl5.cxx index 1f6476b6b..b52927ea2 100644 --- a/Source/Modules/perl5.cxx +++ b/Source/Modules/perl5.cxx @@ -935,7 +935,7 @@ public: * Create a stub for this function, provided it's not a member function * -------------------------------------------------------------------- */ - if ((blessed) && (!member_func)) { + if (blessed && !member_func) { Printv(func_stubs, "*", iname, " = *", cmodule, "::", iname, ";\n", NIL); } @@ -1257,7 +1257,7 @@ public: if (verbose > 0) { fprintf(stdout, "setclassname: Found actualpackage: %s\n", Char(actualpackage)); } - if ((!compat) && (!Strchr(symname,':'))) { + if (!compat && !Strchr(symname,':')) { fullname = NewStringf("%s::%s",actualpackage,symname); } else { fullname = NewString(symname); @@ -1896,7 +1896,7 @@ public: String *code = Getattr(n, "code"); String *section = Getattr(n, "section"); - if ((!ImportMode) && (Cmp(section, "perl") == 0)) { + if (!ImportMode && Cmp(section, "perl") == 0) { Printv(additional_perl_code, code, NIL); } else { Language::insertDirective(n); diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 69c13db48..cd3a23e31 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3474,7 +3474,7 @@ public: if (builtin) Printf(f_init, "\t SwigPyBuiltin_AddPublicSymbol(public_interface, \"%s\");\n", global_name); have_globals = 1; - if (!builtin && (shadow) && (!(shadow & PYSHADOW_MEMBER))) { + if (!builtin && shadow && (!(shadow & PYSHADOW_MEMBER))) { Printf(f_shadow_stubs, "%s = %s.%s\n", global_name, module, global_name); } } @@ -3632,7 +3632,7 @@ public: if ((tm = Swig_typemap_lookup("constcode", n, name, 0))) { Replaceall(tm, "$value", value); - if (needs_swigconstant(n) && !builtin && (shadow) && (!(shadow & PYSHADOW_MEMBER)) && (!in_class || !Getattr(n, "feature:python:callback"))) { + if (needs_swigconstant(n) && !builtin && shadow && !(shadow & PYSHADOW_MEMBER) && (!in_class || !Getattr(n, "feature:python:callback"))) { // Generate `*_swigconstant()` method which registers the new constant. // // *_swigconstant methods are required for constants of class type. @@ -3670,7 +3670,7 @@ public: return SWIG_NOWRAP; } - if (!builtin && (shadow) && (!(shadow & PYSHADOW_MEMBER))) { + if (!builtin && shadow && !(shadow & PYSHADOW_MEMBER)) { String *f_s; if (!in_class) { f_s = f_shadow; diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 9d9204c0f..ffca1d173 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -1362,7 +1362,7 @@ List * R::Swig_overload_rank(Node *n, Parm *p2 = nodes[j].parms; int differ = 0; int num_checked = 0; - while (p1 && p2 && (num_checked < nodes[i].argc)) { + while (p1 && p2 && num_checked < nodes[i].argc) { if (debugMode) { Printf(stdout,"p1 = '%s', p2 = '%s'\n", Getattr(p1,"type"), Getattr(p2,"type")); } @@ -1379,12 +1379,12 @@ List * R::Swig_overload_rank(Node *n, if (debugMode) { Printf(stdout,"t1 = '%s', t2 = '%s'\n", t1, t2); } - if ((!t1) && (!nodes[i].error)) { + if (!t1 && !nodes[i].error) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0)); nodes[i].error = 1; - } else if ((!t2) && (!nodes[j].error)) { + } else if (!t2 && !nodes[j].error) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n), "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0)); diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index 641dfc866..4e8660cc9 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -807,7 +807,7 @@ public: b = First(baselist); while (b.item) { String *bname = Getattr(b.item, "name"); - if ((!bname) || GetFlag(b.item, "feature:ignore") || (!Getattr(b.item, "module"))) { + if (!bname || GetFlag(b.item, "feature:ignore") || !Getattr(b.item, "module")) { b = Next(b); continue; } diff --git a/Source/Modules/typepass.cxx b/Source/Modules/typepass.cxx index e1c3753ce..27719f178 100644 --- a/Source/Modules/typepass.cxx +++ b/Source/Modules/typepass.cxx @@ -601,7 +601,7 @@ class TypePass:private Dispatcher { virtual int classforwardDeclaration(Node *n) { /* Can't do inside a C struct because it breaks C nested structure wrapping */ - if ((!inclass) || (CPlusPlus)) { + if (!inclass || CPlusPlus) { String *name = Getattr(n, "name"); SwigType_typedef_class(name); } diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c index 34ace2d77..ecdc0d372 100644 --- a/Source/Preprocessor/cpp.c +++ b/Source/Preprocessor/cpp.c @@ -66,7 +66,7 @@ static int skip_tochar(String *s, int ch, String *out) { break; if (c == '\\') { c = Getc(s); - if ((c != EOF) && (out)) + if (c != EOF && out) Putc(c, out); } } @@ -1155,7 +1155,7 @@ static DOH *Preprocessor_replace(DOH *s) { Seek(s, -1, SEEK_CUR); } lenargs = Len(args); - if ((!args) || (!lenargs)) { + if (!args || !lenargs) { /* This is not a defined() operator. */ Append(ns, id); state = 0; @@ -1770,7 +1770,7 @@ String *Preprocessor_parse(String *s) { } } else if (Equal(id, kpp_line)) { } else if (Equal(id, kpp_include)) { - if (((include_all) || (import_all)) && (allow)) { + if ((include_all || import_all) && allow) { String *s1, *s2, *fn; String *dirname; int sysfile = 0; diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c index 1599941b7..b26c12501 100644 --- a/Source/Swig/naming.c +++ b/Source/Swig/naming.c @@ -363,7 +363,7 @@ static DOH *name_object_get(Hash *namehash, String *tname, SwigType *decl, SwigT Hash *n = Getattr(namehash, tname); if (n) { rn = get_object(n, decl); - if ((!rn) && ncdecl) + if (!rn && ncdecl) rn = get_object(n, ncdecl); if (!rn) rn = get_object(n, 0); @@ -380,7 +380,7 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType return 0; /* DB: This removed to more tightly control feature/name matching */ - /* if ((decl) && (SwigType_isqualifier(decl))) { + /* if (decl && SwigType_isqualifierdecl) { ncdecl = strchr(Char(decl),'.'); ncdecl++; } diff --git a/Source/Swig/typemap.c b/Source/Swig/typemap.c index 58346abb9..ee39f4738 100644 --- a/Source/Swig/typemap.c +++ b/Source/Swig/typemap.c @@ -1207,7 +1207,7 @@ static void typemap_locals(String *s, ParmList *l, Wrapper *f, int argnum) { /* If the user gave us $type as the name of the local variable, we'll use the passed datatype instead */ - if ((argnum >= 0) && (!isglobal)) { + if (argnum >= 0 && !isglobal) { Printf(str, "%s%d", pn, argnum); } else { Append(str, pn); diff --git a/Source/Swig/typeobj.c b/Source/Swig/typeobj.c index 9102b80d1..87128648d 100644 --- a/Source/Swig/typeobj.c +++ b/Source/Swig/typeobj.c @@ -1196,7 +1196,7 @@ String *SwigType_prefix(const SwigType *t) { if (*d == '>') { int nest = 1; d--; - while ((d > c) && (nest)) { + while ((d > c) && nest) { if (*d == '>') nest++; if (*d == '<') @@ -1208,7 +1208,7 @@ String *SwigType_prefix(const SwigType *t) { /* Skip over params */ int nparen = 1; d--; - while ((d > c) && (nparen)) { + while ((d > c) && nparen) { if (*d == ')') nparen++; if (*d == '(') diff --git a/appveyor.yml b/appveyor.yml index 87c22376d..eaf90a905 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,6 +39,7 @@ environment: VER: 310 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - SWIGLANG: python + PY2: 2 OSVARIANT: cygwin APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - SWIGLANG: java @@ -140,8 +141,8 @@ install: - if "%OSVARIANT%"=="mingw" bash -c "pacman --noconfirm --sync mingw%MBITS%/mingw-w64-%MARCH%-autotools mingw%MBITS%/mingw-w64-%MARCH%-pcre2 mingw%MBITS%/mingw-w64-%MARCH%-boost mingw%MBITS%/mingw-w64-%MARCH%-python" - if not "%WITHLANG%"=="" set SWIGWITHLANG==%WITHLANG% - if not "%WITHLANG%"=="" where %WITHLANG% - if "%SWIGLANG%"=="python" set PY3=3 - if "%PY2%"="2" set PY3= +- if "%SWIGLANG%"=="python" set PY3=3 +- if "%PY2%"="2" set PY3= - bash -c "which $CC" - bash -c "which $CXX" - bash -c "$CC --version | head -n 1" |