Visual C++ 8 warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10229 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9a74c3a918
commit
df83cef573
6 changed files with 15 additions and 6 deletions
|
|
@ -5,8 +5,8 @@ CXXSRCS = example2_wrap.cxx
|
||||||
INTERFACE = dual.i
|
INTERFACE = dual.i
|
||||||
LUA_INTERP = dual.cpp
|
LUA_INTERP = dual.cpp
|
||||||
|
|
||||||
# this is a little different ot normal as we need to static link two modules and a custom intepreter
|
# This is a little different to normal as we need to static link two modules and a custom interpreter
|
||||||
# we need the external runtime, then swig examples2, and build the module as normal
|
# We need the external runtime, then swig examples2, and build the module as normal
|
||||||
all::
|
all::
|
||||||
$(SWIG) -lua -external-runtime
|
$(SWIG) -lua -external-runtime
|
||||||
$(SWIG) -c++ -lua $(SWIGOPT) example2.i
|
$(SWIG) -c++ -lua $(SWIGOPT) example2.i
|
||||||
|
|
@ -15,6 +15,7 @@ all::
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
$(MAKE) -f $(TOP)/Makefile lua_clean
|
$(MAKE) -f $(TOP)/Makefile lua_clean
|
||||||
|
rm -f swigluarun.h
|
||||||
|
|
||||||
check: all
|
check: all
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@ the two modules are now linked together, and all can now find
|
||||||
both Foo and Bar.
|
both Foo and Bar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "swigluarun.h" // the swig runtimes
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "swigluarun.h" // the swig runtimes
|
|
||||||
|
|
||||||
// the 2 libraries which are wrappered via SWIG
|
// the 2 libraries which are wrappered via SWIG
|
||||||
extern "C" int luaopen_example(lua_State*L);
|
extern "C" int luaopen_example(lua_State*L);
|
||||||
extern "C" int luaopen_example2(lua_State*L);
|
extern "C" int luaopen_example2(lua_State*L);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ int callback(int a, int b, SWIGLUA_FN fn)
|
||||||
lua_pushnumber(fn.L,a);
|
lua_pushnumber(fn.L,a);
|
||||||
lua_pushnumber(fn.L,b);
|
lua_pushnumber(fn.L,b);
|
||||||
lua_call(fn.L,2,1); /* 2 in, 1 out */
|
lua_call(fn.L,2,1); /* 2 in, 1 out */
|
||||||
return luaL_checknumber(fn.L,-1);
|
return (int)luaL_checknumber(fn.L,-1);
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@
|
||||||
%include "typemaps.i" // you must have this for the typemaps for ptrs
|
%include "typemaps.i" // you must have this for the typemaps for ptrs
|
||||||
// basic function testing
|
// basic function testing
|
||||||
//
|
//
|
||||||
|
%inline %{
|
||||||
extern int add1(int x, int y); // return x+y -- basic function test
|
extern int add1(int x, int y); // return x+y -- basic function test
|
||||||
extern void add2(int x, int *INPUT, int *OUTPUT); // *z = x+*y -- argin and argout test
|
extern void add2(int x, int *INPUT, int *OUTPUT); // *z = x+*y -- argin and argout test
|
||||||
extern int add3(int x, int y, int *OUTPUT); // return x+y, *z=x-y -- returning 2 values
|
extern int add3(int x, int y, int *OUTPUT); // return x+y, *z=x-y -- returning 2 values
|
||||||
extern void add4(int x, int *INOUT); // *y += x -- INOUT dual purpose variable
|
extern void add4(int x, int *INOUT); // *y += x -- INOUT dual purpose variable
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,9 @@
|
||||||
for manipulating C pointers */
|
for manipulating C pointers */
|
||||||
|
|
||||||
/* First we'll use the pointer library */
|
/* First we'll use the pointer library */
|
||||||
|
%inline %{
|
||||||
extern void add(int *x, int *y, int *result);
|
extern void add(int *x, int *y, int *result);
|
||||||
|
%}
|
||||||
%include cpointer.i
|
%include cpointer.i
|
||||||
%pointer_functions(int, intp);
|
%pointer_functions(int, intp);
|
||||||
|
|
||||||
|
|
@ -17,11 +19,16 @@ extern void add(int *x, int *y, int *result);
|
||||||
|
|
||||||
%include typemaps.i
|
%include typemaps.i
|
||||||
extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
|
extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
|
||||||
|
%{
|
||||||
|
extern void sub(int *, int *, int *);
|
||||||
|
%}
|
||||||
|
|
||||||
/* Next we'll use typemaps and the %apply directive */
|
/* Next we'll use typemaps and the %apply directive */
|
||||||
|
|
||||||
%apply int *OUTPUT { int *r };
|
%apply int *OUTPUT { int *r };
|
||||||
|
%inline %{
|
||||||
extern int divide(int n, int d, int *r);
|
extern int divide(int n, int d, int *r);
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -515,7 +515,6 @@ SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
|
||||||
/* performs the entire class registration process */
|
/* performs the entire class registration process */
|
||||||
SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
|
SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
/* add its constructor to module with the name of the class
|
/* add its constructor to module with the name of the class
|
||||||
so you can do MyClass(...) as well as new_MyClass(...)
|
so you can do MyClass(...) as well as new_MyClass(...)
|
||||||
BUT only if a constructor is defined
|
BUT only if a constructor is defined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue