Fix memmove regression
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11688 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2726424a7f
commit
a2229a45fc
5 changed files with 19 additions and 4 deletions
|
|
@ -1,6 +1,9 @@
|
|||
Version 1.3.41 (in progress)
|
||||
============================
|
||||
|
||||
2009-09-11: wsfulton
|
||||
Fix memmove regression in cdata.i as reported by Adriaan Renting.
|
||||
|
||||
2009-09-07: wsfulton
|
||||
Fix constant expressions containing <= or >=.
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
%cdata(int);
|
||||
%cdata(double);
|
||||
|
||||
|
||||
void *malloc(size_t size);
|
||||
|
|
|
|||
10
Examples/test-suite/python/li_cdata_runme.py
Normal file
10
Examples/test-suite/python/li_cdata_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
from li_cdata import *
|
||||
|
||||
s = "ABC abc"
|
||||
m = malloc(256)
|
||||
memmove(m, s)
|
||||
ss = cdata(m, 7)
|
||||
if ss != "ABC abc":
|
||||
raise "failed"
|
||||
|
||||
|
|
@ -79,5 +79,6 @@ SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements);
|
|||
|
||||
%cdata(void);
|
||||
|
||||
/* Memory move function */
|
||||
/* Memory move function. Due to multi-argument typemaps this appears to be wrapped as
|
||||
void memmove(void *data, const char *s); */
|
||||
void memmove(void *data, const void *indata, int inlen);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ typedef struct SWIGCDATA {
|
|||
%typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize") SWIGCDATA {
|
||||
%set_output(SWIG_FromCharPtrAndSize($1.data,$1.len));
|
||||
}
|
||||
%typemap(in) (const void *indata, int inlen) = (char *STRING, int SIZE);
|
||||
%typemap(in) (const void *indata, size_t inlen) = (char *STRING, size_t SIZE);
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -70,7 +70,8 @@ SWIGCDATA cdata_##NAME(TYPE *ptr, size_t nelements = 1);
|
|||
|
||||
%cdata(void);
|
||||
|
||||
/* Memory move function */
|
||||
/* Memory move function. Due to multi-argument typemaps this appears to be wrapped as
|
||||
void memmove(void *data, const char *s); */
|
||||
void memmove(void *data, const void *indata, size_t inlen);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue