[java-gobject-introspection] Add type handling for SHORT/USHORT



commit eccbaad633b621d2299615a31141b8490f91ccd9
Author: Colin Walters <walters verbum org>
Date:   Mon Feb 8 13:57:45 2010 -0500

    Add type handling for SHORT/USHORT

 src/org/gnome/gir/compiler/TypeMap.java   |    5 ++++-
 src/org/gnome/gir/repository/TypeTag.java |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/org/gnome/gir/compiler/TypeMap.java b/src/org/gnome/gir/compiler/TypeMap.java
index b6ae318..9f9cd23 100644
--- a/src/org/gnome/gir/compiler/TypeMap.java
+++ b/src/org/gnome/gir/compiler/TypeMap.java
@@ -85,7 +85,8 @@ public class TypeMap {
 			return Type.BOOLEAN_TYPE;
 		if (tag == TypeTag.INT8 || tag == TypeTag.UINT8)
 			return Type.BYTE_TYPE;
-		if (tag == TypeTag.INT16 || tag == TypeTag.UINT16)
+		if (tag == TypeTag.INT16 || tag == TypeTag.UINT16 ||
+		        tag == TypeTag.SHORT || tag == TypeTag.USHORT)
 			return Type.SHORT_TYPE;
 		if (tag == TypeTag.INT32 || tag == TypeTag.UINT32 ||
 				tag == TypeTag.INT || tag == TypeTag.UINT)
@@ -153,6 +154,8 @@ public class TypeMap {
 		if (!(tag.equals(TypeTag.GLIST) || tag.equals(TypeTag.GSLIST)))
 			return true;
 		TypeInfo param = info.getParamType(0);
+		if (param == null)
+		    return false;
 		TypeTag paramTag = param.getTag();
 		if (!(paramTag.equals(TypeTag.UTF8) || paramTag.equals(TypeTag.INTERFACE)))
 			return false;
diff --git a/src/org/gnome/gir/repository/TypeTag.java b/src/org/gnome/gir/repository/TypeTag.java
index 40b96bf..63f44e2 100644
--- a/src/org/gnome/gir/repository/TypeTag.java
+++ b/src/org/gnome/gir/repository/TypeTag.java
@@ -36,6 +36,8 @@ public enum TypeTag {
 	UINT32, 
 	INT64, 
 	UINT64, 
+	SHORT,
+	USHORT,
 	INT, 
 	UINT, 
 	LONG, 
@@ -54,4 +56,4 @@ public enum TypeTag {
 	GSLIST, 
 	GHASH, 
 	ERROR,
-}
\ No newline at end of file
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]