mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 02:11:15 +03:00
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:

committed by
Mihai Tudor Panu

parent
e003a11723
commit
387b2b86b0
@ -4,26 +4,6 @@
|
||||
%include "../carrays_uint16_t.i"
|
||||
%include "../carrays_uint32_t.i"
|
||||
|
||||
// Adding this typemap because SWIG is converting uint8, uint16, and uint32 into a short by default
|
||||
// This forces SWIG to convert it correctly
|
||||
%typemap(in) uint8_t * {
|
||||
void *argp = 0 ;
|
||||
int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint8Array, 0 | 0 );
|
||||
$1 = (uint8_t *)(argp);
|
||||
}
|
||||
|
||||
%typemap(in) uint16_t * {
|
||||
void *argp = 0 ;
|
||||
int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint16Array, 0 | 0 );
|
||||
$1 = (uint16_t *)(argp);
|
||||
}
|
||||
|
||||
%typemap(in) uint32_t * {
|
||||
void *argp = 0 ;
|
||||
int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint32Array, 0 | 0 );
|
||||
$1 = (uint32_t *)(argp);
|
||||
}
|
||||
|
||||
%{
|
||||
#include "hmtrp.h"
|
||||
speed_t int_B9600 = B9600;
|
||||
|
@ -6,26 +6,6 @@
|
||||
%include "../carrays_uint16_t.i"
|
||||
%include "../carrays_uint32_t.i"
|
||||
|
||||
// Adding this typemap because SWIG is converting uint8, uint16, and uint32 into a short by default
|
||||
// This forces SWIG to convert it correctly
|
||||
%typemap(in) uint8_t * {
|
||||
void *argp = 0 ;
|
||||
int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint8Array, 0 | 0 );
|
||||
$1 = reinterpret_cast< uint8_t * >(argp);
|
||||
}
|
||||
|
||||
%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 * {
|
||||
void *argp = 0 ;
|
||||
int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint32Array, 0 | 0 );
|
||||
$1 = reinterpret_cast< uint32_t * >(argp);
|
||||
}
|
||||
|
||||
%feature("autodoc", "3");
|
||||
|
||||
%include "hmtrp.h"
|
||||
|
Reference in New Issue
Block a user