From 2af3f280bf232274d8f5aa32b7f3ded53e0b5061 Mon Sep 17 00:00:00 2001 From: samwega Date: Fri, 3 Oct 2025 21:14:00 +0300 Subject: [PATCH] Tetralux asked for int_tostring() to also be deprecated, use write_int() instead. --- core/strconv/deprecated.odin | 6 +++--- core/strconv/strconv.odin | 29 ----------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/core/strconv/deprecated.odin b/core/strconv/deprecated.odin index 20cd2642e..c644d331e 100644 --- a/core/strconv/deprecated.odin +++ b/core/strconv/deprecated.odin @@ -39,7 +39,7 @@ append_float :: proc(buf: []byte, f: f64, fmt: byte, prec, bit_size: int) -> str // 2025-10-03 Deprecated C short names and implementations -@(deprecated="Use int_to_string instead") +@(deprecated="Use strconv.write_int() instead") itoa :: proc(buf: []byte, i: int) -> string { return write_int(buf, i64(i), 10) } @@ -50,13 +50,13 @@ atoi :: proc(s: string) -> int { return v } -@(deprecated="Use parse_f64() instead") +@(deprecated="Use strconv.parse_f64() instead") atof :: proc(s: string) -> f64 { v, _ := parse_f64(s) return v } -@(deprecated="Use write_float instead") +@(deprecated="Use strconv.write_float() instead") ftoa :: proc(buf: []byte, f: f64, fmt: byte, prec, bit_size: int) -> string { return string(generic_ftoa(buf, f, fmt, prec, bit_size)) } \ No newline at end of file diff --git a/core/strconv/strconv.odin b/core/strconv/strconv.odin index e7de67c42..8680542ee 100644 --- a/core/strconv/strconv.odin +++ b/core/strconv/strconv.odin @@ -1546,35 +1546,6 @@ write_u128 :: proc(buf: []byte, u: u128, base: int) -> string { return write_bits_128(buf, u, base, false, 8*size_of(uint), digits, nil) } -/* -`itoa` C name deprecated, use `int_to_string` instead (same procedure) - -Converts an integer value to a string and stores it in the given buffer - -**Inputs** -- buf: The buffer to store the resulting string -- i: The integer value to be converted - -Example: - - import "core:fmt" - import "core:strconv" - int_to_string_example :: proc() { - buf: [4]byte - result := strconv.int_to_string(buf[:], 42) - fmt.println(result, buf) // "42" - } - -Output: - - 42 [52, 50, 0, 0] - -**Returns** -- The resulting string after converting the integer value -*/ -int_to_string :: proc(buf: []byte, i: int) -> string { - return write_int(buf, i64(i), 10) -} /* `ftoa` C name deprecated, use `int_to_string` instead (same procedure)