|
|
@@ -807,24 +807,52 @@ is_unsigned_integer(CPPType *type) {
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: TypeManager::is_unsigned_longlong
|
|
|
+// Function: TypeManager::is_short
|
|
|
+// Access: Public, Static
|
|
|
+// Description: Returns true if the indicated type is the "short"
|
|
|
+// type, whether signed or unsigned.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+bool TypeManager::
|
|
|
+is_short(CPPType *type) {
|
|
|
+ switch (type->get_subtype()) {
|
|
|
+ case CPPDeclaration::ST_const:
|
|
|
+ return is_short(type->as_const_type()->_wrapped_around);
|
|
|
+
|
|
|
+ case CPPDeclaration::ST_simple:
|
|
|
+ {
|
|
|
+ CPPSimpleType *simple_type = type->as_simple_type();
|
|
|
+ if (simple_type != (CPPSimpleType *)NULL) {
|
|
|
+ return (simple_type->_type == CPPSimpleType::T_int &&
|
|
|
+ (simple_type->_flags & CPPSimpleType::F_short) != 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: TypeManager::is_unsigned_short
|
|
|
// Access: Public, Static
|
|
|
// Description: Returns true if the indicated type is an unsigned
|
|
|
-// "long long" type or larger, or at least a 64-bit
|
|
|
-// unsigned integer.
|
|
|
+// "short" type.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
bool TypeManager::
|
|
|
-is_unsigned_longlong(CPPType *type) {
|
|
|
+is_unsigned_short(CPPType *type) {
|
|
|
switch (type->get_subtype()) {
|
|
|
case CPPDeclaration::ST_const:
|
|
|
- return is_unsigned_longlong(type->as_const_type()->_wrapped_around);
|
|
|
+ return is_unsigned_short(type->as_const_type()->_wrapped_around);
|
|
|
|
|
|
case CPPDeclaration::ST_simple:
|
|
|
{
|
|
|
CPPSimpleType *simple_type = type->as_simple_type();
|
|
|
if (simple_type != (CPPSimpleType *)NULL) {
|
|
|
return (simple_type->_type == CPPSimpleType::T_int &&
|
|
|
- (simple_type->_flags & (CPPSimpleType::F_longlong | CPPSimpleType::F_unsigned)) == (CPPSimpleType::F_longlong | CPPSimpleType::F_unsigned));
|
|
|
+ (simple_type->_flags & (CPPSimpleType::F_short | CPPSimpleType::F_unsigned)) == (CPPSimpleType::F_short | CPPSimpleType::F_unsigned));
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
@@ -866,6 +894,64 @@ is_longlong(CPPType *type) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: TypeManager::is_unsigned_longlong
|
|
|
+// Access: Public, Static
|
|
|
+// Description: Returns true if the indicated type is an unsigned
|
|
|
+// "long long" type or larger, or at least a 64-bit
|
|
|
+// unsigned integer.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+bool TypeManager::
|
|
|
+is_unsigned_longlong(CPPType *type) {
|
|
|
+ switch (type->get_subtype()) {
|
|
|
+ case CPPDeclaration::ST_const:
|
|
|
+ return is_unsigned_longlong(type->as_const_type()->_wrapped_around);
|
|
|
+
|
|
|
+ case CPPDeclaration::ST_simple:
|
|
|
+ {
|
|
|
+ CPPSimpleType *simple_type = type->as_simple_type();
|
|
|
+ if (simple_type != (CPPSimpleType *)NULL) {
|
|
|
+ return (simple_type->_type == CPPSimpleType::T_int &&
|
|
|
+ (simple_type->_flags & (CPPSimpleType::F_longlong | CPPSimpleType::F_unsigned)) == (CPPSimpleType::F_longlong | CPPSimpleType::F_unsigned));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: TypeManager::is_double
|
|
|
+// Access: Public, Static
|
|
|
+// Description: Returns true if the indicated type is the "double"
|
|
|
+// type.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+bool TypeManager::
|
|
|
+is_double(CPPType *type) {
|
|
|
+ switch (type->get_subtype()) {
|
|
|
+ case CPPDeclaration::ST_const:
|
|
|
+ return is_float(type->as_const_type()->_wrapped_around);
|
|
|
+
|
|
|
+ case CPPDeclaration::ST_simple:
|
|
|
+ {
|
|
|
+ CPPSimpleType *simple_type = type->as_simple_type();
|
|
|
+ if (simple_type != (CPPSimpleType *)NULL) {
|
|
|
+ return (simple_type->_type == CPPSimpleType::T_double);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: TypeManager::is_float
|
|
|
// Access: Public, Static
|