changed the mapped 'SIZE' of buffer interface from the length of raw buffer to number of items in the buffer. So it would be easier to use with type other than 'char'

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11125 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Haoyu Bai 2009-02-10 14:21:43 +00:00
commit 03e840f3ec
2 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,10 @@
Version 1.3.39 (in progress)
============================
2008-02-08: bhy
Change the SIZE mapped by %pybuffer_mutable_binary and %pybuffer_binary in pybuffer.i from
the length of the buffer to the number of items in the buffer.
2008-02-08: wsfulton
Fix %feature not working for conversion operators, reported by Matt Sprague, for example:
%feature("cs:methodmodifiers") operator bool "protected";

View file

@ -21,7 +21,7 @@
%argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum);
}
$1 = ($1_ltype) buf;
$2 = ($2_ltype) size;
$2 = ($2_ltype) (size/sizeof($*1_type));
}
%enddef
@ -73,7 +73,7 @@
%argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum);
}
$1 = ($1_ltype) buf;
$2 = ($2_ltype) size;
$2 = ($2_ltype) (size / sizeof($*1_type));
}
%enddef