From d16b2ca8d18ab8ae3c289df913f6230759a5d01d Mon Sep 17 00:00:00 2001 From: Luhrel Date: Tue, 3 Mar 2020 00:19:14 +0100 Subject: [PATCH] Fix fprintf arg types --- src/rt/profilegc.d | 4 ++-- src/rt/trace.d | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rt/profilegc.d b/src/rt/profilegc.d index 182d6b8242..3f15a76649 100644 --- a/src/rt/profilegc.d +++ b/src/rt/profilegc.d @@ -159,12 +159,12 @@ shared static ~this() { fprintf(fp, "%15llu\t%15llu\t%8.*s\n", cast(ulong)c.entry.size, cast(ulong)c.entry.count, - c.name.length, c.name.ptr); + cast(int) c.name.length, c.name.ptr); } if (logfilename.length) fclose(fp); } else - fprintf(stderr, "cannot write profilegc log file '%.*s'", logfilename.length, logfilename.ptr); + fprintf(stderr, "cannot write profilegc log file '%.*s'", cast(int) logfilename.length, logfilename.ptr); } } diff --git a/src/rt/trace.d b/src/rt/trace.d index 0a37d39fa7..0b7f32c1a0 100644 --- a/src/rt/trace.d +++ b/src/rt/trace.d @@ -176,7 +176,7 @@ private void trace_place(FILE* fpdef, Symbol* s, ulong count) if (!(s.Sflags & SFvisited)) { //printf("\t%.*s\t%llu\n", s.Sident.length, s.Sident.ptr, count); - fprintf(fpdef,"\t%.*s\n", s.Sident.length, s.Sident.ptr); + fprintf(fpdef,"\t%.*s\n", cast(int) s.Sident.length, s.Sident.ptr); s.Sflags |= SFvisited; // Compute number of items in array @@ -240,13 +240,13 @@ private size_t trace_report(FILE* fplog, Symbol* s) ulong count = 0; for (auto sp = s.Sfanin; sp; sp = sp.next) { - fprintf(fplog,"\t%5llu\t%.*s\n", sp.count, sp.sym.Sident.length, sp.sym.Sident.ptr); + fprintf(fplog,"\t%5llu\t%.*s\n", sp.count, cast(int) sp.sym.Sident.length, sp.sym.Sident.ptr); count += sp.count; } - fprintf(fplog,"%.*s\t%llu\t%lld\t%lld\n", s.Sident.length, s.Sident.ptr, count, s.totaltime, s.functime); + fprintf(fplog,"%.*s\t%llu\t%lld\t%lld\n", cast(int) s.Sident.length, s.Sident.ptr, count, s.totaltime, s.functime); for (auto sp = s.Sfanout; sp; sp = sp.next) { - fprintf(fplog,"\t%5llu\t%.*s\n", sp.count, sp.sym.Sident.length, sp.sym.Sident.ptr); + fprintf(fplog,"\t%5llu\t%.*s\n", sp.count, cast(int) sp.sym.Sident.length, sp.sym.Sident.ptr); } s = s.Sr; } @@ -330,7 +330,7 @@ private void trace_times(FILE* fplog, Symbol*[] psymbols) pl = s.functime / calls / time_scale; fprintf(fplog,"%7llu%12lld%12lld%12lld %.*s\n", - calls, tl, fl, pl, id.length, id.ptr); + calls, tl, fl, pl, cast(int) id.length, id.ptr); } }