Remove trailing spaces in the generated code

This commit is contained in:
Sylvestre Ledru 2013-09-13 09:36:26 +02:00
commit 2374ff914d
6 changed files with 84 additions and 84 deletions

View file

@ -1,16 +1,16 @@
/* Errors in SWIG */ /* Errors in SWIG */
#define SWIG_UnknownError -1 #define SWIG_UnknownError -1
#define SWIG_IOError -2 #define SWIG_IOError -2
#define SWIG_RuntimeError -3 #define SWIG_RuntimeError -3
#define SWIG_IndexError -4 #define SWIG_IndexError -4
#define SWIG_TypeError -5 #define SWIG_TypeError -5
#define SWIG_DivisionByZero -6 #define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7 #define SWIG_OverflowError -7
#define SWIG_SyntaxError -8 #define SWIG_SyntaxError -8
#define SWIG_ValueError -9 #define SWIG_ValueError -9
#define SWIG_SystemError -10 #define SWIG_SystemError -10
#define SWIG_AttributeError -11 #define SWIG_AttributeError -11
#define SWIG_MemoryError -12 #define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13 #define SWIG_NullReferenceError -13

View file

@ -1,17 +1,17 @@
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Type initialization: * Type initialization:
* This problem is tough by the requirement that no dynamic * This problem is tough by the requirement that no dynamic
* memory is used. Also, since swig_type_info structures store pointers to * memory is used. Also, since swig_type_info structures store pointers to
* swig_cast_info structures and swig_cast_info structures store pointers back * swig_cast_info structures and swig_cast_info structures store pointers back
* to swig_type_info structures, we need some lookup code at initialization. * to swig_type_info structures, we need some lookup code at initialization.
* The idea is that swig generates all the structures that are needed. * The idea is that swig generates all the structures that are needed.
* The runtime then collects these partially filled structures. * The runtime then collects these partially filled structures.
* The SWIG_InitializeModule function takes these initial arrays out of * The SWIG_InitializeModule function takes these initial arrays out of
* swig_module, and does all the lookup, filling in the swig_module.types * swig_module, and does all the lookup, filling in the swig_module.types
* array with the correct data and linking the correct swig_cast_info * array with the correct data and linking the correct swig_cast_info
* structures together. * structures together.
* *
* The generated swig_type_info structures are assigned staticly to an initial * The generated swig_type_info structures are assigned staticly to an initial
* array. We just loop through that array, and handle each type individually. * array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the * First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the * loaded structure instead of the generated one. Then we have to fill in the
@ -21,17 +21,17 @@
* a column is one of the swig_cast_info structures for that type. * a column is one of the swig_cast_info structures for that type.
* The cast_initial array is actually an array of arrays, because each row has * The cast_initial array is actually an array of arrays, because each row has
* a variable number of columns. So to actually build the cast linked list, * a variable number of columns. So to actually build the cast linked list,
* we find the array of casts associated with the type, and loop through it * we find the array of casts associated with the type, and loop through it
* adding the casts to the list. The one last trick we need to do is making * adding the casts to the list. The one last trick we need to do is making
* sure the type pointer in the swig_cast_info struct is correct. * sure the type pointer in the swig_cast_info struct is correct.
* *
* First off, we lookup the cast->type name to see if it is already loaded. * First off, we lookup the cast->type name to see if it is already loaded.
* There are three cases to handle: * There are three cases to handle:
* 1) If the cast->type has already been loaded AND the type we are adding * 1) If the cast->type has already been loaded AND the type we are adding
* casting info to has not been loaded (it is in this module), THEN we * casting info to has not been loaded (it is in this module), THEN we
* replace the cast->type pointer with the type pointer that has already * replace the cast->type pointer with the type pointer that has already
* been loaded. * been loaded.
* 2) If BOTH types (the one we are adding casting info to, and the * 2) If BOTH types (the one we are adding casting info to, and the
* cast->type) are loaded, THEN the cast info has already been loaded by * cast->type) are loaded, THEN the cast info has already been loaded by
* the previous module so we just ignore it. * the previous module so we just ignore it.
* 3) Finally, if cast->type has not already been loaded, then we add that * 3) Finally, if cast->type has not already been loaded, then we add that
@ -108,7 +108,7 @@ SWIG_InitializeModule(void *clientdata) {
swig_type_info *type = 0; swig_type_info *type = 0;
swig_type_info *ret; swig_type_info *ret;
swig_cast_info *cast; swig_cast_info *cast;
#ifdef SWIGRUNTIME_DEBUG #ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif #endif
@ -135,7 +135,7 @@ SWIG_InitializeModule(void *clientdata) {
/* Insert casting types */ /* Insert casting types */
cast = swig_module.cast_initial[i]; cast = swig_module.cast_initial[i];
while (cast->type) { while (cast->type) {
/* Don't need to add information already in the list */ /* Don't need to add information already in the list */
ret = 0; ret = 0;
#ifdef SWIGRUNTIME_DEBUG #ifdef SWIGRUNTIME_DEBUG

View file

@ -29,28 +29,28 @@
#ifndef SWIGUNUSED #ifndef SWIGUNUSED
# if defined(__GNUC__) # if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__)) # define SWIGUNUSED __attribute__ ((__unused__))
# else # else
# define SWIGUNUSED # define SWIGUNUSED
# endif # endif
# elif defined(__ICC) # elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__)) # define SWIGUNUSED __attribute__ ((__unused__))
# else # else
# define SWIGUNUSED # define SWIGUNUSED
# endif # endif
#endif #endif
#ifndef SWIG_MSC_UNSUPPRESS_4505 #ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER) # if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif # endif
#endif #endif
#ifndef SWIGUNUSEDPARM #ifndef SWIGUNUSEDPARM
# ifdef __cplusplus # ifdef __cplusplus
# define SWIGUNUSEDPARM(p) # define SWIGUNUSEDPARM(p)
# else # else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED # define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif # endif
#endif #endif
@ -93,7 +93,7 @@
# define SWIGSTDCALL __stdcall # define SWIGSTDCALL __stdcall
# else # else
# define SWIGSTDCALL # define SWIGSTDCALL
# endif # endif
#endif #endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */

View file

@ -22,7 +22,7 @@
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code. creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'. In 99.9% of the cases, SWIG just needs to declare them as 'static'.
But only do this if strictly necessary, ie, if you have problems But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike. with your compiler or suchlike.
*/ */
@ -48,16 +48,16 @@
#define SWIG_POINTER_OWN 0x1 #define SWIG_POINTER_OWN 0x1
/* /*
Flags/methods for returning states. Flags/methods for returning states.
The SWIG conversion methods, as ConvertPtr, return an integer The SWIG conversion methods, as ConvertPtr, return an integer
that tells if the conversion was successful or not. And if not, that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes). an error code can be returned (see swigerrors.swg for the codes).
Use the following macros/flags to set or process the returning Use the following macros/flags to set or process the returning
states. states.
In old versions of SWIG, code such as the following was usually written: In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@ -90,23 +90,23 @@
} else { } else {
// fail code // fail code
} }
I.e., now SWIG_ConvertPtr can return new objects and you can I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as also requires SWIG_ConvertPtr to return new result values, such as
int SWIG_ConvertPtr(obj, ptr,...) { int SWIG_ConvertPtr(obj, ptr,...) {
if (<obj is ok>) { if (<obj is ok>) {
if (<need new object>) { if (<need new object>) {
*ptr = <ptr to new allocated object>; *ptr = <ptr to new allocated object>;
return SWIG_NEWOBJ; return SWIG_NEWOBJ;
} else { } else {
*ptr = <ptr to old object>; *ptr = <ptr to old object>;
return SWIG_OLDOBJ; return SWIG_OLDOBJ;
} }
} else { } else {
return SWIG_BADOBJ; return SWIG_BADOBJ;
} }
} }
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@ -120,17 +120,17 @@
int fooi(int); int fooi(int);
and you call and you call
food(1) // cast rank '1' (1 -> 1.0) food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0' fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState() just use the SWIG_AddCast()/SWIG_CheckState()
*/ */
#define SWIG_OK (0) #define SWIG_OK (0)
#define SWIG_ERROR (-1) #define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0) #define SWIG_IsOK(r) (r >= 0)
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */ /* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8) #define SWIG_CASTRANKLIMIT (1 << 8)
@ -161,11 +161,11 @@
# endif # endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { SWIGINTERNINLINE int SWIG_AddCast(int r) {
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
} }
SWIGINTERNINLINE int SWIG_CheckState(int r) { SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
} }
#else /* no cast-rank mode */ #else /* no cast-rank mode */
# define SWIG_AddCast(r) (r) # define SWIG_AddCast(r) (r)
@ -212,7 +212,7 @@ typedef struct swig_module_info {
void *clientdata; /* Language specific module data */ void *clientdata; /* Language specific module data */
} swig_module_info; } swig_module_info;
/* /*
Compare two type names skipping the space characters, therefore Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class<int>" == "Class<int >", etc. "char*" == "char *" and "Class<int>" == "Class<int >", etc.
@ -285,7 +285,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
return 0; return 0;
} }
/* /*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/ */
SWIGRUNTIME swig_cast_info * SWIGRUNTIME swig_cast_info *
@ -320,7 +320,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
} }
/* /*
Dynamic pointer casting. Down an inheritance hierarchy Dynamic pointer casting. Down an inheritance hierarchy
*/ */
SWIGRUNTIME swig_type_info * SWIGRUNTIME swig_type_info *
@ -364,7 +364,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
return type->name; return type->name;
} }
/* /*
Set the clientdata field for a type Set the clientdata field for a type
*/ */
SWIGRUNTIME void SWIGRUNTIME void
@ -372,14 +372,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
swig_cast_info *cast = ti->cast; swig_cast_info *cast = ti->cast;
/* if (ti->clientdata == clientdata) return; */ /* if (ti->clientdata == clientdata) return; */
ti->clientdata = clientdata; ti->clientdata = clientdata;
while (cast) { while (cast) {
if (!cast->converter) { if (!cast->converter) {
swig_type_info *tc = cast->type; swig_type_info *tc = cast->type;
if (!tc->clientdata) { if (!tc->clientdata) {
SWIG_TypeClientData(tc, clientdata); SWIG_TypeClientData(tc, clientdata);
} }
} }
cast = cast->next; cast = cast->next;
} }
} }
@ -388,18 +388,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
SWIG_TypeClientData(ti, clientdata); SWIG_TypeClientData(ti, clientdata);
ti->owndata = 1; ti->owndata = 1;
} }
/* /*
Search for a swig_type_info structure only by mangled name Search for a swig_type_info structure only by mangled name
Search is a O(log #types) Search is a O(log #types)
We start searching at module start, and finish searching when start == end. We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around Note: if start == end at the beginning of the function, we go all the way around
the circular list. the circular list.
*/ */
SWIGRUNTIME swig_type_info * SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, SWIG_MangledTypeQueryModule(swig_module_info *start,
swig_module_info *end, swig_module_info *end,
const char *name) { const char *name) {
swig_module_info *iter = start; swig_module_info *iter = start;
do { do {
@ -408,11 +408,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
register size_t r = iter->size - 1; register size_t r = iter->size - 1;
do { do {
/* since l+r >= 0, we can (>> 1) instead (/ 2) */ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
register size_t i = (l + r) >> 1; register size_t i = (l + r) >> 1;
const char *iname = iter->types[i]->name; const char *iname = iter->types[i]->name;
if (iname) { if (iname) {
register int compare = strcmp(name, iname); register int compare = strcmp(name, iname);
if (compare == 0) { if (compare == 0) {
return iter->types[i]; return iter->types[i];
} else if (compare < 0) { } else if (compare < 0) {
if (i) { if (i) {
@ -437,14 +437,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
Search for a swig_type_info structure for either a mangled name or a human readable name. Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types) It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types). If a type is not found it then searches the human readable names, which is O(#types).
We start searching at module start, and finish searching when start == end. We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around Note: if start == end at the beginning of the function, we go all the way around
the circular list. the circular list.
*/ */
SWIGRUNTIME swig_type_info * SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start, SWIG_TypeQueryModule(swig_module_info *start,
swig_module_info *end, swig_module_info *end,
const char *name) { const char *name) {
/* STEP 1: Search the name field using binary search */ /* STEP 1: Search the name field using binary search */
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@ -463,12 +463,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
iter = iter->next; iter = iter->next;
} while (iter != end); } while (iter != end);
} }
/* neither found a match */ /* neither found a match */
return 0; return 0;
} }
/* /*
Pack binary data into a string Pack binary data into a string
*/ */
SWIGRUNTIME char * SWIGRUNTIME char *
@ -484,7 +484,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
return c; return c;
} }
/* /*
Unpack binary data from a string Unpack binary data from a string
*/ */
SWIGRUNTIME const char * SWIGRUNTIME const char *
@ -498,21 +498,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
uu = ((d - '0') << 4); uu = ((d - '0') << 4);
else if ((d >= 'a') && (d <= 'f')) else if ((d >= 'a') && (d <= 'f'))
uu = ((d - ('a'-10)) << 4); uu = ((d - ('a'-10)) << 4);
else else
return (char *) 0; return (char *) 0;
d = *(c++); d = *(c++);
if ((d >= '0') && (d <= '9')) if ((d >= '0') && (d <= '9'))
uu |= (d - '0'); uu |= (d - '0');
else if ((d >= 'a') && (d <= 'f')) else if ((d >= 'a') && (d <= 'f'))
uu |= (d - ('a'-10)); uu |= (d - ('a'-10));
else else
return (char *) 0; return (char *) 0;
*u = uu; *u = uu;
} }
return c; return c;
} }
/* /*
Pack 'void *' into a string buffer. Pack 'void *' into a string buffer.
*/ */
SWIGRUNTIME char * SWIGRUNTIME char *

View file

@ -9,9 +9,9 @@
-------------------------- --------------------------
%arg(Arg) Safe argument wrap %arg(Arg) Safe argument wrap
%str(Arg) Stringtify the argument %str(Arg) Stringtify the argument
%begin_block Begin a execution block %begin_block Begin a execution block
%end_block End a execution block %end_block End a execution block
%block(Block) Execute Block as a excecution block %block(Block) Execute Block as a excecution block
%define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first %define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first
%ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi %ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi
@ -19,7 +19,7 @@
Casting Operations: Casting Operations:
------------------- -------------------
SWIG provides the following casting macros, which implement the SWIG provides the following casting macros, which implement the
corresponding C++ casting operations: corresponding C++ casting operations:

View file

@ -72,11 +72,11 @@ void Swig_banner(File *f) {
Printf(f, "/* ----------------------------------------------------------------------------\n\ Printf(f, "/* ----------------------------------------------------------------------------\n\
* This file was automatically generated by SWIG (http://www.swig.org).\n\ * This file was automatically generated by SWIG (http://www.swig.org).\n\
* Version %s\n\ * Version %s\n\
* \n\ *\n\
* This file is not intended to be easily readable and contains a number of \n\ * This file is not intended to be easily readable and contains a number of\n\
* coding conventions designed to improve portability and efficiency. Do not make\n\ * coding conventions designed to improve portability and efficiency. Do not make\n\
* changes to this file unless you know what you are doing--modify the SWIG \n\ * changes to this file unless you know what you are doing--modify the SWIG\n\
* interface file instead. \n", Swig_package_version()); * interface file instead.\n", Swig_package_version());
/* String too long for ISO compliance */ /* String too long for ISO compliance */
Printf(f, " * ----------------------------------------------------------------------------- */\n"); Printf(f, " * ----------------------------------------------------------------------------- */\n");