summaryrefslogtreecommitdiffstats
path: root/utils/utils_helper.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2022-06-02 13:17:38 +0800
committerPeng Wu <alexepico@gmail.com>2022-06-02 13:19:39 +0800
commita307b3e60b0b93310eb7efd165659d84d8752a56 (patch)
tree35a4a85df1c6a23c142362de491f9ed846234886 /utils/utils_helper.h
parent706188e5080f29665ecd41791df611f4e3a6e248 (diff)
downloadlibpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.tar.gz
libpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.tar.xz
libpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.zip
Use check_result macro in utils directory
Diffstat (limited to 'utils/utils_helper.h')
-rw-r--r--utils/utils_helper.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/utils_helper.h b/utils/utils_helper.h
index d44d129..a39cf22 100644
--- a/utils/utils_helper.h
+++ b/utils/utils_helper.h
@@ -22,6 +22,7 @@
#ifndef UTILS_HELPER_H
#define UTILS_HELPER_H
+#include "pinyin_utils.h"
#define TAGLIB_GET_TOKEN(var, index) \
phrase_token_t var = null_token; \
@@ -42,8 +43,8 @@
type var; \
{ \
gpointer value = NULL; \
- assert(g_hash_table_lookup_extended \
- (required, #var, NULL, &value)); \
+ check_result(g_hash_table_lookup_extended \
+ (required, #var, NULL, &value)); \
var = conv((const char *)value); \
}
@@ -55,13 +56,13 @@
\
gchar ** strs = g_strsplit_set(line, " \t", 2); \
if (2 != g_strv_length(strs)) \
- assert(false); \
+ assert(FALSE); \
\
phrase_token_t _token = atoi(strs[0]); \
const char * phrase = strs[1]; \
if (null_token != _token) \
- assert(taglib_validate_token_with_string \
- (phrase_index, _token, phrase)); \
+ check_result(taglib_validate_token_with_string \
+ (phrase_index, _token, phrase)); \
\
var = _token; \
\