Patch from Chris Shoemaker to clean up some warnings in the guile module

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9492 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2006-10-30 04:44:46 +00:00
commit abcc3b8b5e
4 changed files with 57 additions and 47 deletions

View file

@ -1,6 +1,9 @@
Version 1.3.30 (in progress) Version 1.3.30 (in progress)
============================ ============================
10/29/2006: wuzzeb (John Lenz)
[Guile] Patch from Chris Shoemaker to clean up some warnings in the generated code.
10/29/2006: wsfulton 10/29/2006: wsfulton
[Java] Important fix to prevent early garbage collection of the Java proxy class [Java] Important fix to prevent early garbage collection of the Java proxy class
while it is being used in a native method. The finalizer could destroy the underlying while it is being used in a native method. The finalizer could destroy the underlying

View file

@ -52,7 +52,7 @@ typedef SCM (*swig_guile_proc)();
#endif #endif
/* This function replaces gh_scm2char, which is broken in Guile 1.4 */ /* This function replaces gh_scm2char, which is broken in Guile 1.4 */
static char SWIGINTERN char
GSWIG_scm2char (SCM s) GSWIG_scm2char (SCM s)
{ {
if (SCM_CHARP(s)) return SCM_CHAR(s); if (SCM_CHARP(s)) return SCM_CHAR(s);
@ -69,7 +69,7 @@ GSWIG_scm2char (SCM s)
# define SCM_OUTPUT_PORT_P SCM_OUTPORTP # define SCM_OUTPUT_PORT_P SCM_OUTPORTP
#endif #endif
static long SWIGINTERN long
SWIG_convert_integer(SCM o, SWIG_convert_integer(SCM o,
long lower_bound, long upper_bound, long lower_bound, long upper_bound,
const char *func_name, int argnum) const char *func_name, int argnum)
@ -80,7 +80,7 @@ SWIG_convert_integer(SCM o,
return value; return value;
} }
static unsigned long SWIGINTERN unsigned long
SWIG_convert_unsigned_integer(SCM o, SWIG_convert_unsigned_integer(SCM o,
unsigned long lower_bound, unsigned long lower_bound,
unsigned long upper_bound, unsigned long upper_bound,
@ -92,7 +92,9 @@ SWIG_convert_unsigned_integer(SCM o,
return value; return value;
} }
static swig_type_info *SWIG_Guile_LookupType(swig_module_info *module, SCM s, int normal) { SWIGINTERN swig_type_info *
SWIG_Guile_LookupType(swig_module_info *module, SCM s, int normal)
{
swig_module_info *iter; swig_module_info *iter;
if (!module) return 0; if (!module) return 0;
iter = module; iter = module;
@ -114,19 +116,20 @@ static swig_type_info *SWIG_Guile_LookupType(swig_module_info *module, SCM s, in
#ifdef SWIG_GUILE_MODULE_STATIC #ifdef SWIG_GUILE_MODULE_STATIC
static swig_module_info *swig_guile_module = 0; static swig_module_info *swig_guile_module = 0;
SWIG_GUILE_MODULE_STATIC swig_module_info *SWIG_Guile_GetModule() { SWIG_GUILE_MODULE_STATIC swig_module_info *SWIG_Guile_GetModule(void) {
return swig_guile_module; return swig_guile_module;
} }
SWIG_GUILE_MODULE_STATIC void SWIG_Guile_SetModule(swig_module_info *pointer) { SWIG_GUILE_MODULE_STATIC void SWIG_Guile_SetModule(swig_module_info *pointer) {
swig_guile_module = pointer; swig_guile_module = pointer;
} }
#else #else
SWIGEXPORT swig_module_info * SWIG_Guile_GetModule(); SWIGEXPORT swig_module_info * SWIG_Guile_GetModule(void);
SWIGEXPORT void SWIG_Guile_SetModule(swig_module_info *pointer); SWIGEXPORT void SWIG_Guile_SetModule(swig_module_info *pointer);
#endif #endif
static SCM SWIGINTERN SCM
SWIG_Guile_NewPointerObj(swig_module_info *module, void *ptr, swig_type_info *type, int owner) SWIG_Guile_NewPointerObj(swig_module_info *module, void *ptr,
swig_type_info *type, int owner)
{ {
unsigned long tag; unsigned long tag;
if (ptr==NULL) return SCM_EOL; if (ptr==NULL) return SCM_EOL;
@ -143,8 +146,9 @@ SWIG_Guile_NewPointerObj(swig_module_info *module, void *ptr, swig_type_info *ty
} }
/* Return 0 if successful. */ /* Return 0 if successful. */
static int SWIGINTERN int
SWIG_Guile_ConvertPtr(swig_module_info *module, SCM s, void **result, swig_type_info *type, int flags) SWIG_Guile_ConvertPtr(swig_module_info *module, SCM s, void **result,
swig_type_info *type, int flags)
{ {
swig_cast_info *cast; swig_cast_info *cast;
swig_type_info *from; swig_type_info *from;
@ -170,7 +174,7 @@ SWIG_Guile_ConvertPtr(swig_module_info *module, SCM s, void **result, swig_type_
return SWIG_ERROR; return SWIG_ERROR;
} }
static void * SWIGINTERN void *
SWIG_Guile_MustGetPtr (swig_module_info *module, SCM s, swig_type_info *type, SWIG_Guile_MustGetPtr (swig_module_info *module, SCM s, swig_type_info *type,
int argnum, int flags, const char *func_name) int argnum, int flags, const char *func_name)
{ {
@ -185,7 +189,7 @@ SWIG_Guile_MustGetPtr (swig_module_info *module, SCM s, swig_type_info *type,
/* Init */ /* Init */
static int SWIGINTERN int
print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{ {
swig_type_info *type = SWIG_Guile_LookupType(0, swig_smob, 1); swig_type_info *type = SWIG_Guile_LookupType(0, swig_smob, 1);
@ -205,7 +209,7 @@ print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
} }
} }
static SCM SWIGINTERN SCM
equalp_swig (SCM A, SCM B) equalp_swig (SCM A, SCM B)
{ {
if (SCM_CAR(A) == SCM_CAR(B) if (SCM_CAR(A) == SCM_CAR(B)
@ -214,14 +218,14 @@ equalp_swig (SCM A, SCM B)
else return SCM_BOOL_F; else return SCM_BOOL_F;
} }
static void SWIGINTERN void
SWIG_Guile_Init (swig_module_info *module) SWIG_Guile_Init (swig_module_info *module)
{ {
*((int *)module->clientdata) = *((int *)module->clientdata) =
scm_make_smob_type_mfpe((char *) "swig", 0, NULL, NULL, print_swig, equalp_swig); scm_make_smob_type_mfpe((char *) "swig", 0, NULL, NULL, print_swig, equalp_swig);
} }
static int SWIGINTERN int
SWIG_Guile_GetArgs (SCM *dest, SCM rest, SWIG_Guile_GetArgs (SCM *dest, SCM rest,
int reqargs, int optargs, int reqargs, int optargs,
const char *procname) const char *procname)

View file

@ -49,15 +49,17 @@ typedef struct swig_guile_clientdata {
SCM_EOL, SCM_BOOL_F); else SCM_EOL, SCM_BOOL_F); else
/* for C++ member pointers, ie, member methods */ /* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME) #define SWIG_ConvertMember(obj, ptr, sz, ty) \
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME) SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME)
#define SWIG_NewMemberObj(ptr, sz, type) \
SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME)
/* Runtime API */ /* Runtime API */
static swig_module_info *SWIG_Guile_GetModule(); static swig_module_info *SWIG_Guile_GetModule(void);
#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule() #define SWIG_GetModule(clientdata) SWIG_Guile_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) #define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer)
static char * SWIGINTERN char *
SWIG_Guile_scm2newstr(SCM str, size_t *len) { SWIG_Guile_scm2newstr(SCM str, size_t *len) {
#define FUNC_NAME "SWIG_Guile_scm2newstr" #define FUNC_NAME "SWIG_Guile_scm2newstr"
char *ret; char *ret;
@ -89,7 +91,7 @@ static SCM swig_symbol = SCM_EOL;
( SCM_NNULLP(x) && SCM_INSTANCEP(x) && SCM_NFALSEP(scm_slot_exists_p(x, swig_symbol)) \ ( SCM_NNULLP(x) && SCM_INSTANCEP(x) && SCM_NFALSEP(scm_slot_exists_p(x, swig_symbol)) \
? scm_slot_ref(x, swig_symbol) : (x) ) ? scm_slot_ref(x, swig_symbol) : (x) )
static SCM SWIGINTERN SCM
SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
{ {
if (ptr == NULL) if (ptr == NULL)
@ -118,7 +120,7 @@ SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
} }
} }
static unsigned long SWIGINTERN unsigned long
SWIG_Guile_PointerAddress(SCM object) SWIG_Guile_PointerAddress(SCM object)
{ {
SCM smob = SWIG_Guile_GetSmob(object); SCM smob = SWIG_Guile_GetSmob(object);
@ -131,7 +133,7 @@ SWIG_Guile_PointerAddress(SCM object)
else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object); else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object);
} }
static swig_type_info * SWIGINTERN swig_type_info *
SWIG_Guile_PointerType(SCM object) SWIG_Guile_PointerType(SCM object)
{ {
SCM smob = SWIG_Guile_GetSmob(object); SCM smob = SWIG_Guile_GetSmob(object);
@ -144,7 +146,7 @@ SWIG_Guile_PointerType(SCM object)
else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object); else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object);
} }
static int SWIGINTERN int
SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
{ {
swig_cast_info *cast; swig_cast_info *cast;
@ -174,7 +176,7 @@ SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
return SWIG_ERROR; return SWIG_ERROR;
} }
static SWIGINLINE void * SWIGINTERNINLINE void *
SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type,
int argnum, int flags, const char *func_name) int argnum, int flags, const char *func_name)
{ {
@ -187,7 +189,7 @@ SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type,
return result; return result;
} }
static SWIGINLINE int SWIGINTERNINLINE int
SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type) SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type)
{ {
void *result; void *result;
@ -198,7 +200,7 @@ SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type)
else return 1; else return 1;
} }
static SWIGINLINE int SWIGINTERNINLINE int
SWIG_Guile_IsPointer (SCM s) SWIG_Guile_IsPointer (SCM s)
{ {
/* module might not be initialized yet, so initialize it */ /* module might not be initialized yet, so initialize it */
@ -207,7 +209,7 @@ SWIG_Guile_IsPointer (SCM s)
} }
/* Mark a pointer object non-collectable */ /* Mark a pointer object non-collectable */
static void SWIGINTERN void
SWIG_Guile_MarkPointerNoncollectable(SCM s) SWIG_Guile_MarkPointerNoncollectable(SCM s)
{ {
SCM smob = SWIG_Guile_GetSmob(s); SCM smob = SWIG_Guile_GetSmob(s);
@ -220,7 +222,7 @@ SWIG_Guile_MarkPointerNoncollectable(SCM s)
} }
/* Mark a pointer object destroyed */ /* Mark a pointer object destroyed */
static void SWIGINTERN void
SWIG_Guile_MarkPointerDestroyed(SCM s) SWIG_Guile_MarkPointerDestroyed(SCM s)
{ {
SCM smob = SWIG_Guile_GetSmob(s); SCM smob = SWIG_Guile_GetSmob(s);
@ -234,7 +236,7 @@ SWIG_Guile_MarkPointerDestroyed(SCM s)
/* Member functions */ /* Member functions */
static SCM SWIGINTERN SCM
SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type, SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type,
const char *func_name) const char *func_name)
{ {
@ -245,7 +247,7 @@ SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type,
return smob; return smob;
} }
static int SWIGINTERN int
SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type, SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type,
const char *func_name) const char *func_name)
{ {
@ -268,8 +270,9 @@ SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type,
/* Init */ /* Init */
static int SWIGINTERN int
print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, const char *attribute) print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate,
const char *attribute)
{ {
swig_type_info *type; swig_type_info *type;
@ -290,25 +293,25 @@ print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, const char *at
} }
static int SWIGINTERN int
print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{ {
return print_swig_aux(swig_smob, port, pstate, ""); return print_swig_aux(swig_smob, port, pstate, "");
} }
static int SWIGINTERN int
print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate) print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{ {
return print_swig_aux(swig_smob, port, pstate, "collectable-"); return print_swig_aux(swig_smob, port, pstate, "collectable-");
} }
static int SWIGINTERN int
print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate) print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{ {
return print_swig_aux(swig_smob, port, pstate, "destroyed-"); return print_swig_aux(swig_smob, port, pstate, "destroyed-");
} }
static int SWIGINTERN int
print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{ {
swig_type_info *type; swig_type_info *type;
@ -325,7 +328,7 @@ print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
} }
} }
static SCM SWIGINTERN SCM
equalp_swig (SCM A, SCM B) equalp_swig (SCM A, SCM B)
{ {
if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B)
@ -334,7 +337,7 @@ equalp_swig (SCM A, SCM B)
else return SCM_BOOL_F; else return SCM_BOOL_F;
} }
static size_t SWIGINTERN size_t
free_swig(SCM A) free_swig(SCM A)
{ {
swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A); swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A);
@ -345,14 +348,14 @@ free_swig(SCM A)
return 0; return 0;
} }
static size_t SWIGINTERN size_t
free_swig_member_function(SCM A) free_swig_member_function(SCM A)
{ {
free((swig_type_info *) SCM_CELL_WORD_1(A)); free((swig_type_info *) SCM_CELL_WORD_1(A));
return 0; return 0;
} }
static int SWIGINTERN int
ensure_smob_tag(SCM swig_module, ensure_smob_tag(SCM swig_module,
scm_t_bits *tag_variable, scm_t_bits *tag_variable,
const char *smob_name, const char *smob_name,
@ -374,7 +377,7 @@ ensure_smob_tag(SCM swig_module,
} }
} }
static SCM SWIGINTERN SCM
SWIG_Guile_Init () SWIG_Guile_Init ()
{ {
static SCM swig_module; static SCM swig_module;
@ -415,8 +418,8 @@ SWIG_Guile_Init ()
return swig_module; return swig_module;
} }
static swig_module_info * SWIGINTERN swig_module_info *
SWIG_Guile_GetModule() SWIG_Guile_GetModule(void)
{ {
SCM module; SCM module;
SCM variable; SCM variable;
@ -433,7 +436,7 @@ SWIG_Guile_GetModule()
} }
} }
static void SWIGINTERN void
SWIG_Guile_SetModule(swig_module_info *swig_module) SWIG_Guile_SetModule(swig_module_info *swig_module)
{ {
SCM module; SCM module;
@ -448,7 +451,7 @@ SWIG_Guile_SetModule(swig_module_info *swig_module)
SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_module)); SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_module));
} }
static int SWIGINTERN int
SWIG_Guile_GetArgs (SCM *dest, SCM rest, SWIG_Guile_GetArgs (SCM *dest, SCM rest,
int reqargs, int optargs, int reqargs, int optargs,
const char *procname) const char *procname)

View file

@ -485,7 +485,7 @@ public:
if (goops) if (goops)
Printv(mod,"-",primsuffix,NIL); Printv(mod,"-",primsuffix,NIL);
Replaceall(mod,"/", " "); Replaceall(mod,"/", " ");
Printf(f_init, " SCM module = scm_c_define_module(\"%s\",\n", mod); Printf(f_init, " scm_c_define_module(\"%s\",\n", mod);
Printf(f_init, " SWIG_init_helper, NULL);\n"); Printf(f_init, " SWIG_init_helper, NULL);\n");
Printf(f_init, " return SCM_UNSPECIFIED;\n"); Printf(f_init, " return SCM_UNSPECIFIED;\n");
Delete(mod); Delete(mod);
@ -733,7 +733,7 @@ public:
/* Declare return variable */ /* Declare return variable */
Wrapper_add_local (f,"gswig_result", "SCM gswig_result"); Wrapper_add_local (f,"gswig_result", "SCM gswig_result");
Wrapper_add_local (f,"gswig_list_p", "int gswig_list_p = 0"); Wrapper_add_local (f,"gswig_list_p", "SWIGUNUSED int gswig_list_p = 0");
/* Get the output typemap so we can start generating documentation. Don't /* Get the output typemap so we can start generating documentation. Don't
worry, the returned string is saved as 'tmap:out' */ worry, the returned string is saved as 'tmap:out' */