Skip to content

Commit

Permalink
Cast to long for %l in printf
Browse files Browse the repository at this point in the history
2012-02-02  H.J. Lu  <hongjiu.lu@intel.com>

	* count.c (call_summary_pers): Cast to long.
	* ipc.c (sys_mq_open): Likewise.
	(printmqattr): Likewise.
	* quota.c (decode_cmd_data): Likewise.
	* resource.c (sys_sysinfo): Likewise.
	* time.c (tprint_timex): Likewise.
  • Loading branch information
hjl-tools committed Feb 2, 2012
1 parent e8339c2 commit 2662ef7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.hjl
@@ -1,3 +1,12 @@
2012-02-02 H.J. Lu <hongjiu.lu@intel.com>

* count.c (call_summary_pers): Cast to long.
* ipc.c (sys_mq_open): Likewise.
(printmqattr): Likewise.
* quota.c (decode_cmd_data): Likewise.
* resource.c (sys_sysinfo): Likewise.
* time.c (tprint_timex): Likewise.

2012-02-02 H.J. Lu <hongjiu.lu@intel.com>

* syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only if
Expand Down
2 changes: 1 addition & 1 deletion count.c
Expand Up @@ -211,7 +211,7 @@ call_summary_pers(FILE *outf)
/ tv_float(&tv_cum));
fprintf(outf, "%6.2f %11.6f %11ld %9d %9.9s %s\n",
percent, tv_float(&counts[j].time),
(long) 1000000 * dtv.tv_sec + dtv.tv_usec,
(long) (1000000 * dtv.tv_sec + dtv.tv_usec),
counts[j].calls,
error_str, sysent[j].sys_name);
}
Expand Down
6 changes: 4 additions & 2 deletions ipc.c
Expand Up @@ -487,7 +487,8 @@ sys_mq_open(struct tcb *tcp)
tprintf("{ ??? }");
else
tprintf("{mq_maxmsg=%ld, mq_msgsize=%ld}",
attr.mq_maxmsg, attr.mq_msgsize);
(long) attr.mq_maxmsg,
(long) attr.mq_msgsize);
# endif
}
}
Expand Down Expand Up @@ -546,7 +547,8 @@ printmqattr(struct tcb *tcp, long addr)
tprintf("{mq_flags=");
tprint_open_modes(attr.mq_flags);
tprintf(", mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsg=%ld}",
attr.mq_maxmsg, attr.mq_msgsize, attr.mq_curmsgs);
(long) attr.mq_maxmsg, (long) attr.mq_msgsize,
(long) attr.mq_curmsgs);
# endif
}
}
Expand Down
8 changes: 4 additions & 4 deletions quota.c
Expand Up @@ -386,8 +386,8 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
tprintf("ihardlimit=%u, ", dq.dqb_ihardlimit);
tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit);
tprintf("curinodes=%u, ", dq.dqb_curinodes);
tprintf("btime=%lu, ", dq.dqb_btime);
tprintf("itime=%lu}", dq.dqb_itime);
tprintf("btime=%lu, ", (long) dq.dqb_btime);
tprintf("itime=%lu}", (long) dq.dqb_itime);
break;
}
case Q_V2_GETQUOTA:
Expand All @@ -411,8 +411,8 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
tprintf("bhardlimit=%u, ", dq.dqb_bhardlimit);
tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit);
tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
tprintf("btime=%lu, ", dq.dqb_btime);
tprintf("itime=%lu}", dq.dqb_itime);
tprintf("btime=%lu, ", (long) dq.dqb_btime);
tprintf("itime=%lu}", (long) dq.dqb_itime);
break;
}
case Q_XGETQUOTA:
Expand Down
11 changes: 6 additions & 5 deletions resource.c
Expand Up @@ -399,14 +399,15 @@ sys_sysinfo(struct tcb *tcp)
tprintf("{...}");
else {
tprintf("{uptime=%lu, loads=[%lu, %lu, %lu] ",
si.uptime, si.loads[0], si.loads[1],
si.loads[2]);
(long) si.uptime, (long) si.loads[0],
(long) si.loads[1], (long) si.loads[2]);
tprintf("totalram=%lu, freeram=%lu, ",
si.totalram, si.freeram);
(long) si.totalram, (long) si.freeram);
tprintf("sharedram=%lu, bufferram=%lu} ",
si.sharedram, si.bufferram);
(long) si.sharedram, (long) si.bufferram);
tprintf("totalswap=%lu, freeswap=%lu, procs=%hu}",
si.totalswap, si.freeswap, si.procs);
(long) si.totalswap, (long) si.freeswap,
si.procs);
}
}
return 0;
Expand Down
14 changes: 7 additions & 7 deletions time.c
Expand Up @@ -626,19 +626,19 @@ tprint_timex(struct tcb *tcp, long addr)
tprintf("{modes=");
printflags(adjtimex_modes, tx.modes, "ADJ_???");
tprintf(", offset=%ld, freq=%ld, maxerror=%ld, ",
tx.offset, tx.freq, tx.maxerror);
tprintf("esterror=%lu, status=", tx.esterror);
(long) tx.offset, (long) tx.freq, (long) tx.maxerror);
tprintf("esterror=%lu, status=", (long) tx.esterror);
printflags(adjtimex_status, tx.status, "STA_???");
tprintf(", constant=%ld, precision=%lu, ",
tx.constant, tx.precision);
tprintf("tolerance=%ld, time=", tx.tolerance);
(long) tx.constant, (long) tx.precision);
tprintf("tolerance=%ld, time=", (long) tx.tolerance);
tprint_timeval(tcp, &tx.time);
tprintf(", tick=%ld, ppsfreq=%ld, jitter=%ld",
tx.tick, tx.ppsfreq, tx.jitter);
(long) tx.tick, (long) tx.ppsfreq, (long) tx.jitter);
tprintf(", shift=%d, stabil=%ld, jitcnt=%ld",
tx.shift, tx.stabil, tx.jitcnt);
tx.shift, (long) tx.stabil, (long) tx.jitcnt);
tprintf(", calcnt=%ld, errcnt=%ld, stbcnt=%ld",
tx.calcnt, tx.errcnt, tx.stbcnt);
(long) tx.calcnt, (long) tx.errcnt, (long) tx.stbcnt);
#endif
tprintf("}");
return 0;
Expand Down

0 comments on commit 2662ef7

Please sign in to comment.