diff options
| author | ruki <[email protected]> | 2024-05-07 22:53:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-05-07 22:53:48 +0800 |
| commit | 4993257915d77923aebcf43a7e89a365b424f878 (patch) | |
| tree | 5aa75f0fe1ba949828f04c75dab0d8f253393fb4 | |
| parent | 0cd37097f6487066c7250106cfe25f06130ab4f6 (diff) | |
fix assert for x86
| -rw-r--r-- | core/src/xmake/base64/encode.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/bloom_filter/bloom_filter_data_set.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/hash/md5.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/hash/sha.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/hash/xxhash.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/file_write.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/pipe_read.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/pipe_write.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/socket_recv.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/socket_recvfrom.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/socket_send.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/io/socket_sendto.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/block_compress.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/block_decompress.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/compress.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/compress_stream_read.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/compress_stream_write.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/decompress.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/decompress_stream_read.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/lz4/decompress_stream_write.c | 2 |
20 files changed, 20 insertions, 20 deletions
diff --git a/core/src/xmake/base64/encode.c b/core/src/xmake/base64/encode.c index 8bb4d8be3..acf0b7c25 100644 --- a/core/src/xmake/base64/encode.c +++ b/core/src/xmake/base64/encode.c @@ -49,7 +49,7 @@ tb_int_t xm_base64_encode(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // encode it tb_char_t buff[8192]; diff --git a/core/src/xmake/bloom_filter/bloom_filter_data_set.c b/core/src/xmake/bloom_filter/bloom_filter_data_set.c index cbf1cafda..6de4a5d4a 100644 --- a/core/src/xmake/bloom_filter/bloom_filter_data_set.c +++ b/core/src/xmake/bloom_filter/bloom_filter_data_set.c @@ -57,7 +57,7 @@ tb_int_t xm_bloom_filter_data_set(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // set data tb_bool_t ok = tb_bloom_filter_data_set(filter, data, size); diff --git a/core/src/xmake/hash/md5.c b/core/src/xmake/hash/md5.c index d24ca7e53..c9ec2fb36 100644 --- a/core/src/xmake/hash/md5.c +++ b/core/src/xmake/hash/md5.c @@ -49,7 +49,7 @@ tb_int_t xm_hash_md5(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // compute md5 tb_byte_t buffer[16]; diff --git a/core/src/xmake/hash/sha.c b/core/src/xmake/hash/sha.c index a4c0356fb..720647cdf 100644 --- a/core/src/xmake/hash/sha.c +++ b/core/src/xmake/hash/sha.c @@ -52,7 +52,7 @@ tb_int_t xm_hash_sha(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // compute sha tb_sha_t sha; diff --git a/core/src/xmake/hash/xxhash.c b/core/src/xmake/hash/xxhash.c index 232e9c2f8..12dd3ba10 100644 --- a/core/src/xmake/hash/xxhash.c +++ b/core/src/xmake/hash/xxhash.c @@ -54,7 +54,6 @@ tb_int_t xm_hash_xxhash(lua_State* lua) // is bytes? get data and size if (xm_lua_isinteger(lua, 2) && xm_lua_isinteger(lua, 3)) { - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); tb_byte_t const* data = (tb_byte_t const*)(tb_size_t)(tb_long_t)lua_tointeger(lua, 2); tb_size_t size = (tb_size_t)lua_tointeger(lua, 3); if (!data || !size) @@ -63,6 +62,7 @@ tb_int_t xm_hash_xxhash(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // compuate hash tb_byte_t const* buffer; diff --git a/core/src/xmake/io/file_write.c b/core/src/xmake/io/file_write.c index d11cb0259..9411efc31 100644 --- a/core/src/xmake/io/file_write.c +++ b/core/src/xmake/io/file_write.c @@ -169,7 +169,7 @@ tb_int_t xm_io_file_write(lua_State* lua) if (xm_lua_isinteger(lua, -1)) data = (tb_byte_t const*)(tb_size_t)(tb_long_t)lua_tointeger(lua, -1); lua_pop(lua, 1); - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); lua_pushstring(lua, "size"); lua_gettable(lua, i); diff --git a/core/src/xmake/io/pipe_read.c b/core/src/xmake/io/pipe_read.c index 76b245ff8..9644e9e14 100644 --- a/core/src/xmake/io/pipe_read.c +++ b/core/src/xmake/io/pipe_read.c @@ -62,7 +62,7 @@ tb_int_t xm_io_pipe_read(lua_State* lua) lua_pushfstring(lua, "invalid data(%p)!", data); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get size tb_long_t size = 0; diff --git a/core/src/xmake/io/pipe_write.c b/core/src/xmake/io/pipe_write.c index 6089c5807..847e57544 100644 --- a/core/src/xmake/io/pipe_write.c +++ b/core/src/xmake/io/pipe_write.c @@ -63,7 +63,7 @@ tb_int_t xm_io_pipe_write(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // write data tb_long_t real = tb_pipe_file_write(pipefile, data, size); diff --git a/core/src/xmake/io/socket_recv.c b/core/src/xmake/io/socket_recv.c index 71113b6f2..efe8f9612 100644 --- a/core/src/xmake/io/socket_recv.c +++ b/core/src/xmake/io/socket_recv.c @@ -62,7 +62,7 @@ tb_int_t xm_io_socket_recv(lua_State* lua) lua_pushfstring(lua, "invalid data(%p)!", data); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get size tb_long_t size = 0; diff --git a/core/src/xmake/io/socket_recvfrom.c b/core/src/xmake/io/socket_recvfrom.c index 9ca9da239..cec34847e 100644 --- a/core/src/xmake/io/socket_recvfrom.c +++ b/core/src/xmake/io/socket_recvfrom.c @@ -62,7 +62,7 @@ tb_int_t xm_io_socket_recvfrom(lua_State* lua) lua_pushfstring(lua, "invalid data(%p)!", data); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get size tb_long_t size = 0; diff --git a/core/src/xmake/io/socket_send.c b/core/src/xmake/io/socket_send.c index 4efc7cde6..0f8656c6c 100644 --- a/core/src/xmake/io/socket_send.c +++ b/core/src/xmake/io/socket_send.c @@ -63,7 +63,7 @@ tb_int_t xm_io_socket_send(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // send data tb_long_t real = tb_socket_send(sock, data, size); diff --git a/core/src/xmake/io/socket_sendto.c b/core/src/xmake/io/socket_sendto.c index ad1a09856..cd236cdcf 100644 --- a/core/src/xmake/io/socket_sendto.c +++ b/core/src/xmake/io/socket_sendto.c @@ -63,7 +63,7 @@ tb_int_t xm_io_socket_sendto(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get address tb_char_t const* addr = lua_tostring(lua, 4); diff --git a/core/src/xmake/lz4/block_compress.c b/core/src/xmake/lz4/block_compress.c index 1748e9cdf..36238ff8b 100644 --- a/core/src/xmake/lz4/block_compress.c +++ b/core/src/xmake/lz4/block_compress.c @@ -49,7 +49,7 @@ tb_int_t xm_lz4_block_compress(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // do compress tb_bool_t ok = tb_false; diff --git a/core/src/xmake/lz4/block_decompress.c b/core/src/xmake/lz4/block_decompress.c index 713e4c4ec..23795f003 100644 --- a/core/src/xmake/lz4/block_decompress.c +++ b/core/src/xmake/lz4/block_decompress.c @@ -49,7 +49,7 @@ tb_int_t xm_lz4_block_decompress(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get real size tb_int_t real = (tb_int_t)lua_tointeger(lua, 3); diff --git a/core/src/xmake/lz4/compress.c b/core/src/xmake/lz4/compress.c index daeef656d..770612831 100644 --- a/core/src/xmake/lz4/compress.c +++ b/core/src/xmake/lz4/compress.c @@ -49,7 +49,7 @@ tb_int_t xm_lz4_compress(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // do compress tb_bool_t ok = tb_false; diff --git a/core/src/xmake/lz4/compress_stream_read.c b/core/src/xmake/lz4/compress_stream_read.c index f9b9e7f13..9cf665921 100644 --- a/core/src/xmake/lz4/compress_stream_read.c +++ b/core/src/xmake/lz4/compress_stream_read.c @@ -61,7 +61,7 @@ tb_int_t xm_lz4_compress_stream_read(lua_State* lua) lua_pushfstring(lua, "invalid data(%p)!", data); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get size tb_long_t size = 0; diff --git a/core/src/xmake/lz4/compress_stream_write.c b/core/src/xmake/lz4/compress_stream_write.c index 5e588e1ab..2b467073d 100644 --- a/core/src/xmake/lz4/compress_stream_write.c +++ b/core/src/xmake/lz4/compress_stream_write.c @@ -62,7 +62,7 @@ tb_int_t xm_lz4_compress_stream_write(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // is end? tb_bool_t end = tb_false; diff --git a/core/src/xmake/lz4/decompress.c b/core/src/xmake/lz4/decompress.c index fd3a77543..1f979c16e 100644 --- a/core/src/xmake/lz4/decompress.c +++ b/core/src/xmake/lz4/decompress.c @@ -49,7 +49,7 @@ tb_int_t xm_lz4_decompress(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // do decompress tb_bool_t ok = tb_false; diff --git a/core/src/xmake/lz4/decompress_stream_read.c b/core/src/xmake/lz4/decompress_stream_read.c index bb9f8306d..75eda17e9 100644 --- a/core/src/xmake/lz4/decompress_stream_read.c +++ b/core/src/xmake/lz4/decompress_stream_read.c @@ -61,7 +61,7 @@ tb_int_t xm_lz4_decompress_stream_read(lua_State* lua) lua_pushfstring(lua, "invalid data(%p)!", data); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // get size tb_long_t size = 0; diff --git a/core/src/xmake/lz4/decompress_stream_write.c b/core/src/xmake/lz4/decompress_stream_write.c index 74fe0dae1..2f5e491a1 100644 --- a/core/src/xmake/lz4/decompress_stream_write.c +++ b/core/src/xmake/lz4/decompress_stream_write.c @@ -62,7 +62,7 @@ tb_int_t xm_lz4_decompress_stream_write(lua_State* lua) lua_pushfstring(lua, "invalid data(%p) and size(%d)!", data, (tb_int_t)size); return 2; } - tb_assert_static(sizeof(lua_Integer) == sizeof(tb_pointer_t)); + tb_assert_static(sizeof(lua_Integer) >= sizeof(tb_pointer_t)); // write data tb_long_t real = xm_lz4_dstream_write(stream, data, size, tb_false); |
