PERFORCE change 103958 for review
John Birrell
jb at FreeBSD.org
Tue Aug 15 02:41:05 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=103958
Change 103958 by jb at jb_freebsd2 on 2006/08/15 02:41:00
On Solaris this code has been linted so they are confident that the
compiler warnings can be ignored.
On FreeBSD I'd like to avoid compiler warnings.
Affected files ...
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/common/ctf/ctf_labels.c#2 edit
Differences ...
==== //depot/projects/dtrace/src/sys/contrib/opensolaris/common/ctf/ctf_labels.c#2 (text) ====
@@ -31,7 +31,12 @@
static int
extract_label_info(ctf_file_t *fp, const ctf_lblent_t **ctl, uint_t *num_labels)
{
+#if defined(sun)
const ctf_header_t *h;
+#else
+ ctf_header_t *h;
+ const void *p;
+#endif
/*
* Labels are only supported in V2 or later
@@ -39,10 +44,17 @@
if (fp->ctf_version < CTF_VERSION_2)
return (ctf_set_errno(fp, ECTF_NOTSUP));
+#if defined(sun)
h = (const ctf_header_t *)fp->ctf_data.cts_data;
/* LINTED - pointer alignment */
*ctl = (const ctf_lblent_t *)(fp->ctf_buf + h->cth_lbloff);
+#else
+ h = (ctf_header_t *)fp->ctf_data.cts_data;
+
+ p = fp->ctf_buf + h->cth_lbloff;
+ *ctl = p;
+#endif
*num_labels = (h->cth_objtoff - h->cth_lbloff) / sizeof (ctf_lblent_t);
return (0);
More information about the p4-projects
mailing list