mirror of
https://github.com/par274/sharpemu.git
synced 2026-09-01 22:31:17 +08:00
[libc] use C locale for printf
This commit is contained in:
@@ -3989,7 +3989,7 @@ public static class KernelMemoryCompatExports
|
|||||||
_ => unchecked((int)argumentSource.NextGpArg())
|
_ => unchecked((int)argumentSource.NextGpArg())
|
||||||
};
|
};
|
||||||
|
|
||||||
var formatted = value.ToString();
|
var formatted = value.ToString(CultureInfo.InvariantCulture);
|
||||||
if (showSign && value >= 0)
|
if (showSign && value >= 0)
|
||||||
formatted = "+" + formatted;
|
formatted = "+" + formatted;
|
||||||
else if (spaceForSign && value >= 0)
|
else if (spaceForSign && value >= 0)
|
||||||
@@ -4013,7 +4013,7 @@ public static class KernelMemoryCompatExports
|
|||||||
_ => (uint)argumentSource.NextGpArg()
|
_ => (uint)argumentSource.NextGpArg()
|
||||||
};
|
};
|
||||||
|
|
||||||
var formatted = value.ToString();
|
var formatted = value.ToString(CultureInfo.InvariantCulture);
|
||||||
sb.Append(PadString(formatted, width, leftAlign, padWithZero && !leftAlign));
|
sb.Append(PadString(formatted, width, leftAlign, padWithZero && !leftAlign));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -4034,8 +4034,8 @@ public static class KernelMemoryCompatExports
|
|||||||
};
|
};
|
||||||
|
|
||||||
var formatted = specifier == 'x'
|
var formatted = specifier == 'x'
|
||||||
? value.ToString("x")
|
? value.ToString("x", CultureInfo.InvariantCulture)
|
||||||
: value.ToString("X");
|
: value.ToString("X", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
if (alternateForm && value != 0)
|
if (alternateForm && value != 0)
|
||||||
formatted = specifier == 'x' ? "0x" + formatted : "0X" + formatted;
|
formatted = specifier == 'x' ? "0x" + formatted : "0X" + formatted;
|
||||||
@@ -4143,7 +4143,10 @@ public static class KernelMemoryCompatExports
|
|||||||
var formatStr = precision >= 0
|
var formatStr = precision >= 0
|
||||||
? $"{{0:{specifier}{precision}}}"
|
? $"{{0:{specifier}{precision}}}"
|
||||||
: $"{{0:{specifier}}}";
|
: $"{{0:{specifier}}}";
|
||||||
var formatted = string.Format(formatStr, value);
|
var formatted = string.Format(
|
||||||
|
CultureInfo.InvariantCulture,
|
||||||
|
formatStr,
|
||||||
|
value);
|
||||||
|
|
||||||
if (showSign && value >= 0)
|
if (showSign && value >= 0)
|
||||||
formatted = "+" + formatted;
|
formatted = "+" + formatted;
|
||||||
|
|||||||
Reference in New Issue
Block a user