summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-05-18 14:42:02 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-05-18 14:42:02 +0900
commitb38f133c70c44bac724c7085d59b4fca510855fb (patch)
treed3f5cddbbfd6b5fefecca260bb8fdbc695ae75bf
parent95626e3a9c59cd073221c08ed013ed0f2d655b6f (diff)
Constify `memory_xor` and `memory_not`
-rw-r--r--io_buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_buffer.c b/io_buffer.c
index dca30f362f..6bd0b3cfd3 100644
--- a/io_buffer.c
+++ b/io_buffer.c
@@ -3481,7 +3481,7 @@ io_buffer_or(VALUE self, VALUE mask)
}
static void
-memory_xor(unsigned char * restrict output, unsigned char * restrict base, size_t size, unsigned char * restrict mask, size_t mask_size)
+memory_xor(unsigned char * restrict output, const unsigned char * restrict base, size_t size, const unsigned char * restrict mask, size_t mask_size)
{
for (size_t offset = 0; offset < size; offset += 1) {
output[offset] = base[offset] ^ mask[offset % mask_size];
@@ -3521,7 +3521,7 @@ io_buffer_xor(VALUE self, VALUE mask)
}
static void
-memory_not(unsigned char * restrict output, unsigned char * restrict base, size_t size)
+memory_not(unsigned char * restrict output, const unsigned char * restrict base, size_t size)
{
for (size_t offset = 0; offset < size; offset += 1) {
output[offset] = ~base[offset];