Skip to content

Commit

Permalink
feat(dict): no conditional compilation on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem authored and kionz committed Oct 4, 2017
1 parent 1177142 commit 85b945f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/rime/dict/mapped_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@ class MappedFile : boost::noncopyable {

// member function definitions

# if defined(__arm__)
# define RIME_ALIGNED(size, T) ((size + alignof(T) - 1) & ~(alignof(T) - 1))
# else
# define RIME_ALIGNED(size, T) (size)
# endif

template <class T>
T* MappedFile::Allocate(size_t count) {
Expand Down
16 changes: 6 additions & 10 deletions src/rime/dict/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#include <rime/dict/vocabulary.h>
#include <rime/dict/string_table.h>

#define RIME_TABLE_UNION(U, V, Ta, a, Tb, b) \
#define RIME_TABLE_UNION(U, V, A, a, B, b) \
struct U { \
V value; \
const Ta& a() const { return *reinterpret_cast<const Ta*>(this); } \
const Tb& b() const { return *reinterpret_cast<const Tb*>(this); } \
Ta& a() { return *reinterpret_cast<Ta*>(this); } \
Tb& b() { return *reinterpret_cast<Tb*>(this); } \
const A& a() const { return *reinterpret_cast<const A*>(this); } \
const B& b() const { return *reinterpret_cast<const B*>(this); } \
A& a() { return *reinterpret_cast<A*>(this); } \
B& b() { return *reinterpret_cast<B*>(this); } \
}

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

using Code = List<SyllableId>;

#if defined(__arm__)
using Weight = double;
#else
using Weight = float;
#endif

struct Entry {
StringType text;
Expand Down Expand Up @@ -75,7 +71,7 @@ using TrunkIndex = Array<TrunkIndexNode>;

using TailIndex = Array<LongEntry>;

//union Phraseindex {
//union PhraseIndex {
// TrunkIndex trunk;
// TailIndex tail;
//};
Expand Down

0 comments on commit 85b945f

Please sign in to comment.