Date: Mon, 3 Jul 2006 09:42:38 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 100477 for review Message-ID: <200607030942.k639gcrO065519@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100477 Change 100477 by jb@jb_freebsd2 on 2006/07/03 09:41:50 I wish Sun would turn up their compiler warning levels and stop their programmers from casting variables and function pointers. Casting always causes problems porting code other other architectures. (I will probably get yelled at for saying this, but it's TRUE!) Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/alist.c#2 edit .. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/merge.c#4 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/alist.c#2 (text) ==== @@ -171,13 +171,13 @@ { printf("Key: "); if (alist_def_print_cb_key_int == 1) - printf("%5d ", (int)key); + printf("%5lu ", (ulong_t)key); else printf("%s\n", (char *)key); printf("Value: "); if (alist_def_print_cb_value_int == 1) - printf("%5d\n", (int)value); + printf("%5lu\n", (ulong_t)value); else printf("%s\n", (char *)key); ==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/cvt/merge.c#4 (text) ==== @@ -181,10 +181,10 @@ { debug(3, "Adding mapping %u => %u\n", srcid, tgtid); - assert(!alist_find(ta, (void *)srcid, NULL)); + assert(!alist_find(ta, (void *)(ulong_t)srcid, NULL)); assert(srcid != 0 && tgtid != 0); - alist_add(ta, (void *)srcid, (void *)tgtid); + alist_add(ta, (void *)(ulong_t)srcid, (void *)(ulong_t)tgtid); } static tid_t @@ -192,7 +192,7 @@ { long ltgtid; - if (alist_find(ta, (void *)srcid, (void **)<gtid)) + if (alist_find(ta, (void *)(ulong_t)srcid, (void **)<gtid)) return ((int)ltgtid); else return (0); @@ -908,7 +908,7 @@ redir_mstr_fwd_cb(void *name, void *value, void *arg) { tdesc_t *fwd = name; - int defnid = (int)value; + int defnid = (ulong_t)value; redir_mstr_data_t *rmd = arg; tdesc_t template; tdesc_t *defn;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607030942.k639gcrO065519>