Skip to content

Commit 85b945f

Browse files
lotemkionz
authored andcommitted
feat(dict): no conditional compilation on arm
1 parent 1177142 commit 85b945f

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

src/rime/dict/mapped_file.h

-4
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ class MappedFile : boost::noncopyable {
131131

132132
// member function definitions
133133

134-
# if defined(__arm__)
135134
# define RIME_ALIGNED(size, T) ((size + alignof(T) - 1) & ~(alignof(T) - 1))
136-
# else
137-
# define RIME_ALIGNED(size, T) (size)
138-
# endif
139135

140136
template <class T>
141137
T* MappedFile::Allocate(size_t count) {

src/rime/dict/table.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#include <rime/dict/vocabulary.h>
1616
#include <rime/dict/string_table.h>
1717

18-
#define RIME_TABLE_UNION(U, V, Ta, a, Tb, b) \
18+
#define RIME_TABLE_UNION(U, V, A, a, B, b) \
1919
struct U { \
2020
V value; \
21-
const Ta& a() const { return *reinterpret_cast<const Ta*>(this); } \
22-
const Tb& b() const { return *reinterpret_cast<const Tb*>(this); } \
23-
Ta& a() { return *reinterpret_cast<Ta*>(this); } \
24-
Tb& b() { return *reinterpret_cast<Tb*>(this); } \
21+
const A& a() const { return *reinterpret_cast<const A*>(this); } \
22+
const B& b() const { return *reinterpret_cast<const B*>(this); } \
23+
A& a() { return *reinterpret_cast<A*>(this); } \
24+
B& b() { return *reinterpret_cast<B*>(this); } \
2525
}
2626

2727
namespace rime {
@@ -40,11 +40,7 @@ using Syllabary = Array<StringType>;
4040

4141
using Code = List<SyllableId>;
4242

43-
#if defined(__arm__)
4443
using Weight = double;
45-
#else
46-
using Weight = float;
47-
#endif
4844

4945
struct Entry {
5046
StringType text;
@@ -75,7 +71,7 @@ using TrunkIndex = Array<TrunkIndexNode>;
7571

7672
using TailIndex = Array<LongEntry>;
7773

78-
//union Phraseindex {
74+
//union PhraseIndex {
7975
// TrunkIndex trunk;
8076
// TailIndex tail;
8177
//};

0 commit comments

Comments
 (0)