Various warning fixes for .NET 2003 cl /W4 to work barring one warning and for gcc -ansi -Wall -pedantic to be warning free:

const fixes and function prototype declarations matching the definition etc


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-01-15 22:46:07 +00:00
commit b0df32dd1a
24 changed files with 77 additions and 63 deletions

View file

@ -96,7 +96,7 @@ Swig_wrapped_var_type(SwigType *t) {
return ty;
}
String *
static String *
Swig_wrapped_var_deref(SwigType *t, String_or_char *name) {
if (SwigType_isclass(t)) {
return NewStringf("*%s",name);
@ -105,8 +105,8 @@ Swig_wrapped_var_deref(SwigType *t, String_or_char *name) {
}
}
String *
Swig_wrapped_var_assign(SwigType *t, String_or_char *name) {
static String *
Swig_wrapped_var_assign(SwigType *t, const String_or_char *name) {
if (SwigType_isclass(t)) {
return NewStringf("&%s",name);
} else {
@ -463,7 +463,7 @@ Swig_cmemberset_call(String_or_char *name, SwigType *type, String_or_char *self)
* ----------------------------------------------------------------------------- */
String *
Swig_cmemberget_call(String_or_char *name, SwigType *t, String_or_char *self) {
Swig_cmemberget_call(const String_or_char *name, SwigType *t, String_or_char *self) {
String *func;
if (!self) self = NewString("(this)->");
else self = NewString(self);

View file

@ -49,8 +49,10 @@ Swig_banner(File *f) {
* 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\
* changes to this file unless you know what you are doing--modify the SWIG \n\
* interface file instead. \n\
* ----------------------------------------------------------------------------- */\n\n", PACKAGE_VERSION);
* interface file instead. \n", PACKAGE_VERSION);
/* String too long for ISO compliance */
Printf(f,
" * ----------------------------------------------------------------------------- */\n\n");
}

View file

@ -625,7 +625,7 @@ Swig_features_get(Hash *features, String *prefix, String *name, SwigType *decl,
* ----------------------------------------------------------------------------- */
void
Swig_feature_set(Hash *features, String *name, SwigType *decl, String *featurename, DOH *value) {
Swig_feature_set(Hash *features, const String_or_char *name, SwigType *decl, const String_or_char *featurename, String *value) {
Hash *n;
Hash *fhash;
/* Printf(stdout,"feature: %s %s %s %s\n", name, decl, featurename, value);*/

View file

@ -26,7 +26,7 @@ char cvsroot_parms_c[] = "$Header$";
* Create a new parameter from datatype 'type' and name 'n'.
* ------------------------------------------------------------------------ */
Parm *NewParm(SwigType *type, String_or_char *n) {
Parm *NewParm(SwigType *type, const String_or_char *n) {
Parm *p = NewHash();
if (type) {

View file

@ -247,7 +247,7 @@ extern String *SwigType_templateargs(SwigType *t);
extern String *SwigType_prefix(SwigType *t);
extern int SwigType_array_ndim(SwigType *t);
extern String *SwigType_array_getdim(SwigType *t, int n);
extern void SwigType_array_setdim(SwigType *t, int n, String_or_char *rep);
extern void SwigType_array_setdim(SwigType *t, int n, const String_or_char *rep);
extern SwigType *SwigType_array_type(SwigType *t);
extern String *SwigType_default(SwigType *t);
extern void SwigType_typename_replace(SwigType *t, String *pat, String *rep);
@ -261,7 +261,7 @@ extern void SwigType_inherit(String *subclass, String *baseclass, String
extern int SwigType_issubtype(SwigType *subtype, SwigType *basetype);
extern void SwigType_scope_alias(String *aliasname, Typetab *t);
extern void SwigType_using_scope(Typetab *t);
extern void SwigType_new_scope(String_or_char *name);
extern void SwigType_new_scope(const String_or_char *name);
extern void SwigType_inherit_scope(Typetab *scope);
extern Typetab *SwigType_pop_scope();
extern Typetab *SwigType_set_scope(Typetab *h);
@ -310,7 +310,7 @@ extern SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab);
/* Parameters are really just hidden behind a DOH object. The following
interface will probably be simplified even further. */
extern Parm *NewParm(SwigType *type, String_or_char *n);
extern Parm *NewParm(SwigType *type, const String_or_char *n);
extern Parm *CopyParm(Parm *p);
extern ParmList *CopyParmList(ParmList *);
extern int ParmList_len(ParmList *);
@ -396,7 +396,7 @@ extern void Swig_name_object_set(Hash *namehash, String_or_char *name, Swig
extern DOH *Swig_name_object_get(Hash *namehash, String_or_char *prefix, String_or_char *name, SwigType *decl);
extern void Swig_name_object_inherit(Hash *namehash, String *base, String *derived);
extern void Swig_features_get(Hash *features, String_or_char *prefix, String_or_char *name, SwigType *decl, Node *n);
extern void Swig_feature_set(Hash *features, String_or_char *name, SwigType *decl, String_or_char *fname, String *value);
extern void Swig_feature_set(Hash *features, const String_or_char *name, SwigType *decl, const String_or_char *featurename, String *value);
/* --- Misc --- */
extern char *Swig_copy_string(const char *c);
@ -430,8 +430,6 @@ extern void Swig_error_msg_format(ErrorMessageFormat format);
extern String *Swig_cparm_name(Parm *p, int i);
extern String *Swig_clocal(SwigType *t, String_or_char *name, String_or_char *value);
extern String *Swig_wrapped_var_type(SwigType *t);
extern String *Swig_wrapped_var_deref(SwigType *t, String_or_char *name);
extern String *Swig_wrapped_var_assign(SwigType *t, String_or_char *name);
extern int Swig_cargs(Wrapper *w, ParmList *l);
extern String *Swig_cresult(SwigType *t, const String_or_char *name, const String_or_char *decl);
@ -442,7 +440,7 @@ extern String *Swig_cppconstructor_call(String_or_char *name, ParmList *parms
extern String *Swig_cdestructor_call();
extern String *Swig_cppdestructor_call();
extern String *Swig_cmemberset_call(String_or_char *name, SwigType *type, String_or_char *self);
extern String *Swig_cmemberget_call(String_or_char *name, SwigType *t, String_or_char *self);
extern String *Swig_cmemberget_call(const String_or_char *name, SwigType *t, String_or_char *self);
/* --- Transformations --- */

View file

@ -15,7 +15,7 @@ char cvsroot_typemap_c[] = "$Header$";
#include "cparse.h"
#include <ctype.h>
static void replace_embedded_typemap(String *s, Wrapper *f);
static void replace_embedded_typemap(String *s);
/* -----------------------------------------------------------------------------
* Typemaps are stored in a collection of nested hash tables. Something like
@ -683,7 +683,7 @@ Swig_typemap_search_multi(const String_or_char *op, ParmList *parms, int *nmatch
* ----------------------------------------------------------------------------- */
static
void replace_local_types(ParmList *p, String *name, String *rep) {
void replace_local_types(ParmList *p, const String *name, const String *rep) {
SwigType *t;
while (p) {
t = Getattr(p,"type");
@ -1072,7 +1072,7 @@ String *Swig_typemap_lookup(const String_or_char *op, SwigType *type, String_or_
typemap_locals(s,locals,f,-1);
}
replace_embedded_typemap(s,f);
replace_embedded_typemap(s);
/* Now perform character replacements */
Replace(s,"$source",source,DOH_REPLACE_ANY);
@ -1150,7 +1150,7 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
if (locals && f) {
typemap_locals(s,locals,f,-1);
}
replace_embedded_typemap(s,f);
replace_embedded_typemap(s);
/* {
String *tmname = Getattr(tm,"typemap");
if (tmname) Replace(s,"$typemap",tmname, DOH_REPLACE_ANY);
@ -1348,7 +1348,7 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
typemap_locals(s,locals,f,argnum);
}
replace_embedded_typemap(s,f);
replace_embedded_typemap(s);
/* Replace the argument number */
sprintf(temp,"%d",argnum);
@ -1379,7 +1379,7 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
}
/* -----------------------------------------------------------------------------
* replace_embedded_typemap()
* split_embedded()
*
* This function replaces the special variable $typemap(....) with typemap
* code. The general form of $typemap is as follows:
@ -1462,7 +1462,7 @@ static void split_var(String *s, String **name, String **value) {
}
}
static void replace_embedded_typemap(String *s, Wrapper *f) {
static void replace_embedded_typemap(String *s) {
while (Strstr(s,"$TYPEMAP(")) {
/* Gather the argument */

View file

@ -453,7 +453,7 @@ void
SwigType_del_qualifier(SwigType *t) {
char *c = Char(t);
assert(strncmp(c,"q(",2) == 0);
Delslice(t,0,element_size(t));
Delslice(t,0,element_size(Char(t)));
}
int
@ -586,7 +586,7 @@ SwigType_array_getdim(SwigType *t, int n) {
}
/* Replace nth array dimension */
void SwigType_array_setdim(SwigType *t, int n, String_or_char *rep) {
void SwigType_array_setdim(SwigType *t, int n, const String_or_char *rep) {
String *result = 0;
char temp;
char *start;

View file

@ -207,7 +207,7 @@ SwigType_scope_name(Typetab *ttab) {
* Creates a new scope
* ----------------------------------------------------------------------------- */
void SwigType_new_scope(String_or_char *name) {
void SwigType_new_scope(const String_or_char *name) {
Typetab *s;
Hash *ttab;
String *qname;
@ -1653,7 +1653,7 @@ SwigType_emit_type_table(File *f_forward, File *f_table) {
while (ki.key) {
List *el;
Iterator ei;
String *cd;
const String *cd;
Printf(f_forward,"#define SWIGTYPE%s swig_types[%d] \n", ki.key, i);
Printv(types,"static swig_type_info _swigt_", ki.key, "[] = {", NIL);