breaking change: arrays of char do not convert to cstring; ptr to array of char does
This commit is contained in:
parent
db0d353281
commit
3308d26581
12 changed files with 73 additions and 36 deletions
|
|
@ -1890,11 +1890,17 @@ proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
|
|||
frmtstr[3] = '*'
|
||||
frmtstr[4] = floatFormatToChar[format]
|
||||
frmtstr[5] = '\0'
|
||||
L = c_sprintf(buf, frmtstr, precision, f)
|
||||
when defined(nimNoArrayToCstringConversion):
|
||||
L = c_sprintf(addr buf, addr frmtstr, precision, f)
|
||||
else:
|
||||
L = c_sprintf(buf, frmtstr, precision, f)
|
||||
else:
|
||||
frmtstr[1] = floatFormatToChar[format]
|
||||
frmtstr[2] = '\0'
|
||||
L = c_sprintf(buf, frmtstr, f)
|
||||
when defined(nimNoArrayToCstringConversion):
|
||||
L = c_sprintf(addr buf, addr frmtstr, f)
|
||||
else:
|
||||
L = c_sprintf(buf, frmtstr, f)
|
||||
result = newString(L)
|
||||
for i in 0 ..< L:
|
||||
# Depending on the locale either dot or comma is produced,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue