From owner-svn-src-head@FreeBSD.ORG Wed Oct 13 13:22:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91BE1106566B; Wed, 13 Oct 2010 13:22:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F76B8FC0A; Wed, 13 Oct 2010 13:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DDMBgw088651; Wed, 13 Oct 2010 13:22:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DDMBoQ088648; Wed, 13 Oct 2010 13:22:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010131322.o9DDMBoQ088648@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Oct 2010 13:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213775 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 13:22:11 -0000 Author: jhb Date: Wed Oct 13 13:22:11 2010 New Revision: 213775 URL: http://svn.freebsd.org/changeset/base/213775 Log: Make DEBUG traces 64-bit clean: - Use %t to print ptrdiff_t values. - Cast a ptrdiff_t value explicitly to int for a field width specifier. While here, sort includes. Submitted by: Garrett Cooper Modified: head/bin/sh/expand.c head/bin/sh/jobs.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Oct 13 13:17:38 2010 (r213774) +++ head/bin/sh/expand.c Wed Oct 13 13:22:11 2010 (r213775) @@ -43,14 +43,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include -#include +#include +#include #include +#include #include +#include #include +#include /* * Routines to expand arguments to commands. We have to deal with @@ -497,9 +498,9 @@ expbackq(union node *cmd, int quoted, in exitstatus = waitforjob(in.jp, (int *)NULL); if (quoted == 0) recordregion(startloc, dest - stackblock(), 0); - TRACE(("evalbackq: size=%d: \"%.*s\"\n", - (dest - stackblock()) - startloc, - (dest - stackblock()) - startloc, + TRACE(("expbackq: size=%td: \"%.*s\"\n", + ((dest - stackblock()) - startloc), + (int)((dest - stackblock()) - startloc), stackblock() + startloc)); expdest = dest; INTON; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Wed Oct 13 13:17:38 2010 (r213774) +++ head/bin/sh/jobs.c Wed Oct 13 13:22:11 2010 (r213775) @@ -38,18 +38,18 @@ static char sccsid[] = "@(#)jobs.c 8.5 ( #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include "shell.h" #if JOBS @@ -680,7 +680,7 @@ makejob(union node *node __unused, int n jp->ps = &jp->ps0; } INTON; - TRACE(("makejob(%p, %d) returns %%%d\n", (void *)node, nprocs, + TRACE(("makejob(%p, %d) returns %%%td\n", (void *)node, nprocs, jp - jobtab + 1)); return jp; } @@ -766,7 +766,7 @@ forkshell(struct job *jp, union node *n, pid_t pid; pid_t pgrp; - TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, + TRACE(("forkshell(%%%td, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; if (mode == FORK_BG) @@ -903,7 +903,7 @@ waitforjob(struct job *jp, int *origstat int st; INTOFF; - TRACE(("waitforjob(%%%d) called\n", jp - jobtab + 1)); + TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1)); while (jp->state == 0) if (dowait(1, jp) == -1) dotrap(); @@ -1004,7 +1004,7 @@ dowait(int block, struct job *job) if (stopped) { /* stopped or done */ int state = done? JOBDONE : JOBSTOPPED; if (jp->state != state) { - TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state)); + TRACE(("Job %td: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state)); jp->state = state; if (jp != job) { if (done && !jp->remembered &&