Merge branch 'stricter-warnings'
* stricter-warnings: Go changes for wrappers to compile as ISO C90 Scilab typecheck typemaps fix for C90 No error for one Javascript node warning Warning fix in testcase for Javascript node nested_extend_c testcase fix when compiled by C++ target languages Temporarily remove -Werror for Scilab testing C90 fixes for Javascript JSC There are a couple of testcases that aren't compliant and supression via pragmas doesn't work for gcc < 4.8 Warning suppression change Scilab typemap fixes for C89 compiler warning suppression correction in testcase Suppress pedantic warnings in C# testcases Suppress pedantic warnings in testcases Pedantic warning fix in testcase pedantic warning fix for D wrappers Travis testing to use testflags.py for setting CFLAGS and CXXFLAGS Add travis build for error-declaration-after-statement branch
This commit is contained in:
commit
1ef899a57b
25 changed files with 163 additions and 119 deletions
|
|
@ -28,7 +28,7 @@ typedef enum {
|
|||
SWIG_DIllegalArgumentException,
|
||||
SWIG_DIllegalElementException,
|
||||
SWIG_DIOException,
|
||||
SWIG_DNoSuchElementException,
|
||||
SWIG_DNoSuchElementException
|
||||
} SWIG_DExceptionCodes;
|
||||
|
||||
typedef void (* SWIG_DExceptionCallback_t)(const char *);
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ static JSStaticFunction $jsnspace_functions[] = {
|
|||
};
|
||||
|
||||
static JSClassDefinition $jsnspace_classDefinition;
|
||||
static JSObjectRef $jsmangledname_object;
|
||||
%}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -412,7 +413,7 @@ static JSClassDefinition $jsnspace_classDefinition;
|
|||
%{
|
||||
$jsmangledname_classDefinition.staticFunctions = $jsmangledname_functions;
|
||||
$jsmangledname_classDefinition.staticValues = $jsmangledname_values;
|
||||
JSObjectRef $jsmangledname_object = JSObjectMake(context, JSClassCreate(&$jsmangledname_classDefinition), NULL);
|
||||
$jsmangledname_object = JSObjectMake(context, JSClassCreate(&$jsmangledname_classDefinition), NULL);
|
||||
%}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -76,11 +76,12 @@ SWIG_From_dec(unsigned long)(unsigned long value)
|
|||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(unsigned long)(JSValueRef obj, unsigned long *val)
|
||||
{
|
||||
long longVal;
|
||||
if(!JSValueIsNumber(context, obj)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
long longVal = (long) JSValueToNumber(context, obj, NULL);
|
||||
longVal = (long) JSValueToNumber(context, obj, NULL);
|
||||
|
||||
if(longVal < 0) {
|
||||
return SWIG_OverflowError;
|
||||
|
|
@ -142,11 +143,12 @@ SWIG_From_dec(unsigned long long)(unsigned long long value)
|
|||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(unsigned long long)(JSValueRef obj, unsigned long long *val)
|
||||
{
|
||||
long long longVal;
|
||||
if(!JSValueIsNumber(context, obj)) {
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
|
||||
long long longVal = (unsigned long long) JSValueToNumber(context, obj, NULL);
|
||||
longVal = (unsigned long long) JSValueToNumber(context, obj, NULL);
|
||||
|
||||
if(longVal < 0) {
|
||||
return SWIG_OverflowError;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t siz
|
|||
return JSValueMakeUndefined(context);
|
||||
} else {
|
||||
JSStringRef jsstring;
|
||||
JSValueRef result;
|
||||
if(size < 2) {
|
||||
char c[2];
|
||||
int i;
|
||||
|
|
@ -63,7 +64,7 @@ SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t siz
|
|||
} else {
|
||||
jsstring = JSStringCreateWithUTF8CString(carray);
|
||||
}
|
||||
JSValueRef result = JSValueMakeString(context, jsstring);
|
||||
result = JSValueMakeString(context, jsstring);
|
||||
JSStringRelease(jsstring);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,8 @@
|
|||
|
||||
// in (bool *IN, int IN_SIZE)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||
$2 = rowCount * colCount;
|
||||
}
|
||||
|
|
@ -39,10 +37,8 @@
|
|||
|
||||
// in (int IN_SIZE, bool *IN)
|
||||
|
||||
%typemap(in, noblock=1) (int IN_SIZE, bool *IN)
|
||||
%typemap(in, noblock=1) (int IN_SIZE, bool *IN) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||
$1 = rowCount * colCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,17 +18,15 @@
|
|||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN)
|
||||
{
|
||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK {
|
||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
// in (char **IN, int IN_SIZE)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||
$2 = rowCount * colCount;
|
||||
}
|
||||
|
|
@ -39,10 +37,8 @@
|
|||
|
||||
// in (int IN_SIZE, char **IN)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||
$1 = rowCount * colCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,8 @@
|
|||
|
||||
// in (double *IN, int IN_SIZE)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||
$2 = rowCount * colCount;
|
||||
}
|
||||
|
|
@ -39,10 +37,8 @@
|
|||
|
||||
// in (int IN_SIZE, double *IN)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||
$1 = rowCount * colCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,8 @@
|
|||
|
||||
// in (int *IN, int IN_SIZE)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||
$2 = rowCount * colCount;
|
||||
}
|
||||
|
|
@ -42,10 +40,8 @@
|
|||
|
||||
// in (int IN_SIZE, int *IN)
|
||||
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN)
|
||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount)
|
||||
{
|
||||
int rowCount;
|
||||
int colCount;
|
||||
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||
$1 = rowCount * colCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ SWIG_Scilab_Error(int code, const char *msg)
|
|||
|
||||
#define SWIG_fail return SWIG_ERROR;
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIGRUNTIME void
|
||||
SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) {
|
||||
if (type) {
|
||||
if (obj)
|
||||
|
|
@ -259,7 +259,7 @@ SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descript
|
|||
}
|
||||
}
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIGRUNTIME void
|
||||
SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) {
|
||||
Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occured.\n", type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@
|
|||
/* Typecheck typemaps */
|
||||
/* ---------------------------------------------------------------------------*/
|
||||
|
||||
%define SCILAB_TYPECHECK(TYPE_CHECK_FUNCTION)
|
||||
%define %scilab_typecheck_generic(PRECEDENCE, TYPE_CHECK_FUNCTION, TYPE)
|
||||
%typecheck(PRECEDENCE) TYPE {
|
||||
int *piAddrVar = NULL;
|
||||
SciErr sciErr = getVarAddressFromPosition(pvApiCtx, $input, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
|
|
@ -118,11 +119,19 @@
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
$1 = TYPE_CHECK_FUNCTION(pvApiCtx, piAddrVar);
|
||||
}
|
||||
%enddef
|
||||
|
||||
/* Scilab equivalent for C integers can be sci_ints or sci_matrix */
|
||||
%define SCILAB_INTEGERTYPECHECK(INTTYPE)
|
||||
SCILAB_TYPECHECK(isIntegerType)
|
||||
%define %scilab_typecheck_integer(PRECEDENCE, INTTYPE, TYPE)
|
||||
%typecheck(PRECEDENCE) TYPE {
|
||||
int *piAddrVar = NULL;
|
||||
SciErr sciErr = getVarAddressFromPosition(pvApiCtx, $input, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
$1 = isIntegerType(pvApiCtx, piAddrVar);
|
||||
if ($1 == 1) {
|
||||
int iPrec = 0;
|
||||
sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrec);
|
||||
|
|
@ -135,39 +144,43 @@
|
|||
else {
|
||||
$1 = isDoubleType(pvApiCtx, piAddrVar);
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
||||
// Double (and Float) have priority over before Integer type.
|
||||
|
||||
// Primitive types
|
||||
%typecheck(SWIG_TYPECHECK_VOIDPTR, noblock=1) SWIGTYPE * { SCILAB_TYPECHECK(isPointerType) }
|
||||
%typecheck(SWIG_TYPECHECK_POINTER, noblock=1) SWIGTYPE * { SCILAB_TYPECHECK(isPointerType) }
|
||||
%typecheck(SWIG_TYPECHECK_BOOL, noblock=1) bool { SCILAB_TYPECHECK(isBooleanType) }
|
||||
%typemap(typecheck, precedence=16, noblock=1) double { SCILAB_TYPECHECK(isDoubleType) }
|
||||
%typemap(typecheck, precedence=17, noblock=1) float { SCILAB_TYPECHECK(isDoubleType) }
|
||||
%typecheck(SWIG_TYPECHECK_INT8, noblock=1) signed char { SCILAB_INTEGERTYPECHECK(SCI_INT8) }
|
||||
%typecheck(SWIG_TYPECHECK_UINT8, noblock=1) unsigned char { SCILAB_INTEGERTYPECHECK(SCI_UINT8) }
|
||||
%typecheck(SWIG_TYPECHECK_INT16, noblock=1) short { SCILAB_INTEGERTYPECHECK(SCI_INT16) }
|
||||
%typecheck(SWIG_TYPECHECK_UINT16, noblock=1) unsigned short { SCILAB_INTEGERTYPECHECK(SCI_UINT16) }
|
||||
%typecheck(SWIG_TYPECHECK_INT32, noblock=1) int, long { SCILAB_INTEGERTYPECHECK(SCI_INT32) }
|
||||
%typecheck(SWIG_TYPECHECK_UINT32, noblock=1) unsigned int, unsigned long { SCILAB_INTEGERTYPECHECK(SCI_UINT32) }
|
||||
%typecheck(SWIG_TYPECHECK_INT32, noblock=1) enum SWIGTYPE { SCILAB_INTEGERTYPECHECK(SCI_INT32) }
|
||||
%typecheck(SWIG_TYPECHECK_CHAR, noblock=1) char { SCILAB_TYPECHECK(isStringType) }
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_VOIDPTR, isPointerType, SWIGTYPE *)
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_POINTER, isPointerType, SWIGTYPE *)
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL, isBooleanType, bool)
|
||||
%scilab_typecheck_generic(16, isDoubleType, double)
|
||||
%scilab_typecheck_generic(17, isDoubleType, float)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT8, SCI_INT8, signed char)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_UINT8, SCI_UINT8, unsigned char)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT16, SCI_INT16, short)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_UINT16, SCI_UINT16, unsigned short)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, int)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, long)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned int)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_UINT32, SCI_UINT32, unsigned long)
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT32, SCI_INT32, enum SWIGTYPE)
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR, isStringType, char)
|
||||
|
||||
// Arrays
|
||||
%typecheck(SWIG_TYPECHECK_BOOL_ARRAY, noblock=1) bool { SCILAB_TYPECHECK(isBooleanType) }
|
||||
%typemap(typecheck, precedence=1016, noblock=1) double [ANY] { SCILAB_TYPECHECK(isDoubleType) }
|
||||
%typemap(typecheck, precedence=1017, noblock=1) float [ANY] { SCILAB_TYPECHECK(isDoubleType) }
|
||||
%typecheck(SWIG_TYPECHECK_INT8_ARRAY, noblock=1) signed char [ANY] { SCILAB_INTEGERTYPECHECK(SCI_INT8) }
|
||||
%typemap(typecheck, precedence=1026, noblock=1) unsigned char [ANY] { SCILAB_INTEGERTYPECHECK(SCI_UINT8) }
|
||||
%typecheck(SWIG_TYPECHECK_INT16_ARRAY, noblock=1) short [ANY] { SCILAB_INTEGERTYPECHECK(SCI_INT16) }
|
||||
%typemap(typecheck, precedence=1036, noblock=1) unsigned short [ANY] { SCILAB_INTEGERTYPECHECK(SCI_UINT16) }
|
||||
%typecheck(SWIG_TYPECHECK_INT32_ARRAY, noblock=1) int [ANY], long [ANY] { SCILAB_INTEGERTYPECHECK(SCI_INT32) }
|
||||
%typemap(typecheck, precedence=1046, noblock=1) unsigned int [ANY] { SCILAB_INTEGERTYPECHECK(SCI_UINT32) }
|
||||
%typemap(typecheck, precedence=1046, noblock=1) unsigned long [ANY] { SCILAB_INTEGERTYPECHECK(SCI_UINT32) }
|
||||
%typecheck(SWIG_TYPECHECK_CHAR_ARRAY, noblock=1) char [ANY] { SCILAB_TYPECHECK(isStringType) }
|
||||
%typecheck(SWIG_TYPECHECK_STRING_ARRAY, noblock=1) char *[ANY], char ** { SCILAB_TYPECHECK(isStringType) }
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_BOOL_ARRAY, isBooleanType, bool)
|
||||
%scilab_typecheck_generic(1016, isDoubleType, double [ANY])
|
||||
%scilab_typecheck_generic(1017, isDoubleType, float [ANY])
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT8_ARRAY, SCI_INT8, signed char [ANY])
|
||||
%scilab_typecheck_integer(1026, SCI_UINT8, unsigned char [ANY])
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT16_ARRAY, SCI_INT16, short [ANY])
|
||||
%scilab_typecheck_integer(1036, SCI_UINT16, unsigned short [ANY])
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, int [ANY])
|
||||
%scilab_typecheck_integer(SWIG_TYPECHECK_INT32_ARRAY, SCI_INT32, long [ANY])
|
||||
%scilab_typecheck_integer(1046, SCI_UINT32, unsigned int [ANY])
|
||||
%scilab_typecheck_integer(1046, SCI_UINT32, unsigned long [ANY])
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_CHAR_ARRAY, isStringType, char [ANY])
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char *[ANY])
|
||||
%scilab_typecheck_generic(SWIG_TYPECHECK_STRING_ARRAY, isStringType, char **)
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
// INPUT typemaps
|
||||
%define %scilab_input_typemap(Type)
|
||||
%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp), Type &INPUT(Type temp) {
|
||||
int ecode$argnum = SWIG_AsVal_dec(Type)($input, &temp);
|
||||
if (!SWIG_IsOK(ecode$argnum)) {
|
||||
%argument_fail(ecode$argnum, "$type", $symname, $argnum);
|
||||
%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp)(int ecode), Type &INPUT(Type temp)(int ecode) {
|
||||
ecode = SWIG_AsVal_dec(Type)($input, &temp);
|
||||
if (!SWIG_IsOK(ecode)) {
|
||||
%argument_fail(ecode, "$type", $symname, $argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@
|
|||
|
||||
/* varout */
|
||||
|
||||
%typemap(varout,noblock=1,fragment=#SWIG_CharBufLen)
|
||||
%typemap(varout,fragment=#SWIG_CharBufLen)
|
||||
Char [ANY], const Char [ANY] {
|
||||
%#ifndef SWIG_PRESERVE_CARRAY_SIZE
|
||||
size_t size = SWIG_CharBufLen($1, $1_dim0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue