diff options
| author | OpportunityLiu <[email protected]> | 2019-07-02 13:37:35 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-02 13:37:35 +0800 |
| commit | 8ab977a03a722d8cadca68edf4636505384f64af (patch) | |
| tree | 95f260dd6003152edfef814473324c7411a57d7c | |
| parent | 2f95b93227204eb126fae986c3940ac4f054deb9 (diff) | |
fix
| -rw-r--r-- | core/src/xmake/io/file_flush.c | 6 | ||||
| -rw-r--r-- | core/src/xmake/winos/ansi.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/src/xmake/io/file_flush.c b/core/src/xmake/io/file_flush.c index 9d296037b..a5295bf90 100644 --- a/core/src/xmake/io/file_flush.c +++ b/core/src/xmake/io/file_flush.c @@ -35,13 +35,13 @@ /* ////////////////////////////////////////////////////////////////////////////////////// * implementation */ -static tb_bool_t xm_io_std_flush(xm_io_file* file) +static tb_bool_t xm_io_std_flush_impl(xm_io_file* file) { tb_assert_and_check_return_val(xm_io_file_is_std(file) && !xm_io_file_is_closed(file), tb_false); return !fflush(file->std_ref); } -static tb_bool_t xm_io_file_flush(xm_io_file* file) +static tb_bool_t xm_io_file_flush_impl(xm_io_file* file) { tb_assert_and_check_return_val(xm_io_file_is_file(file) && !xm_io_file_is_closed(file), tb_false); return tb_file_sync(file->file_ref); @@ -62,7 +62,7 @@ tb_int_t xm_io_file_flush(lua_State* lua) xm_io_file* file = xm_io_getfile(lua); if (xm_io_file_is_closed(file)) xm_io_file_error_closed(lua); - tb_bool_t succeed = xm_io_file_is_file(file) ? xm_io_file_flush(file) : xm_io_std_flush(file); + tb_bool_t succeed = xm_io_file_is_file(file) ? xm_io_file_flush_impl(file) : xm_io_std_flush_impl(file); if (!succeed) xm_io_file_error(lua, file, "failed to flush file"); lua_pushboolean(lua, tb_true); xm_io_file_success(); diff --git a/core/src/xmake/winos/ansi.c b/core/src/xmake/winos/ansi.c index 2c37753ab..8475af297 100644 --- a/core/src/xmake/winos/ansi.c +++ b/core/src/xmake/winos/ansi.c @@ -181,7 +181,7 @@ tb_int_t xm_winos_mbstoutf8(lua_State* lua) cp = (tb_int_t)lcp; for (tb_int_t i = 2; i <= n; i++) { - tb_size_t mbslen = 0; + size_t mbslen = 0; tb_char_t const* mbs = lua_tolstring(lua, i, &mbslen); tb_size_t utf8size = (mbslen + 1) * 4; tb_char_t* utf8 = tb_malloc_cstr(utf8size); |
