Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 May 2006 13:39:56 +0900
From:      Tod McQuillin <devin@spamcop.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        gnome@FreeBSD.org
Subject:   ports/96640: [PATCH] sysutils/gnomesystemmonitor: [Fix build on FreeBSD 4.x]
Message-ID:  <E1Famg0-000NAm-Gf@mail.distalzou.net>
Resent-Message-ID: <200605020440.k424eFcw027416@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         96640
>Category:       ports
>Synopsis:       [PATCH] sysutils/gnomesystemmonitor: [Fix build on FreeBSD 4.x]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 02 04:40:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Tod McQuillin
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
>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 ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1Famg0-000NAm-Gf>