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

« back to all changes in this revision

Viewing changes to Lib/java/enumtypesafe.swg

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   $1 = &temp; %}
15
15
%typemap(out) const enum SWIGTYPE &  %{ $result = (jint)*$1; %}
16
16
 
 
17
%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE &
 
18
%{ static $*1_ltype temp = ($*1_ltype)$input; 
 
19
   $1 = &temp; %}
17
20
%typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE &    "$input = (jint)$1_name;"
18
21
%typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)"
19
22
%typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()"
38
41
%typemap(in) enum SWIGTYPE  %{ $1 = ($1_ltype)$input; %}
39
42
%typemap(out) enum SWIGTYPE  %{ $result = (jint)$1; %}
40
43
 
 
44
%typemap(directorout) enum SWIGTYPE  %{ $1 = ($1_ltype)$input; %}
41
45
%typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE    "$input = (jint) $1;"
42
46
%typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)"
43
47
%typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()"
44
48
 
45
 
%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
 
49
%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
46
50
 
47
51
%typemap(throws) enum SWIGTYPE %{
48
52
  (void)$1;
79
83
  }
80
84
 
81
85
  public static $javaclassname swigToEnum(int swigValue) {
82
 
    if (swigValue < swigValues.length && swigValues[swigValue].swigValue == swigValue)
 
86
    if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
83
87
      return swigValues[swigValue];
84
88
    for (int i = 0; i < swigValues.length; i++)
85
89
      if (swigValues[i].swigValue == swigValue)