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@5639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0f991243d3
commit
8377edf02a
24 changed files with 77 additions and 63 deletions
|
|
@ -650,6 +650,7 @@ public:
|
|||
}
|
||||
|
||||
virtual int destructorDeclaration(Node *n) {
|
||||
(void)n;
|
||||
if (!inclass) return SWIG_OK;
|
||||
if (!extendmode) {
|
||||
Setattr(inclass,"allocate:has_destructor","1");
|
||||
|
|
|
|||
|
|
@ -413,6 +413,9 @@ Swig_browser(Node *top, int port) {
|
|||
swill_close();
|
||||
delete browse;
|
||||
return;
|
||||
#else
|
||||
(void)top;
|
||||
(void)port;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3239,6 +3239,7 @@ class JAVA : public Language {
|
|||
* classDirectorDisown()
|
||||
* ------------------------------------------------------------------*/
|
||||
virtual int classDirectorDisown(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -3272,7 +3273,7 @@ class JAVA : public Language {
|
|||
* director-based class.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
virtual int JAVA::abstractClassTest(Node *n) {
|
||||
virtual int abstractClassTest(Node *n) {
|
||||
if (!Cmp(Getattr(n, "feature:director"), "1"))
|
||||
return 0;
|
||||
return Language::abstractClassTest(n);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
char cvsroot_lang_cxx[] = "$Header$";
|
||||
|
||||
#include "swigmod.h"
|
||||
#include "cparse.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static int director_protected_mode = 0; /* set to 0 on default */
|
||||
|
|
@ -519,6 +520,7 @@ int Language::insertDirective(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::moduleDirective(Node *n) {
|
||||
(void)n;
|
||||
/* %module directive */
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -556,8 +558,6 @@ int Language::pragmaDirective(Node *n) {
|
|||
* Language::typemapDirective()
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
||||
extern "C" void Swig_cparse_replace_descriptor(String *s);
|
||||
|
||||
int Language::typemapDirective(Node *n) {
|
||||
/* %typemap directive */
|
||||
String *method = Getattr(n,"method");
|
||||
|
|
@ -1402,6 +1402,9 @@ int Language::typedefHandler(Node *) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorMethod(Node *n, Node *parent, String* super) {
|
||||
(void)n;
|
||||
(void)parent;
|
||||
(void)super;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1410,6 +1413,7 @@ int Language::classDirectorMethod(Node *n, Node *parent, String* super) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorConstructor(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1418,6 +1422,7 @@ int Language::classDirectorConstructor(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorDefaultConstructor(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1564,6 +1569,7 @@ int Language::classDirectorMethods(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorInit(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1572,6 +1578,7 @@ int Language::classDirectorInit(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorEnd(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1776,6 +1783,7 @@ int Language::classHandler(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classforwardDeclaration(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -2080,10 +2088,13 @@ int Language::functionWrapper(Node *n) {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int Language::nativeWrapper(Node *n) {
|
||||
(void)n;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
void Language::main(int argc, char *argv[]) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -720,13 +720,11 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
}
|
||||
Setattr(top,"outfile_h", NewStringf("%s_wrap.h", Swig_file_basename(input_file)));
|
||||
} else {
|
||||
char *header = strdup(outfile_name);
|
||||
char *ext = header + strlen(header);
|
||||
while (ext > header && *ext != '.') ext--;
|
||||
if (*ext == '.') *ext = 0;
|
||||
char *ext = strrchr(outfile_name, '.');
|
||||
String *basename = ext ? NewStringWithSize(outfile_name,ext-outfile_name) : NewString(outfile_name);
|
||||
Setattr(top,"outfile", outfile_name);
|
||||
Setattr(top,"outfile_h", NewStringf("%s.h", header));
|
||||
free(header);
|
||||
Setattr(top,"outfile_h", NewStringf("%s.h", basename));
|
||||
Delete(basename);
|
||||
}
|
||||
set_outdir(Swig_file_dirname(Getattr(top,"outfile")));
|
||||
if (Swig_contract_mode_get()) {
|
||||
|
|
|
|||
|
|
@ -70,10 +70,6 @@ static File *f_int_to_enum = 0;
|
|||
class OCAML : public Language {
|
||||
public:
|
||||
|
||||
int validIdentifier( String *s ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String *Swig_class_name(Node *n) {
|
||||
String *name;
|
||||
name = Copy(Getattr(n, "sym:name"));
|
||||
|
|
|
|||
|
|
@ -949,7 +949,7 @@ public:
|
|||
Putc(toupper((int )*iname), member_function_name);
|
||||
Printf(member_function_name, "%s", iname+1);
|
||||
|
||||
cpp_func(Char(member_function_name), d, l, php_function_name);
|
||||
cpp_func(l, php_function_name);
|
||||
|
||||
Delete(php_function_name);
|
||||
Delete(member_function_name);
|
||||
|
|
@ -1707,7 +1707,6 @@ public:
|
|||
virtual int memberfunctionHandler(Node *n) {
|
||||
char *name = GetChar(n, "name");
|
||||
char *iname = GetChar(n, "sym:name");
|
||||
SwigType *t = Getattr(n, "type");
|
||||
ParmList *l = Getattr(n, "parms");
|
||||
|
||||
this->Language::memberfunctionHandler(n);
|
||||
|
|
@ -1716,7 +1715,7 @@ public:
|
|||
char *realname = iname ? iname : name;
|
||||
String *php_function_name = Swig_name_member(shadow_classname, realname);
|
||||
|
||||
cpp_func(iname, t, l, realname, php_function_name);
|
||||
cpp_func(l, realname, php_function_name);
|
||||
|
||||
}
|
||||
return SWIG_OK;
|
||||
|
|
@ -1752,7 +1751,7 @@ public:
|
|||
static_flag = 1;
|
||||
char *realname = iname ? iname : name;
|
||||
String *php_function_name = Swig_name_member(shadow_classname, realname);
|
||||
cpp_func(Char(symname), Getattr(n, "type"), Getattr(n, "parms"), symname, php_function_name);
|
||||
cpp_func(Getattr(n, "parms"), symname, php_function_name);
|
||||
static_flag = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1787,7 +1786,7 @@ public:
|
|||
if(Getattr(n,"feature:immutable")) {
|
||||
const_flag = 1;
|
||||
}
|
||||
cpp_func(iname, d, 0, iname);
|
||||
cpp_func(0, iname);
|
||||
static_flag = 0;
|
||||
|
||||
create_command(iname, Char(Swig_name_wrapper(iname)));
|
||||
|
|
@ -2051,7 +2050,7 @@ public:
|
|||
}
|
||||
|
||||
// This method is quite stale and ought to be factored out
|
||||
void cpp_func(char *iname, SwigType *t, ParmList *l, String *php_function_name, String *handler_name = NULL) {
|
||||
void cpp_func(ParmList *l, String *php_function_name, String *handler_name = NULL) {
|
||||
if(!shadow) return;
|
||||
|
||||
// if they didn't provide a handler name, use the realname
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ public:
|
|||
* add_method()
|
||||
* ------------------------------------------------------------ */
|
||||
|
||||
void add_method(Node *n, const DOHString_or_char *name, const DOHString_or_char *function, const DOHString_or_char *description) {
|
||||
void add_method(const DOHString_or_char *name, const DOHString_or_char *function, const DOHString_or_char *description) {
|
||||
String *rename = NULL;
|
||||
switch (current) {
|
||||
case NO_CPP:
|
||||
|
|
@ -468,7 +468,7 @@ public:
|
|||
|
||||
/* Now register the function with the interpreter. */
|
||||
if (!Getattr(n,"sym:overloaded")) {
|
||||
add_method(n, iname, wname, description);
|
||||
add_method(iname, wname, description);
|
||||
} else {
|
||||
Setattr(n,"wrap:name", wname);
|
||||
if (!Getattr(n,"sym:nextSibling")) {
|
||||
|
|
@ -532,7 +532,7 @@ public:
|
|||
if (pd)
|
||||
Printf(description, " %s", pd);
|
||||
}
|
||||
add_method(n, symname, wname, description);
|
||||
add_method(symname, wname, description);
|
||||
Delete(description);
|
||||
|
||||
DelWrapper(f);
|
||||
|
|
@ -597,7 +597,7 @@ public:
|
|||
|
||||
if (!addSymbol(wrapname,n)) return SWIG_ERROR;
|
||||
|
||||
add_method(n, name, wrapname,0);
|
||||
add_method(name, wrapname,0);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -775,7 +775,7 @@ public:
|
|||
|
||||
/* Register it with Pike */
|
||||
String *description = NewString("tStr tFloat, tVoid");
|
||||
add_method(First(membervariables).item, "`->=", wname, description);
|
||||
add_method("`->=", wname, description);
|
||||
Delete(description);
|
||||
|
||||
/* Clean up */
|
||||
|
|
@ -812,7 +812,7 @@ public:
|
|||
|
||||
/* Register it with Pike */
|
||||
String *description = NewString("tStr, tMix");
|
||||
add_method(First(membervariables).item, "`->", wname, description);
|
||||
add_method("`->", wname, description);
|
||||
Delete(description);
|
||||
|
||||
/* Clean up */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue