~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Lib/lua/luatypemaps.swg

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
%{$1 = (lua_toboolean(L, $input)!=0);%}
74
74
 
75
75
%typemap(out) bool
76
 
%{  lua_pushboolean(L,(int)($1==true)); SWIG_arg++;%}
 
76
%{  lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%}
77
77
 
78
78
// for const bool&, SWIG treats this as a const bool* so we must dereference it
79
79
%typemap(in,checkfn="lua_isboolean") const bool& (bool temp)
81
81
  $1=&temp;%}
82
82
 
83
83
%typemap(out) const bool&
84
 
%{  lua_pushboolean(L,(int)(*$1==true)); SWIG_arg++;%}
 
84
%{  lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%}
85
85
 
86
86
// strings (char* and char[])
87
87
%typemap(in,checkfn="lua_isstring") const char*, char*
189
189
#ifdef __cplusplus
190
190
%typemap(out) SWIGTYPE
191
191
{
192
 
  $&1_ltype resultptr = new $1_ltype(($1_ltype &) $1);
 
192
  $&1_ltype resultptr = new $1_ltype((const $1_ltype &) $1);
193
193
  SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++;
194
194
}
195
195
#else