|
10 | 10 | #include <type_traits> |
11 | 11 | #include <gromox/defs.h> |
12 | 12 |
|
13 | | -#define PROP_ID(x) static_cast<uint16_t>((x) >> 16) |
14 | | -#define PROP_TYPE(x) static_cast<uint16_t>((x) & 0xFFFF) |
15 | | -#define CHANGE_PROP_TYPE(tag, newtype) static_cast<uint32_t>(((tag) & ~0xFFFF) | (newtype)) |
| 13 | +namespace gromox { |
| 14 | + |
| 15 | +using propid_t = uint16_t; |
| 16 | +using proptype_t = uint16_t; |
| 17 | +using proptag_t = uint32_t; |
| 18 | +/* N.B.: PidLids are not propids (they are also 32-bit wide) */ |
| 19 | +using mapitime_t = uint64_t; |
| 20 | + |
| 21 | +} |
| 22 | + |
| 23 | +#define PROP_ID(x) static_cast<gromox::propid_t>((x) >> 16) |
| 24 | +#define PROP_TYPE(x) static_cast<gromox::proptype_t>((x) & 0xFFFF) |
| 25 | +#define CHANGE_PROP_TYPE(tag, newtype) static_cast<gromox::proptag_t>(((tag) & ~0xFFFF) | (newtype)) |
16 | 26 |
|
17 | 27 | /* |
18 | 28 | * x|y yields an unsigned result if either x or y are unsigned. |
19 | 29 | * x<<y yields unsigned only if x is unsigned. |
20 | 30 | * All the while | and << only make *sense* in an unsigned _context_ anyway |
21 | 31 | * (i.e. the operator should have returned unsigned all the time) |
22 | 32 | */ |
23 | | -#define PROP_TAG(type, tag) static_cast<uint32_t>((static_cast<uint32_t>(tag) << 16) | (type)) |
| 33 | +#define PROP_TAG(type, tag) static_cast<gromox::proptag_t>((static_cast<uint32_t>(tag) << 16) | (type)) |
24 | 34 | namespace { |
25 | 35 | enum { |
26 | 36 | /* |
@@ -76,11 +86,8 @@ enum { |
76 | 86 | PT_MV_CLSID = 0x1048, /* PtypMultipleGuid */ |
77 | 87 | PT_MV_BINARY = 0x1102, /* PtypMultipleBinary */ |
78 | 88 | }; |
79 | | -using proptype_t = decltype(PT_NULL); |
80 | 89 | } |
81 | 90 |
|
82 | | -using mapitime_t = uint64_t; |
83 | | - |
84 | 91 | #include "mapitags.hpp" |
85 | 92 |
|
86 | 93 | enum { |
@@ -1053,7 +1060,7 @@ struct GX_EXPORT PROPERTY_XNAME { |
1053 | 1060 | std::string name; |
1054 | 1061 | }; |
1055 | 1062 |
|
1056 | | -using PROPID_ARRAY = std::vector<uint16_t>; |
| 1063 | +using PROPID_ARRAY = std::vector<gromox::propid_t>; |
1057 | 1064 |
|
1058 | 1065 | struct PROPNAME_ARRAY { |
1059 | 1066 | uint16_t count; |
|
0 commit comments