Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2007 04:59:12 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 127658 for review
Message-ID:  <200710180459.l9I4xCCk004157@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=127658

Change 127658 by jb@jb_freebsd1 on 2007/10/18 04:58:59

	Fix compiler warnings for WARNS=6.

Affected files ...

.. //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/dump/dump.c#6 edit

Differences ...

==== //depot/projects/dtrace/src/contrib/opensolaris/tools/ctf/dump/dump.c#6 (text) ====

@@ -287,7 +287,7 @@
 		int symidx, len, i;
 		char *name = NULL;
 
-		for (symidx = -1, i = 0; i < n; i++) {
+		for (symidx = -1, i = 0; i < (int) n; i++) {
 			int nextsym;
 
 			if (cd->cd_symdata == NULL || (nextsym = next_sym(cd,
@@ -419,7 +419,7 @@
 
 		union {
 			const void *ptr;
-			const ctf_array_t *ap;
+			ctf_array_t *ap;
 			const ctf_member_t *mp;
 			const ctf_lmember_t *lmp;
 			const ctf_enum_t *ep;
@@ -439,7 +439,7 @@
 			increment = sizeof (ctf_stype_t);
 			size = tp->ctt_size;
 		}
-		u.ptr = (caddr_t)tp + increment;
+		u.ptr = (const char *)tp + increment;
 
 		switch (kind) {
 		case CTF_K_INTEGER:
@@ -527,13 +527,13 @@
 			}
 
 			if (flags != F_STATS) {
-				(void) printf(" %s (%d bytes)\n",
+				(void) printf(" %s (%zd bytes)\n",
 				    ref_to_str(tp->ctt_name, hp, cd), size);
 
 				if (size >= CTF_LSTRUCT_THRESH) {
 					for (i = 0; i < n; i++, u.lmp++) {
 						(void) printf(
-						    "\t%s type=%u off=%llu\n",
+						    "\t%s type=%u off=%lu\n",
 						    ref_to_str(u.lmp->ctlm_name,
 						    hp, cd), u.lmp->ctlm_type,
 						    CTF_LMEM_OFFSET(u.lmp));
@@ -785,7 +785,7 @@
 }
 
 static Elf_Scn *
-findelfscn(Elf *elf, GElf_Ehdr *ehdr, char *secname)
+findelfscn(Elf *elf, GElf_Ehdr *ehdr, const char *secname)
 {
 	GElf_Shdr shdr;
 	Elf_Scn *scn;
@@ -811,7 +811,7 @@
 
 	ctf_data_t cd;
 	const ctf_preamble_t *pp;
-	ctf_header_t *hp;
+	ctf_header_t *hp = NULL;
 	Elf *elf;
 	GElf_Ehdr ehdr;
 
@@ -871,7 +871,7 @@
 	if ((elf = elf_begin(fd, ELF_C_READ, NULL)) != NULL &&
 	    gelf_getehdr(elf, &ehdr) != NULL) {
 
-		Elf_Data *dp;
+		Elf_Data *dp = NULL;
 		Elf_Scn *ctfscn = findelfscn(elf, &ehdr, ".SUNW_ctf");
 		Elf_Scn *symscn;
 		GElf_Shdr ctfshdr;
@@ -1012,7 +1012,7 @@
 
 		if ((ufd = open(ufile, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0 ||
 		    write(ufd, &h, sizeof (h)) != sizeof (h) ||
-		    write(ufd, cd.cd_ctfdata, cd.cd_ctflen) != cd.cd_ctflen) {
+		    write(ufd, cd.cd_ctfdata, cd.cd_ctflen) != (int) cd.cd_ctflen) {
 			warn("failed to write CTF data to '%s'", ufile);
 			error |= E_ERROR;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710180459.l9I4xCCk004157>