From owner-p4-projects@FreeBSD.ORG Tue Aug 15 02:39:02 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7401616A4DF; Tue, 15 Aug 2006 02:39:02 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F96116A4E0 for ; Tue, 15 Aug 2006 02:39:02 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B115343D6A for ; Tue, 15 Aug 2006 02:39:01 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7F2d1Zk084558 for ; Tue, 15 Aug 2006 02:39:01 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7F2d1xE084553 for perforce@freebsd.org; Tue, 15 Aug 2006 02:39:01 GMT (envelope-from jb@freebsd.org) Date: Tue, 15 Aug 2006 02:39:01 GMT Message-Id: <200608150239.k7F2d1xE084553@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 103956 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 02:39:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=103956 Change 103956 by jb@jb_freebsd2 on 2006/08/15 02:38:02 More 'const' removal. Also remove the casts which attempted to override the consts. Affected files ... .. //depot/projects/dtrace/src/sys/contrib/opensolaris/common/ctf/ctf_open.c#2 edit Differences ... ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/common/ctf/ctf_open.c#2 (text) ==== @@ -25,7 +25,9 @@ * Use is subject to license terms. */ +#if defined(sun) #pragma ident "@(#)ctf_open.c 1.10 06/01/07 SMI" +#endif #include #include @@ -37,8 +39,8 @@ { NULL, 0, 0, 0, 0, 0, 0 } }; -const char _CTF_SECTION[] = ".SUNW_ctf"; -const char _CTF_NULLSTR[] = ""; +char _CTF_SECTION[] = ".SUNW_ctf"; +char _CTF_NULLSTR[] = ""; int _libctf_version = CTF_VERSION; /* library client version */ int _libctf_debug = 0; /* debugging messages enabled */ @@ -80,7 +82,7 @@ } static const ctf_fileops_t ctf_fileops[] = { - { NULL, NULL }, + { NULL, NULL, NULL }, { get_kind_v1, get_root_v1, get_vlen_v1 }, { get_kind_v2, get_root_v2, get_vlen_v2 }, }; @@ -199,9 +201,9 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth) { /* LINTED - pointer alignment */ - const ctf_type_t *tbuf = (ctf_type_t *)(fp->ctf_buf + cth->cth_typeoff); + const ctf_type_t *tbuf = (const ctf_type_t *)(const void *)(fp->ctf_buf + cth->cth_typeoff); /* LINTED - pointer alignment */ - const ctf_type_t *tend = (ctf_type_t *)(fp->ctf_buf + cth->cth_stroff); + const ctf_type_t *tend = (const ctf_type_t *)(const void *)(fp->ctf_buf + cth->cth_stroff); ulong_t pop[CTF_K_MAX + 1] = { 0 }; const ctf_type_t *tp; @@ -479,7 +481,7 @@ * in fp->ctf_ptrtab[ index of referenced type ]. */ if (CTF_TYPE_ISCHILD(tp->ctt_type) == child && - CTF_TYPE_TO_INDEX(tp->ctt_type) <= fp->ctf_typemax) + CTF_TYPE_TO_INDEX(tp->ctt_type) <= (long) fp->ctf_typemax) fp->ctf_ptrtab[ CTF_TYPE_TO_INDEX(tp->ctt_type)] = id; /*FALLTHRU*/ @@ -524,7 +526,7 @@ if (LCTF_INFO_KIND(fp, tp->ctt_info) == CTF_K_TYPEDEF && strcmp(ctf_strptr(fp, tp->ctt_name), "") == 0 && CTF_TYPE_ISCHILD(tp->ctt_type) == child && - CTF_TYPE_TO_INDEX(tp->ctt_type) <= fp->ctf_typemax) + CTF_TYPE_TO_INDEX(tp->ctt_type) <= (long) fp->ctf_typemax) fp->ctf_ptrtab[ CTF_TYPE_TO_INDEX(tp->ctt_type)] = dst; } @@ -828,24 +830,24 @@ if (fp->ctf_data.cts_name != _CTF_NULLSTR && fp->ctf_data.cts_name != NULL) { - ctf_free((char *)fp->ctf_data.cts_name, + ctf_free(fp->ctf_data.cts_name, strlen(fp->ctf_data.cts_name) + 1); } if (fp->ctf_symtab.cts_name != _CTF_NULLSTR && fp->ctf_symtab.cts_name != NULL) { - ctf_free((char *)fp->ctf_symtab.cts_name, + ctf_free(fp->ctf_symtab.cts_name, strlen(fp->ctf_symtab.cts_name) + 1); } if (fp->ctf_strtab.cts_name != _CTF_NULLSTR && fp->ctf_strtab.cts_name != NULL) { - ctf_free((char *)fp->ctf_strtab.cts_name, + ctf_free(fp->ctf_strtab.cts_name, strlen(fp->ctf_strtab.cts_name) + 1); } if (fp->ctf_base != fp->ctf_data.cts_data && fp->ctf_base != NULL) - ctf_data_free((void *)fp->ctf_base, fp->ctf_size); + ctf_data_free(fp->ctf_base, fp->ctf_size); if (fp->ctf_sxlate != NULL) ctf_free(fp->ctf_sxlate, sizeof (uint_t) * fp->ctf_nsyms);