From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 12 17:40:28 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F3CA16A4CE for ; Sun, 12 Sep 2004 17:40:28 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79F3C43D5A for ; Sun, 12 Sep 2004 17:40:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8CHeSru009197 for ; Sun, 12 Sep 2004 17:40:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8CHeSus009196; Sun, 12 Sep 2004 17:40:28 GMT (envelope-from gnats) Resent-Date: Sun, 12 Sep 2004 17:40:28 GMT Resent-Message-Id: <200409121740.i8CHeSus009196@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2F0D16A4CE for ; Sun, 12 Sep 2004 17:37:33 +0000 (GMT) Received: from kulesh.obluda.cz (kulesh.obluda.cz [193.179.22.243]) by mx1.FreeBSD.org (Postfix) with ESMTP id 685F643D2D for ; Sun, 12 Sep 2004 17:37:32 +0000 (GMT) (envelope-from dan@obluda.cz) Received: from kulesh.obluda.cz (localhost.eunet.cz [127.0.0.1]) by kulesh.obluda.cz (8.13.1/8.13.1) with ESMTP id i8CHb5f7010926 for ; Sun, 12 Sep 2004 19:37:11 +0200 (CEST) (envelope-from dan@obluda.cz) Received: (from root@localhost) by kulesh.obluda.cz (8.13.1/8.13.1/Submit) id i8CHb5hR010925 for FreeBSD-gnats-submit@freebsd.org; Sun, 12 Sep 2004 19:37:05 +0200 (CEST) (envelope-from dan@obluda.cz) Message-Id: <200409121737.i8CHb5hR010925@kulesh.obluda.cz> Date: Sun, 12 Sep 2004 19:37:05 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/71672: [PATCH] cleanup of the usr.sbin/acpi code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dan Lukes List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2004 17:40:28 -0000 >Number: 71672 >Category: bin >Synopsis: [PATCH] cleanup of the usr.sbin/acpi code >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 12 17:40:28 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 5.3-BETA3 i386 >Organization: Obludarium >Environment: System: FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 i386 usr.sbin/acpi/acpidb/acpidb.c,v 1.1 2003/08/07 16:51:50 njl >Description: There are more than 5000 warnings issued during "make buildworld". Some of them are false positives, but some of them are sign of true errors. Nobody is upset by warnings due it's amount, so some errors remain uncorrected. I want to cleanup the code-base from warnings, so warnings will become "attention mark" again. usr.sbin/acpi/acpidb/acpidb.c:162: warning: unsigned int format, different type arg (arg 2) usr.sbin/acpi/acpidb/acpidb.c:163: warning: unsigned int format, different type arg (arg 2) usr.sbin/acpi/acpidb/acpidb.c:242: warning: unsigned int format, different type arg (arg 4) usr.sbin/acpi/acpidb/acpidb.c:286: warning: unsigned int format, different type arg (arg 5) usr.sbin/acpi/acpidb/acpidb.c:300: warning: unsigned int format, different type arg (arg 5) usr.sbin/acpi/acpidb/acpidb.c:350: warning: unused variable `amlptr' usr.sbin/acpi/acpidb/acpidb.c:354: warning: unused variable `tableptr' >How-To-Repeat: N/A >Fix: *** usr.sbin/acpi/acpidb/acpidb.c.ORIG Thu Aug 7 18:51:50 2003 --- usr.sbin/acpi/acpidb/acpidb.c Sun Sep 12 18:43:38 2004 *************** *** 159,166 **** if (msg != NULL) { printf("%s", msg); } ! printf("(default: 0x%x ", val); ! printf(" / %u) >>", val); fflush(stdout); bzero(buf, sizeof buf); --- 159,166 ---- if (msg != NULL) { printf("%s", msg); } ! printf("(default: 0x%lx ", (unsigned long)val); ! printf(" / %lu) >>", (unsigned long)val); fflush(stdout); bzero(buf, sizeof buf); *************** *** 238,245 **** } while (!TAILQ_EMPTY(&RegionContentList)) { rc = TAILQ_FIRST(&RegionContentList); ! fprintf(fp, "%d 0x%x 0x%x\n", ! rc->regtype, rc->addr, rc->value); TAILQ_REMOVE(&RegionContentList, rc, links); free(rc); } --- 238,245 ---- } while (!TAILQ_EMPTY(&RegionContentList)) { rc = TAILQ_FIRST(&RegionContentList); ! fprintf(fp, "%d 0x%lx 0x%x\n", ! rc->regtype, (unsigned long)rc->addr, rc->value); TAILQ_REMOVE(&RegionContentList, rc, links); free(rc); } *************** *** 282,289 **** } *Value = value; if (Prompt) { ! sprintf(msg, "[read (%s, %2d, 0x%x)]", ! space_names[SpaceID], BitWidth, Address); *Value = aml_simulate_prompt(msg, value); if (*Value != value) { return(aml_vm_space_handler(SpaceID, --- 282,289 ---- } *Value = value; if (Prompt) { ! sprintf(msg, "[read (%s, %2d, 0x%lx)]", ! space_names[SpaceID], BitWidth, (unsigned long)Address); *Value = aml_simulate_prompt(msg, value); if (*Value != value) { return(aml_vm_space_handler(SpaceID, *************** *** 296,303 **** case ACPI_WRITE: value = *Value; if (Prompt) { ! sprintf(msg, "[write(%s, %2d, 0x%x)]", ! space_names[SpaceID], BitWidth, Address); value = aml_simulate_prompt(msg, *Value); } *Value = value; --- 296,303 ---- case ACPI_WRITE: value = *Value; if (Prompt) { ! sprintf(msg, "[write(%s, %2d, 0x%lx)]", ! space_names[SpaceID], BitWidth, (unsigned long)Address); value = aml_simulate_prompt(msg, *Value); } *Value = value; *************** *** 347,357 **** load_dsdt(const char *dsdtfile) { char filetmp[PATH_MAX]; ! u_int8_t *code, *amlptr; struct stat sb; int fd, fd2; int error; - ACPI_TABLE_HEADER *tableptr; fd = open(dsdtfile, O_RDONLY, 0); if (fd == -1) { --- 347,356 ---- load_dsdt(const char *dsdtfile) { char filetmp[PATH_MAX]; ! u_int8_t *code; struct stat sb; int fd, fd2; int error; fd = open(dsdtfile, O_RDONLY, 0); if (fd == -1) { >Release-Note: >Audit-Trail: >Unformatted: