Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/core/internal/dassert.d
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@ private string miniFormat(V)(const ref V v)
else static if (__traits(isFloating, V))
{
char[60] val;
const len = sprintf(&val[0], "%g", v);
int len;
static if (is(V == cfloat) || is(V == cdouble))
len = sprintf(&val[0], "%g + %gi", v.re, v.im);
else static if (is(V == creal))
len = sprintf(&val[0], "%Lg + %Lgi", v.re, v.im);
else static if (is(V == real) || is(V == ireal))
len = sprintf(&val[0], "%Lg", v);
else
len = sprintf(&val[0], "%g", v);
return val.idup[0 .. len];
}
// special-handling for void-arrays
Expand Down
2 changes: 1 addition & 1 deletion src/gc/impl/conservative/gc.d
Original file line number Diff line number Diff line change
Expand Up @@ -4023,7 +4023,7 @@ debug(PRINTF_TO_FILE)
gcStartTick = MonoTime.currTime;
immutable timeElapsed = MonoTime.currTime - gcStartTick;
immutable secondsAsDouble = timeElapsed.total!"hnsecs" / cast(double)convert!("seconds", "hnsecs")(1);
len = fprintf(gcx_fh, "%10.6lf: ", secondsAsDouble);
len = fprintf(gcx_fh, "%10.6f: ", secondsAsDouble);
}
len += fprintf(gcx_fh, fmt, args);
fflush(gcx_fh);
Expand Down