From owner-freebsd-gnome@FreeBSD.ORG Tue May 2 04:39:57 2006 Return-Path: X-Original-To: gnome@FreeBSD.org Delivered-To: freebsd-gnome@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C421A16A401; Tue, 2 May 2006 04:39:57 +0000 (UTC) (envelope-from root@distalzou.net) Received: from mail.distalzou.net (203.141.139.231.user.ad.il24.net [203.141.139.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FE2F43D5F; Tue, 2 May 2006 04:39:57 +0000 (GMT) (envelope-from root@distalzou.net) Received: from root by mail.distalzou.net with local (Exim 4.61 (FreeBSD)) (envelope-from ) id 1Famg0-000NAm-Gf; Tue, 02 May 2006 13:39:56 +0900 To: FreeBSD-gnats-submit@freebsd.org From: Tod McQuillin X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: Date: Tue, 02 May 2006 13:39:56 +0900 Cc: gnome@FreeBSD.org Subject: [PATCH] sysutils/gnomesystemmonitor: [Fix build on FreeBSD 4.x] X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2006 04:39:58 -0000 >Submitter-Id: current-users >Originator: Tod McQuillin >Organization: >Confidential: no >Synopsis: [PATCH] sysutils/gnomesystemmonitor: [Fix build on FreeBSD 4.x] >Severity: non-critical >Priority: low >Category: ports >Class: change-request >Release: FreeBSD 4.11-STABLE i386 >Environment: System: FreeBSD plexi.pun-pun.prv 4.11-STABLE FreeBSD 4.11-STABLE #0: Thu Mar 23 21:52:12 JST 2006 >Description: gcc 2.95 doesn't like the unnamed union in struct _LoadGraph in src/load-graph.c, so I gave it a name and fixed all references to the union members to use the name. Added file(s): - files/patch-src_load-graph.c Port maintainer (gnome@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.75 >How-To-Repeat: build on 4.x >Fix: --- gnomesystemmonitor-2.14.1.patch begins here --- Index: files/patch-src_load-graph.c =================================================================== RCS file: files/patch-src_load-graph.c diff -N files/patch-src_load-graph.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-src_load-graph.c 2 May 2006 04:28:57 -0000 @@ -0,0 +1,99 @@ +--- src/load-graph.c~ Mon Apr 10 01:46:29 2006 ++++ src/load-graph.c Tue May 2 13:27:35 2006 +@@ -71,7 +71,7 @@ + GTimeVal time; + float max; + } net; +- }; ++ } cn; + }; + + +@@ -206,8 +206,8 @@ + + #undef NOW + #undef LAST +-#define NOW (g->cpu.times[g->cpu.now]) +-#define LAST (g->cpu.times[g->cpu.now ^ 1]) ++#define NOW (g->cn.cpu.times[g->cn.cpu.now]) ++#define LAST (g->cn.cpu.times[g->cn.cpu.now ^ 1]) + + if (g->n == 1) { + NOW[0][CPU_TOTAL] = cpu.total; +@@ -220,9 +220,9 @@ + } + } + +- if (G_UNLIKELY(!g->cpu.initialized)) { ++ if (G_UNLIKELY(!g->cn.cpu.initialized)) { + /* No data yet */ +- g->cpu.initialized = TRUE; ++ g->cn.cpu.initialized = TRUE; + } else { + for (i = 0; i < g->n; i++) { + float load; +@@ -242,7 +242,7 @@ + } + } + +- g->cpu.now ^= 1; ++ g->cn.cpu.now ^= 1; + + #undef NOW + #undef LAST +@@ -293,7 +293,7 @@ + net_scale (LoadGraph *g, float new_max) + { + gint i; +- float old_max = MAX (g->net.max, 1.0f), scale; ++ float old_max = MAX (g->cn.net.max, 1.0f), scale; + + if (new_max <= old_max) + return; +@@ -307,7 +307,7 @@ + } + } + +- g->net.max = new_max; ++ g->cn.net.max = new_max; + } + + static void +@@ -342,13 +342,13 @@ + + g_get_current_time (&time); + +- if (in >= g->net.last_in && out >= g->net.last_out && +- g->net.time.tv_sec != 0) { ++ if (in >= g->cn.net.last_in && out >= g->cn.net.last_out && ++ g->cn.net.time.tv_sec != 0) { + float dtime; +- dtime = time.tv_sec - g->net.time.tv_sec + +- (float) (time.tv_usec - g->net.time.tv_usec) / G_USEC_PER_SEC; +- din = (in - g->net.last_in) / dtime; +- dout = (out - g->net.last_out) / dtime; ++ dtime = time.tv_sec - g->cn.net.time.tv_sec + ++ (float) (time.tv_usec - g->cn.net.time.tv_usec) / G_USEC_PER_SEC; ++ din = (in - g->cn.net.last_in) / dtime; ++ dout = (out - g->cn.net.last_out) / dtime; + } else { + /* Don't calc anything if new data is less than old (interface + removed, counters reset, ...) or if it is the first time */ +@@ -356,12 +356,12 @@ + dout = 0.0f; + } + +- g->net.last_in = in; +- g->net.last_out = out; +- g->net.time = time; ++ g->cn.net.last_in = in; ++ g->cn.net.last_out = out; ++ g->cn.net.time = time; + +- g->data[0][0] = din / MAX(g->net.max, 1.0f); +- g->data[0][1] = dout / MAX(g->net.max, 1.0f); ++ g->data[0][0] = din / MAX(g->cn.net.max, 1.0f); ++ g->data[0][1] = dout / MAX(g->cn.net.max, 1.0f); + + net_scale (g, MAX (din, dout)); + --- gnomesystemmonitor-2.14.1.patch ends here ---