Mercurial > illumos > illumos-gate
changeset 13601:6f468bfaefd3
1694 Add type-aware print() action (fix lint)
author | Richard Lowe <richlowe@richlowe.net> |
---|---|
date | Wed, 08 Feb 2012 03:43:14 +0000 |
parents | 45e723c4523d |
children | be505a6a00b0 |
files | usr/src/lib/libdtrace/common/dt_print.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/lib/libdtrace/common/dt_print.c Tue Feb 07 18:19:45 2012 -0500 +++ b/usr/src/lib/libdtrace/common/dt_print.c Wed Feb 08 03:43:14 2012 +0000 @@ -200,13 +200,16 @@ (void) fprintf(fp, "%#x", *(uint8_t *)addr); break; case sizeof (uint16_t): + /* LINTED - alignment */ (void) fprintf(fp, "%#x", *(uint16_t *)addr); break; case sizeof (uint32_t): + /* LINTED - alignment */ (void) fprintf(fp, "%#x", *(uint32_t *)addr); break; case sizeof (uint64_t): (void) fprintf(fp, "%#llx", + /* LINTED - alignment */ (unsigned long long)*(uint64_t *)addr); break; default: @@ -283,12 +286,15 @@ if (ctf_type_encoding(ctfp, base, &e) == 0) { if (e.cte_format == CTF_FP_SINGLE && e.cte_bits == sizeof (float) * NBBY) { + /* LINTED - alignment */ (void) fprintf(fp, "%+.7e", *((float *)addr)); } else if (e.cte_format == CTF_FP_DOUBLE && e.cte_bits == sizeof (double) * NBBY) { + /* LINTED - alignment */ (void) fprintf(fp, "%+.7e", *((double *)addr)); } else if (e.cte_format == CTF_FP_LDOUBLE && e.cte_bits == sizeof (long double) * NBBY) { + /* LINTED - alignment */ (void) fprintf(fp, "%+.16LE", *((long double *)addr)); } else { (void) fprintf(fp, "<unknown encoding>");