minor member pointer fixes for last commit

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10077 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-10-30 22:21:19 +00:00
commit ed2bc825bd

View file

@ -14,13 +14,11 @@
* The imtype typemap contains the C# type used in the intermediary class. * The imtype typemap contains the C# type used in the intermediary class.
* The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */ * The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */
/* fragments */
/* Fragments */
%fragment("SWIG_PackData", "header") { %fragment("SWIG_PackData", "header") {
/* /* Pack binary data into a string */
Pack binary data into a string SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) {
*/
/*SWIGRUNTIME*/ char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
static const char hex[17] = "0123456789abcdef"; static const char hex[17] = "0123456789abcdef";
register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *u = (unsigned char *) ptr;
register const unsigned char *eu = u + sz; register const unsigned char *eu = u + sz;
@ -31,15 +29,11 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
} }
return c; return c;
} }
} }
%fragment("SWIG_UnPackData", "header") { %fragment("SWIG_UnPackData", "header") {
/* /* Unpack binary data from a string */
Unpack binary data from a string SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
*/
/*SWIGRUNTIME*/ const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
register unsigned char *u = (unsigned char *) ptr; register unsigned char *u = (unsigned char *) ptr;
register const unsigned char *eu = u + sz; register const unsigned char *eu = u + sz;
for (; u != eu; ++u) { for (; u != eu; ++u) {
@ -62,7 +56,6 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
} }
return c; return c;
} }
} }
/* Primitive types */ /* Primitive types */
@ -393,8 +386,7 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
/* Generic pointers and references */ /* Generic pointers and references */
%typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %} %typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %}
%typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ %typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{
void *voidptr = &$1; SWIG_UnpackData($input, (void *)&$1, sizeof($1));
SWIG_UnpackData($input, voidptr, sizeof($1));
%} %}
%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; %typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input;
if(!$1) { if(!$1) {