1 /*
2 Copyright (C) 2005-2007 Feeling Software Inc.
3 Portions of the code are:
4 Copyright (C) 2005-2007 Sony Computer Entertainment America
5
6 MIT License: http://www.opensource.org/licenses/mit-license.php
7 */
8
9 /**
10 @file FMInteger.h
11 The file containing functions and constants for integer values.
12 */
13
14 #ifndef _FM_INTEGER_H_
15 #define _FM_INTEGER_H_
16
17 /** A dynamically-sized array of 32-bit signed integer values. */
18 typedef fm::vector<int32, true> Int32List;
19 /** A dynamically-sized array of 32-bit unsigned integer values. */
20 typedef fm::vector<uint32, true> UInt32List;
21 /** A dynamically-sized array of 16-bit unsigned integer values. */
22 typedef fm::vector<uint16, true> UInt16List;
23 /** A dynamically-sized array of 8-bit unsigned integer values. */
24 typedef fm::vector<uint8, true> UInt8List;
25 /** A dynamically-sized array of 8-bit signed integer values. */
26 typedef fm::vector<int8, true> Int8List;
27 /** A dynamically-sized array of boolean values. */
28 typedef fm::vector<bool, true> BooleanList;
29
30 /** Returns whether two signed or unsigned integers are equivalent.
31 For integers, this function simply wraps around the operator==.
32 @param i1 A first integer.
33 @param i2 A second integer.
34 @return Whether the two integers are equivalent. */
IsEquivalent(int8 i1,int8 i2)35 inline bool IsEquivalent(int8 i1, int8 i2) { return i1 == i2; }
IsEquivalent(uint8 i1,uint8 i2)36 inline bool IsEquivalent(uint8 i1, uint8 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(int16 i1,int16 i2)37 inline bool IsEquivalent(int16 i1, int16 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(uint16 i1,uint16 i2)38 inline bool IsEquivalent(uint16 i1, uint16 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(int32 i1,int32 i2)39 inline bool IsEquivalent(int32 i1, int32 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(uint32 i1,uint32 i2)40 inline bool IsEquivalent(uint32 i1, uint32 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(int64 i1,int64 i2)41 inline bool IsEquivalent(int64 i1, int64 i2) { return i1 == i2; } /**< See above. */
IsEquivalent(uint64 i1,uint64 i2)42 inline bool IsEquivalent(uint64 i1, uint64 i2) { return i1 == i2; } /**< See above. */
43
44 /** Returns whether two Booleans are equivalent.
45 @param b1 A first Boolean.
46 @param b2 A second Boolean.
47 @return Whether the two Booleans are equivalent. */
IsEquivalent(bool b1,bool b2)48 inline bool IsEquivalent(bool b1, bool b2) { return b1 == b2; }
49
50 #endif // _FM_INTEGER_H_
51
52