summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-23 18:39:16 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-23 18:39:16 +0800
commit9df8678bb0bab71da9631ff13244555e7a33c458 (patch)
tree6e670765d7d11a769edef5aa8c9461ca14511a47
parent40c82f591553e94f21816b2d940aab1d47f2b3d3 (diff)
downloadlibpinyin-9df8678bb0bab71da9631ff13244555e7a33c458.tar.gz
libpinyin-9df8678bb0bab71da9631ff13244555e7a33c458.tar.xz
libpinyin-9df8678bb0bab71da9631ff13244555e7a33c458.zip
fixes code style in src/include
-rw-r--r--src/include/memory_chunk.h10
-rw-r--r--src/include/novel_types.h16
2 files changed, 13 insertions, 13 deletions
diff --git a/src/include/memory_chunk.h b/src/include/memory_chunk.h
index 3d9ea35..c72e92f 100644
--- a/src/include/memory_chunk.h
+++ b/src/include/memory_chunk.h
@@ -116,7 +116,7 @@ public:
}
void* end() const{
- return m_data_end;
+ return m_data_end;
}
size_t size() const{
@@ -214,15 +214,15 @@ public:
/* free old data */
reset();
- size_t file_size;
+ size_t file_size;
FILE* file = fopen(filename, "r");
if ( !file )
return false;
- fseek(file, 0, SEEK_END);
- file_size = ftell(file);
- fseek(file, 0, SEEK_SET);
+ fseek(file, 0, SEEK_END);
+ file_size = ftell(file);
+ fseek(file, 0, SEEK_SET);
int data_len = file_size;
void* data = malloc(data_len);
diff --git a/src/include/novel_types.h b/src/include/novel_types.h
index 8077af6..42dd3fc 100644
--- a/src/include/novel_types.h
+++ b/src/include/novel_types.h
@@ -42,7 +42,7 @@ typedef gunichar2 utf16_t;
#define PHRASE_INDEX_LIBRARY_MASK 0x0F000000
#define PHRASE_INDEX_LIBRARY_COUNT (1<<4)
#define PHRASE_INDEX_LIBRARY_INDEX(token) ((token&PHRASE_INDEX_LIBRARY_MASK)>>24)
-#define PHRASE_INDEX_MAKE_TOKEN(phrase_index, token) \
+#define PHRASE_INDEX_MAKE_TOKEN(phrase_index, token) \
( ( (phrase_index<<24) & PHRASE_INDEX_LIBRARY_MASK)|(token & PHRASE_MASK))
@@ -51,8 +51,8 @@ typedef gunichar2 utf16_t;
*/
struct PhraseIndexRange{
- phrase_token_t m_range_begin;
- phrase_token_t m_range_end; /* pass the last item like stl */
+ phrase_token_t m_range_begin;
+ phrase_token_t m_range_end; /* pass the last item like stl */
};
/*Array of PhraseIndexRange*/
@@ -106,8 +106,8 @@ enum ATTACH_FLAG{
*/
struct BigramPhraseItem{
- phrase_token_t m_token;
- gfloat m_freq; /* P(W2|W1) */
+ phrase_token_t m_token;
+ gfloat m_freq; /* P(W2|W1) */
};
struct BigramPhraseItemWithCount{
@@ -125,9 +125,9 @@ typedef GArray * BigramPhraseWithCountArray; /* Array of BigramPhraseItemWithCou
*/
enum AttachOption{
- ATTACH_NEW_FILE = 1,
- ATTACH_READ = 2,
- ATTACH_READ_WRITE = 3
+ ATTACH_NEW_FILE = 1,
+ ATTACH_READ = 2,
+ ATTACH_READ_WRITE = 3
};
#define MAX_PHRASE_LENGTH 16