From 81f89a65b1451babd9a91f8f7ef4ad580d0ca4ae Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Mon, 24 Jan 2022 01:42:34 +0500 Subject: [PATCH] Rename const "KERNAUX_ITOA_BUFFER_SIZE" to "KERNAUX_ITOA10_BUFFER_SIZE" --- ChangeLog | 2 ++ include/kernaux/ntoa.h | 2 +- pkgs/ruby/ext/default/ntoa.c | 4 ++-- tests/test_ntoa.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4e0643..36980d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * include/kernaux/assert.h: Require semicolon after macros * include/kernaux/libc.h: Add funcs "atoi", "isdigit", "isspace" + * include/kernaux/ntoa.h: Rename const "KERNAUX_ITOA_BUFFER_SIZE" to + "KERNAUX_ITOA10_BUFFER_SIZE" 2022-01-22 Alex Kotov diff --git a/include/kernaux/ntoa.h b/include/kernaux/ntoa.h index a163ffa..665946f 100644 --- a/include/kernaux/ntoa.h +++ b/include/kernaux/ntoa.h @@ -9,7 +9,7 @@ extern "C" { // uint64_t: "18446744073709551615" // int64_t: "-9223372036854775808" -#define KERNAUX_ITOA_BUFFER_SIZE 21 +#define KERNAUX_ITOA10_BUFFER_SIZE 21 void kernaux_utoa10(uint64_t value, char *buffer); void kernaux_itoa10(int64_t value, char *buffer); diff --git a/pkgs/ruby/ext/default/ntoa.c b/pkgs/ruby/ext/default/ntoa.c index 0d545a0..4a808a5 100644 --- a/pkgs/ruby/ext/default/ntoa.c +++ b/pkgs/ruby/ext/default/ntoa.c @@ -35,7 +35,7 @@ VALUE rb_KernAux_utoa10( if (rb_funcall(number_rb, rb_intern_LESS, 1, INT2FIX(0))) { rb_raise(rb_eRangeError, "can't convert negative number to uint64_t"); } - char buffer[KERNAUX_ITOA_BUFFER_SIZE]; + char buffer[KERNAUX_ITOA10_BUFFER_SIZE]; kernaux_utoa10(NUM2ULL(number_rb), buffer); return rb_funcall(rb_str_new2(buffer), rb_intern_freeze, 0); } @@ -47,7 +47,7 @@ VALUE rb_KernAux_itoa10( const VALUE number_rb ) { RB_INTEGER_TYPE_P(number_rb); - char buffer[KERNAUX_ITOA_BUFFER_SIZE]; + char buffer[KERNAUX_ITOA10_BUFFER_SIZE]; kernaux_itoa10(NUM2LL(number_rb), buffer); return rb_funcall(rb_str_new2(buffer), rb_intern_freeze, 0); } diff --git a/tests/test_ntoa.c b/tests/test_ntoa.c index ace5ff3..4ad9c06 100644 --- a/tests/test_ntoa.c +++ b/tests/test_ntoa.c @@ -96,7 +96,7 @@ static const struct { int main() { - char buffer[KERNAUX_ITOA_BUFFER_SIZE]; + char buffer[KERNAUX_ITOA10_BUFFER_SIZE]; for ( size_t index = 0;