mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 05:30:33 +03:00
[dmd-cxx] printf format fixes
This commit is contained in:
parent
5ccd697c3f
commit
3061c451d2
5 changed files with 11 additions and 11 deletions
|
@ -5199,7 +5199,7 @@ body
|
|||
}
|
||||
debug (unformatRange) printf("\t");
|
||||
debug (unformatRange) if (!input.empty) printf("input.front = %c, ", input.front);
|
||||
debug (unformatRange) printf("cont = %.*s\n", cont);
|
||||
debug (unformatRange) printf("cont = %.*s\n", cast(int) cont.length, cont.ptr);
|
||||
|
||||
bool checkEnd()
|
||||
{
|
||||
|
@ -5246,7 +5246,7 @@ body
|
|||
auto sep = spec.sep !is null ? spec.sep
|
||||
: fmt.trailing;
|
||||
debug (unformatRange) {
|
||||
if (!sep.empty && !input.empty) printf("-> %c, sep = %.*s\n", input.front, sep);
|
||||
if (!sep.empty && !input.empty) printf("-> %c, sep = %.*s\n", input.front, cast(int) sep.length, sep.ptr);
|
||||
else printf("\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -2503,13 +2503,13 @@ pure nothrow
|
|||
void printBiguint(const uint [] data)
|
||||
{
|
||||
char [] buff = biguintToHex(new char[data.length*9], data, '_');
|
||||
printf("%.*s\n", buff.length, buff.ptr);
|
||||
printf("%.*s\n", cast(int) buff.length, buff.ptr);
|
||||
}
|
||||
|
||||
void printDecimalBigUint(BigUint data)
|
||||
{
|
||||
auto str = data.toDecimalString(0);
|
||||
printf("%.*s\n", str.length, str.ptr);
|
||||
printf("%.*s\n", cast(int) str.length, str.ptr);
|
||||
}
|
||||
|
||||
uint [] a, b;
|
||||
|
|
|
@ -246,8 +246,8 @@ version (unittest)
|
|||
alias real_t = double;
|
||||
else
|
||||
alias real_t = real;
|
||||
ix = sprintf(bufx.ptr, "%.*Lg", ndigits, cast(real_t) x);
|
||||
iy = sprintf(bufy.ptr, "%.*Lg", ndigits, cast(real_t) y);
|
||||
ix = sprintf(bufx.ptr, is(real_t == real) ? "%.*Lg" : "%.*g", ndigits, cast(real_t) x);
|
||||
iy = sprintf(bufy.ptr, is(real_t == real) ? "%.*Lg" : "%.*g", ndigits, cast(real_t) y);
|
||||
assert(ix < bufx.length && ix > 0);
|
||||
assert(ix < bufy.length && ix > 0);
|
||||
|
||||
|
|
|
@ -263,8 +263,8 @@ final class ArchiveMember
|
|||
{
|
||||
void print()
|
||||
{
|
||||
printf("name = '%.*s'\n", name.length, name.ptr);
|
||||
printf("\tcomment = '%.*s'\n", comment.length, comment.ptr);
|
||||
printf("name = '%.*s'\n", cast(int) name.length, name.ptr);
|
||||
printf("\tcomment = '%.*s'\n", cast(int) comment.length, comment.ptr);
|
||||
printf("\tmadeVersion = x%04x\n", _madeVersion);
|
||||
printf("\textractVersion = x%04x\n", extractVersion);
|
||||
printf("\tflags = x%04x\n", flags);
|
||||
|
@ -348,7 +348,7 @@ final class ZipArchive
|
|||
printf("\tdiskStartDir = %u\n", diskStartDir);
|
||||
printf("\tnumEntries = %u\n", numEntries);
|
||||
printf("\ttotalEntries = %u\n", totalEntries);
|
||||
printf("\tcomment = '%.*s'\n", comment.length, comment.ptr);
|
||||
printf("\tcomment = '%.*s'\n", cast(int) comment.length, comment.ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,9 +86,9 @@ int main(string[] args)
|
|||
assert(c.re == 2);
|
||||
assert(c.im == 1);
|
||||
|
||||
printf("args.length = %d\n", args.length);
|
||||
printf("args.length = %d\n", cast(int)args.length);
|
||||
for (int i = 0; i < args.length; i++)
|
||||
printf("args[%d] = '%.*s'\n", i, args[i].length, args[i].ptr);
|
||||
printf("args[%d] = '%.*s'\n", i, cast(int)args[i].length, args[i].ptr);
|
||||
|
||||
int[3] x;
|
||||
x[0] = 3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue