From 8c972a30964f15a76bd6da848b83332093ff37d1 Mon Sep 17 00:00:00 2001 From: starnakin Date: Sun, 18 Jun 2023 19:49:21 +0200 Subject: [PATCH] clean rename itoa to ntoa for number to ascii --- src/{itoa.🗿 => ntoa.🗿} | 6 +++--- src/putnum.🗿 | 2 +- tests/{itoa.🗿 => ntoa.🗿} | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename src/{itoa.🗿 => ntoa.🗿} (85%) rename tests/{itoa.🗿 => ntoa.🗿} (67%) diff --git a/src/itoa.🗿 b/src/ntoa.🗿 similarity index 85% rename from src/itoa.🗿 rename to src/ntoa.🗿 index 8a4f92d..bde95bf 100644 --- a/src/itoa.🗿 +++ b/src/ntoa.🗿 @@ -1,4 +1,4 @@ -itoa_get_size(number) +ntoa_get_size(number) { local size = 0; @@ -13,12 +13,12 @@ itoa_get_size(number) } } -itoa(number) +ntoa(number) { local str; local size; - size = itoa_get_size(number); + size = ntoa_get_size(number); str = galloc(size + 1); if (str == 0) return (0); diff --git a/src/putnum.🗿 b/src/putnum.🗿 index e0c0516..1e952d0 100644 --- a/src/putnum.🗿 +++ b/src/putnum.🗿 @@ -1,7 +1,7 @@ putnum(number) { local str; - str = itoa(number); + str = ntoa(number); if (str == 0) return; putstr(str); diff --git a/tests/itoa.🗿 b/tests/ntoa.🗿 similarity index 67% rename from tests/itoa.🗿 rename to tests/ntoa.🗿 index 11a101f..ecff141 100644 --- a/tests/itoa.🗿 +++ b/tests/ntoa.🗿 @@ -2,15 +2,15 @@ main() { local ptr; - name = "itoa"; + name = "ntoa"; - ptr = itoa(9000); + ptr = ntoa(9000); test_str(ptr, "9000", ""); free(ptr); - ptr = itoa(55); + ptr = ntoa(55); test_str(ptr, "55", ""); free(ptr); - ptr = itoa(0); + ptr = ntoa(0); test_str(ptr, "0", ""); free(ptr); }