swig: ensure that all uint*_t passed in have the correct type.

Otherwise, we generate an exception.  This should fix Issue #172:

https://github.com/intel-iot-devkit/upm/issues/172

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Zion Orent
2015-10-07 09:06:23 -04:00
committed by Mihai Tudor Panu
parent e003a11723
commit 387b2b86b0
19 changed files with 102 additions and 151 deletions

View File

@ -4,17 +4,6 @@
%include "../carrays_uint32_t.i"
%include "cpointer.i"
%typemap(in) uint16_t * {
void *argp = 0 ;
int res = SWIG_ConvertPtr($input, &argp,SWIGTYPE_p_uint16Array, 0 | 0 );
$1 = (uint16_t *)(argp);
}
/*$input is a v8::object, which inherits from v8::value */
%typemap(in) uint32_t {
$1 = ($input)->Uint32Value();
}
/* Send "int *" to JavaScript as intp */
%pointer_functions(int, intp);
%{

View File

@ -8,16 +8,6 @@
%feature("autodoc", "3");
%typemap(in) uint16_t * {
void *argp = 0 ;
int res = SWIG_ConvertPtr($input, &argp,SWIGTYPE_p_uint16Array, 0 | 0 );
$1 = reinterpret_cast< uint16_t * >(argp);
}
%typemap(in) uint32_t {
$1 = PyInt_AsLong($input);
}
/* Send "int *" to python as intp */
%pointer_functions(int, intp);
%{