From 42a73eeb64a55cd3cb9acf7eb7ce61958b3fcb3d Mon Sep 17 00:00:00 2001 From: yanyiwu Date: Sun, 17 Apr 2016 22:11:58 +0800 Subject: [PATCH] make compiler happy --- include/cppjieba/Unicode.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/cppjieba/Unicode.hpp b/include/cppjieba/Unicode.hpp index 113cb22..37813d2 100644 --- a/include/cppjieba/Unicode.hpp +++ b/include/cppjieba/Unicode.hpp @@ -49,10 +49,14 @@ struct WordRange { struct RuneStrLite { uint32_t rune; uint32_t len; + RuneStrLite(): rune(0), len(0) { + } + RuneStrLite(uint32_t r, uint32_t l): rune(r), len(l) { + } }; // struct RuneStrLite inline RuneStrLite DecodeRuneInString(const char* str, size_t len) { - RuneStrLite rp = {0, 0}; + RuneStrLite rp(0, 0); if (str == NULL || len == 0) { return rp; } @@ -114,7 +118,7 @@ inline bool DecodeRunesInString(const char* s, size_t len, RuneStrArray& runes) if (rp.len == 0) { return false; } - RuneStr x = {rp.rune, s + i, rp.len}; + RuneStr x(rp.rune, s + i, rp.len); runes.push_back(x); i += rp.len; }