From owner-svn-src-all@FreeBSD.ORG Sat Sep 29 16:42:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B76A106564A; Sat, 29 Sep 2012 16:42:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E20828FC0C; Sat, 29 Sep 2012 16:42:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8TGg1f6058056; Sat, 29 Sep 2012 16:42:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8TGg1VF058054; Sat, 29 Sep 2012 16:42:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209291642.q8TGg1VF058054@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 29 Sep 2012 16:42:01 +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: r241052 - head/sbin/pfctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 16:42:02 -0000 Author: glebius Date: Sat Sep 29 16:42:01 2012 New Revision: 241052 URL: http://svn.freebsd.org/changeset/base/241052 Log: - Get rid of #ifdef __FreeBSD__. - Use correct format when printing uint64_t. Modified: head/sbin/pfctl/pf_print_state.c Modified: head/sbin/pfctl/pf_print_state.c ============================================================================== --- head/sbin/pfctl/pf_print_state.c Sat Sep 29 16:40:12 2012 (r241051) +++ head/sbin/pfctl/pf_print_state.c Sat Sep 29 16:42:01 2012 (r241052) @@ -35,10 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __FreeBSD__ #include -#define betoh64 be64toh -#endif #include #define TCPSTATES #include @@ -46,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -318,18 +316,11 @@ print_state(struct pfsync_state *s, int bcopy(s->packets[1], &packets[1], sizeof(u_int64_t)); bcopy(s->bytes[0], &bytes[0], sizeof(u_int64_t)); bcopy(s->bytes[1], &bytes[1], sizeof(u_int64_t)); - printf(", %llu:%llu pkts, %llu:%llu bytes", -#ifdef __FreeBSD__ - (unsigned long long)betoh64(packets[0]), - (unsigned long long)betoh64(packets[1]), - (unsigned long long)betoh64(bytes[0]), - (unsigned long long)betoh64(bytes[1])); -#else - betoh64(packets[0]), - betoh64(packets[1]), - betoh64(bytes[0]), - betoh64(bytes[1])); -#endif + printf(", %ju:%ju pkts, %ju:%ju bytes", + (uintmax_t )be64toh(packets[0]), + (uintmax_t )be64toh(packets[1]), + (uintmax_t )be64toh(bytes[0]), + (uintmax_t )be64toh(bytes[1])); if (ntohl(s->anchor) != -1) printf(", anchor %u", ntohl(s->anchor)); if (ntohl(s->rule) != -1) @@ -346,12 +337,8 @@ print_state(struct pfsync_state *s, int u_int64_t id; bcopy(&s->id, &id, sizeof(u_int64_t)); - printf(" id: %016llx creatorid: %08x", -#ifdef __FreeBSD__ - (unsigned long long)betoh64(id), ntohl(s->creatorid)); -#else - betoh64(id), ntohl(s->creatorid)); -#endif + printf(" id: %016jx creatorid: %08x", + (uintmax_t )be64toh(id), ntohl(s->creatorid)); printf("\n"); } }