Commit graph

19 commits

Author SHA1 Message Date
Kim Alvefur
dff4beae02 util-src: Remove Lua 5.1 compat macros
Part of #1600
2022-07-01 21:21:21 +02:00
Matthew Wild
b9a670dace util.ringbuffer: Ensure unsigned chars are always returned from :byte() 2020-06-24 12:34:20 +01:00
Kim Alvefur
625ec0a93f util-src: Use the luaL_pushfail API added in Lua 5.4 to highlight all failure conditions
Actually just an alias of pushnil, but it does make it more obvious
where the failure conditions are, which is good for readability.
2020-06-07 02:25:56 +02:00
Matthew Wild
14a436817d util.ringbuffer: Add :sub() and :byte() methods equivalent to the string methods 2020-06-04 15:19:20 +01:00
Kim Alvefur
4bab7af07d util.ringbuffer: Prevent creation of buffer with negative size
Previously this would have been (unsigned)-1 which is a large positive
integer.
2020-06-04 16:11:08 +02:00
Kim Alvefur
0bb1474ce6 util.ringbuffer: Prevent creation of zero-size buffer 2020-05-29 18:11:42 +02:00
Emmanuel Gil Peyrot
a149dda0e3 util.*.c: Add static qualifiers everywhere 2019-12-01 20:25:20 +01:00
Kim Alvefur
1eb7584483 util.ringbuffer: Fix typo in comment [codespell] 2018-04-06 22:26:53 +02:00
Kim Alvefur
28ba10b6b4 util.ringbuffer: Add method for discarding buffered data without returning it to lua 2018-02-24 14:45:06 +01:00
Kim Alvefur
a92cdf75b1 util.ringbuffer: Add various comments 2018-02-24 14:44:46 +01:00
Kim Alvefur
384687ffa4 util-src: Specify size of various tables to be allocated 2017-03-09 01:20:59 +01:00
Kim Alvefur
2246bd21b5 util.ringbuffer: Change types of length related variables to size_t [-Wsign-compare] 2017-03-02 19:22:07 +01:00
Kim Alvefur
40d8e257d8 util-src/*.c: Attach pointer * to name instead of type 2017-02-12 16:42:29 +01:00
Kim Alvefur
3e41ed8099 util.ringbuffer: Remove address of buffer itself from __tostring since is now in the same struct 2017-02-12 15:51:32 +01:00
Kim Alvefur
0d28378a7a util-src/*.c: Squeeze repeated blank lines 2017-01-23 18:33:35 +01:00
Kim Alvefur
c8e4e17b46 util.ringbuffer: Allocate buffer itself as part of userdata (simpler, single allocation, no need for __gc) 2017-01-22 09:23:10 +01:00
Kim Alvefur
26d03a9a1a util.ringbuffer: Remove unused macros 2017-01-22 04:05:41 +01:00
Kim Alvefur
5b10d245e3 util-src: Make C modules assert that the Lua runtime matches what it was compiled for 2017-01-08 14:21:08 +01:00
Kim Alvefur
ea0373f3ad Add util.ringbuffer, a ringbuffer with a file handle like interface 2016-02-02 20:24:27 +01:00