mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
short C names deprecated (itoa, ftoa), C reimplementations of atoi and atof deprecated as parse_int() and parse_f64() are preferable
This commit is contained in:
@@ -36,3 +36,27 @@ append_u128 :: proc(buf: []byte, u: u128, base: int) -> string {
|
||||
append_float :: proc(buf: []byte, f: f64, fmt: byte, prec, bit_size: int) -> string {
|
||||
return write_float(buf, f, fmt, prec, bit_size)
|
||||
}
|
||||
|
||||
// 2025-10-03 Deprecated C short names and implementations
|
||||
|
||||
@(deprecated="Use int_to_string instead")
|
||||
itoa :: proc(buf: []byte, i: int) -> string {
|
||||
return write_int(buf, i64(i), 10)
|
||||
}
|
||||
|
||||
@(deprecated="Use strconv.parse_int() instead")
|
||||
atoi :: proc(s: string) -> int {
|
||||
v, _ := parse_int(s)
|
||||
return v
|
||||
}
|
||||
|
||||
@(deprecated="Use parse_f64() instead")
|
||||
atof :: proc(s: string) -> f64 {
|
||||
v, _ := parse_f64(s)
|
||||
return v
|
||||
}
|
||||
|
||||
@(deprecated="Use 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))
|
||||
}
|
||||
Reference in New Issue
Block a user