From 8ee52159f4f78cfd4b4a11d961c09e7680d7c13b Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 19 Jan 2022 15:35:02 +0500 Subject: [PATCH] Rename module "src/itoa.c" to "src/ntoa.c" --- .gitignore | 2 +- Makefile.am | 18 +++++++++--------- README.md | 4 ++-- configure.ac | 10 +++++----- include/Makefile.am | 6 +++--- include/kernaux.h | 2 +- include/kernaux/{itoa.h => ntoa.h} | 4 ++-- src/{itoa.c => ntoa.c} | 2 +- src/printf.c | 2 +- src/units.c | 2 +- tests/{test_itoa.c => test_ntoa.c} | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) rename include/kernaux/{itoa.h => ntoa.h} (83%) rename src/{itoa.c => ntoa.c} (95%) rename tests/{test_itoa.c => test_ntoa.c} (99%) diff --git a/.gitignore b/.gitignore index b408d1d..c796f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -100,7 +100,6 @@ /tests/multiboot2_info_print2 /tests/test_cmdline /tests/test_elf -/tests/test_itoa /tests/test_mbr /tests/test_multiboot2_header_helpers /tests/test_multiboot2_header_print @@ -108,6 +107,7 @@ /tests/test_multiboot2_info_helpers /tests/test_multiboot2_info_print /tests/test_multiboot2_info_validation +/tests/test_ntoa /tests/test_pfa /tests/test_pfa_assert /tests/test_printf diff --git a/Makefile.am b/Makefile.am index 06ede9a..0ab6ce3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,13 +58,6 @@ if WITH_FRAMEBUFFER libkernaux_a_SOURCES += src/framebuffer.c endif -if WITH_ITOA -libkernaux_a_SOURCES += src/itoa.c -if ENABLE_TESTS -TESTS += tests/test_itoa -endif -endif - if WITH_MBR libkernaux_a_SOURCES += src/mbr.c if ENABLE_TESTS @@ -97,6 +90,13 @@ noinst_PROGRAMS += \ endif endif +if WITH_NTOA +libkernaux_a_SOURCES += src/ntoa.c +if ENABLE_TESTS +TESTS += tests/test_ntoa +endif +endif + if WITH_PFA libkernaux_a_SOURCES += src/pfa.c if ENABLE_TESTS @@ -182,9 +182,9 @@ tests_test_elf_SOURCES = \ $(libkernaux_a_SOURCES) \ tests/test_elf.c -tests_test_itoa_SOURCES = \ +tests_test_ntoa_SOURCES = \ $(libkernaux_a_SOURCES) \ - tests/test_itoa.c + tests/test_ntoa.c tests_test_mbr_SOURCES = \ $(libkernaux_a_SOURCES) \ diff --git a/README.md b/README.md index 426bb81..e899e99 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ API * `memset` * `strcpy` * `strlen` - * [itoa replacement](/include/kernaux/itoa.h) *(work in progress)* + * [itoa/ftoa replacement](/include/kernaux/ntoa.h) *(work in progress)* * [printf replacement](/include/kernaux/printf.h) *(work in progress)* * [printf](/examples/printf.c) * [printf_va](/examples/printf_va.c) @@ -97,9 +97,9 @@ are some non-default options: * `--with[out]-console` * `--with[out]-elf` * `--with[out]-framebuffer` -* `--with[out]-itoa` * `--with[out]-mbr` * `--with[out]-multiboot2` +* `--with[out]-ntoa` * `--with[out]-printf` * `--with[out]-pfa` * `--with[out]-units` diff --git a/configure.ac b/configure.ac index 28a6330..003face 100644 --- a/configure.ac +++ b/configure.ac @@ -25,9 +25,9 @@ AC_ARG_WITH( [cmdline], AS_HELP_STRING([--without-cmdline], [without co AC_ARG_WITH( [console], AS_HELP_STRING([--without-console], [without serial console])) AC_ARG_WITH( [elf], AS_HELP_STRING([--without-elf], [without ELF utils])) AC_ARG_WITH( [framebuffer], AS_HELP_STRING([--without-framebuffer], [without framebuffer])) -AC_ARG_WITH( [itoa], AS_HELP_STRING([--without-itoa], [without itoa])) AC_ARG_WITH( [mbr], AS_HELP_STRING([--without-mbr], [without Master Boot Record])) AC_ARG_WITH( [multiboot2], AS_HELP_STRING([--without-multiboot2], [without Multiboot 2 information parser])) +AC_ARG_WITH( [ntoa], AS_HELP_STRING([--without-ntoa], [without itoa/ftoa])) AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Page Frame Allocator])) AC_ARG_WITH( [printf], AS_HELP_STRING([--without-printf], [without printf])) AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils])) @@ -59,8 +59,8 @@ AS_IF([test "$with_libc" = yes], do_with_libc) AS_IF([test "$host_cpu" != "$build_cpu" -a "$enable_tests" = yes], AC_MSG_ERROR([can not build cross-platform tests])) -AS_IF([test "$with_itoa" = no -a "$with_printf" != no], AC_MSG_ERROR([package `printf' requires package `itoa'])) -AS_IF([test "$with_itoa" = no -a "$with_units" != no], AC_MSG_ERROR([package `units' requires package `itoa'])) +AS_IF([test "$with_ntoa" = no -a "$with_printf" != no], AC_MSG_ERROR([package `printf' requires package `ntoa'])) +AS_IF([test "$with_ntoa" = no -a "$with_units" != no], AC_MSG_ERROR([package `units' requires package `ntoa'])) @@ -80,9 +80,9 @@ AM_CONDITIONAL([WITH_CMDLINE], [test "$with_cmdline" != no]) AM_CONDITIONAL([WITH_CONSOLE], [test "$with_console" != no]) AM_CONDITIONAL([WITH_ELF], [test "$with_elf" != no]) AM_CONDITIONAL([WITH_FRAMEBUFFER], [test "$with_framebuffer" != no]) -AM_CONDITIONAL([WITH_ITOA], [test "$with_itoa" != no]) AM_CONDITIONAL([WITH_MBR], [test "$with_mbr" != no]) AM_CONDITIONAL([WITH_MULTIBOOT2], [test "$with_multiboot2" != no]) +AM_CONDITIONAL([WITH_NTOA], [test "$with_ntoa" != no]) AM_CONDITIONAL([WITH_PFA], [test "$with_pfa" != no]) AM_CONDITIONAL([WITH_PRINTF], [test "$with_printf" != no]) AM_CONDITIONAL([WITH_UNITS], [test "$with_units" != no]) @@ -110,9 +110,9 @@ AS_IF([test "$with_cmdline" != no], [AC_DEFINE([WITH_CMDLINE], AS_IF([test "$with_console" != no], [AC_DEFINE([WITH_CONSOLE], [1], [with serial console])]) AS_IF([test "$with_elf" != no], [AC_DEFINE([WITH_ELF], [1], [with ELF utils])]) AS_IF([test "$with_framebuffer" != no], [AC_DEFINE([WITH_FRAMEBUFFER], [1], [with framebuffer])]) -AS_IF([test "$with_itoa" != no], [AC_DEFINE([WITH_ITOA], [1], [with itoa])]) AS_IF([test "$with_mbr" != no], [AC_DEFINE([WITH_MBR], [1], [with Master Boot Record])]) AS_IF([test "$with_multiboot2" != no], [AC_DEFINE([WITH_MULTIBOOT2], [1], [with Multiboot 2 information parser])]) +AS_IF([test "$with_ntoa" != no], [AC_DEFINE([WITH_NTOA], [1], [with ntoa])]) AS_IF([test "$with_pfa" != no], [AC_DEFINE([WITH_PFA], [1], [with Page Frame Allocator])]) AS_IF([test "$with_printf" != no], [AC_DEFINE([WITH_PRINTF], [1], [with printf])]) AS_IF([test "$with_units", != no], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])]) diff --git a/include/Makefile.am b/include/Makefile.am index 7757915..5700e1f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,15 +31,15 @@ endif if WITH_FRAMEBUFFER nobase_include_HEADERS += kernaux/framebuffer.h endif -if WITH_ITOA -nobase_include_HEADERS += kernaux/itoa.h -endif if WITH_MBR nobase_include_HEADERS += kernaux/mbr.h endif if WITH_MULTIBOOT2 nobase_include_HEADERS += kernaux/multiboot2.h endif +if WITH_NTOA +nobase_include_HEADERS += kernaux/ntoa.h +endif if WITH_PFA nobase_include_HEADERS += kernaux/pfa.h endif diff --git a/include/kernaux.h b/include/kernaux.h index f1ba5eb..cab5c5a 100644 --- a/include/kernaux.h +++ b/include/kernaux.h @@ -11,9 +11,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/include/kernaux/itoa.h b/include/kernaux/ntoa.h similarity index 83% rename from include/kernaux/itoa.h rename to include/kernaux/ntoa.h index 41d96ae..a163ffa 100644 --- a/include/kernaux/itoa.h +++ b/include/kernaux/ntoa.h @@ -1,5 +1,5 @@ -#ifndef KERNAUX_INCLUDED_ITOA -#define KERNAUX_INCLUDED_ITOA +#ifndef KERNAUX_INCLUDED_NTOA +#define KERNAUX_INCLUDED_NTOA #ifdef __cplusplus extern "C" { diff --git a/src/itoa.c b/src/ntoa.c similarity index 95% rename from src/itoa.c rename to src/ntoa.c index 5cb2026..b615506 100644 --- a/src/itoa.c +++ b/src/ntoa.c @@ -2,7 +2,7 @@ #include "config.h" #endif -#include +#include void kernaux_utoa10(uint64_t value, char *buffer) { diff --git a/src/printf.c b/src/printf.c index 1f3f0e1..637d1f7 100644 --- a/src/printf.c +++ b/src/printf.c @@ -2,7 +2,7 @@ #include "config.h" #endif -#include +#include #include #include diff --git a/src/units.c b/src/units.c index 5e7586d..ea131bd 100644 --- a/src/units.c +++ b/src/units.c @@ -2,7 +2,7 @@ #include "config.h" #endif -#include +#include #include #include diff --git a/tests/test_itoa.c b/tests/test_ntoa.c similarity index 99% rename from tests/test_itoa.c rename to tests/test_ntoa.c index 98be956..ace5ff3 100644 --- a/tests/test_itoa.c +++ b/tests/test_ntoa.c @@ -2,7 +2,7 @@ #include "config.h" #endif -#include +#include #include #include