[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#639010: tablix2: FTBFs on hurd-i386



Source: tablix2
Version: 0.3.5-2
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hello,

tablix2 currently FTBFS on hurd-i386 due to naming of some local
variables the unfortunate name time. On GNU/Hurd inclusion of standard
header files, like stdlib.h indirectly includes /usr/include/time.h,
which defines time(2) creating a variable name conflict. The attached
patch renames these variables to avoid this problem.


diff -ur tablix2-0.3.5/modules/available.c tablix2-0.3.5.new//modules/available.c
--- tablix2-0.3.5/modules/available.c	2006-05-15 21:57:11.000000000 +0200
+++ tablix2-0.3.5.new//modules/available.c	2011-08-23 15:48:58.000000000 +0200
@@ -60,7 +60,7 @@
 
 #include "module.h"
 
-static resourcetype *time;
+static resourcetype *rtime;
 
 int not_available(char *restriction, char *cont, resource *res)
 {
@@ -88,12 +88,12 @@
 		return -1;
 	}
 
-	time_resnum=time->resnum;
+	time_resnum=rtime->resnum;
 
 	res_typeid=res->restype->typeid;
 	res_id=res->resid;
 	
-	timeslot_resid=res_findid(time, cont);
+	timeslot_resid=res_findid(rtime, cont);
 	if(timeslot_resid<0) {
 		error(_("Can't find resource '%s', resource type '%s'"), cont,
 									"time");
@@ -116,7 +116,7 @@
 
 	for(tupleid=0;tupleid<dat_tuplenum;tupleid++) {
 		if(dat_tuplemap[tupleid].resid[res_typeid]==res_id) {
-			domain_and(dat_tuplemap[tupleid].dom[time->typeid], 
+			domain_and(dat_tuplemap[tupleid].dom[rtime->typeid], 
 								list, listnum);
 		}
 	}
@@ -128,8 +128,8 @@
 
 int module_init(moduleoption *opt) 
 {
-	time=restype_find("time");
-	if(time==NULL) return -1;
+	rtime=restype_find("time");
+	if(rtime==NULL) return -1;
 
 	handler_res_new(NULL, "not-available", not_available);
 	
diff -ur tablix2-0.3.5/modules/consecutive.c tablix2-0.3.5.new//modules/consecutive.c
--- tablix2-0.3.5/modules/consecutive.c	2006-08-29 16:32:24.000000000 +0200
+++ tablix2-0.3.5.new//modules/consecutive.c	2011-08-23 15:46:17.000000000 +0200
@@ -129,7 +129,7 @@
 /* Linked list describing all consecutive blocks */
 static struct cons_t *cons=NULL;
 
-static int time;
+static int rtime;
 
 static int periods, days;
 
@@ -251,7 +251,7 @@
  * scheduled one period later than the independent event. */
 int updater(int src, int dst, int typeid, int resid)
 {
-	assert(typeid==time);
+	assert(typeid==rtime);
 
 	return(resid+1);
 }
@@ -292,7 +292,7 @@
 			/* We have to check if this event is already dependent.
 			 * If it is, we report an error. */
 
-			if(updater_check(tupleid, time)) {
+			if(updater_check(tupleid, rtime)) {
 				error(_("Event '%s' already depends on another"
 					" event"), dat_tuplemap[tupleid].name);
 				free(residlist);
@@ -304,7 +304,7 @@
 			 * second event depends on the first. The third event
 			 * depends on the second and so on. */
 
-			updater_new(cur->tupleid[n-1], tupleid, time, updater);
+			updater_new(cur->tupleid[n-1], tupleid, rtime, updater);
 		}
 
 		/* Now we have to make sure that the first event in the group
@@ -323,7 +323,7 @@
 		}
 
 		tupleid=cur->tupleid[0];
-		domain_and(dat_tuplemap[tupleid].dom[time],residlist,residnum);
+		domain_and(dat_tuplemap[tupleid].dom[rtime],residlist,residnum);
 
 		cur=cur->next;
 	}
@@ -338,8 +338,8 @@
 	int c;
 
 	/* We store some info about the time resources in global variables. */
-	time=restype_findid("time");
-	if(time<0) {
+	rtime=restype_findid("time");
+	if(rtime<0) {
 		error(_("Resource type '%s' not found"), "time");
 		return -1;
 	}
diff -ur tablix2-0.3.5/modules/recurrence.c tablix2-0.3.5.new//modules/recurrence.c
--- tablix2-0.3.5/modules/recurrence.c	2006-08-29 16:32:24.000000000 +0200
+++ tablix2-0.3.5.new//modules/recurrence.c	2011-08-23 15:45:45.000000000 +0200
@@ -104,7 +104,7 @@
 /* Linked list describing all blocks */
 static struct block_t *cons=NULL;
 
-static int time;
+static int rtime;
 
 /* Number of periods in a day, number of all defined days and number of weeks */
 static int periods, days, weeks;
@@ -250,7 +250,7 @@
 
 		/* It is possible that this is the last week and it does not
 		 * contain all days. */
-		if(resid>=dat_restype[time].resnum) break;
+		if(resid>=dat_restype[rtime].resnum) break;
 		residlist[n]=resid;
 	}
 
@@ -293,7 +293,7 @@
 
 			tupleid=cur->tupleid[n];
 
-			domain_and(dat_tuplemap[tupleid].dom[time],
+			domain_and(dat_tuplemap[tupleid].dom[rtime],
 					residlist, residnum);
 
 			if((n+1)%cur->r_perweek==0) {
@@ -314,8 +314,8 @@
 	int c;
 
 	/* We store some info about the time resources in global variables. */
-	time=restype_findid("time");
-	if(time<0) {
+	rtime=restype_findid("time");
+	if(rtime<0) {
 		error(_("Resource type '%s' not found"), "time");
 		return -1;
 	}
diff -ur tablix2-0.3.5/modules/sametimeas.c tablix2-0.3.5.new//modules/sametimeas.c
--- tablix2-0.3.5/modules/sametimeas.c	2006-08-29 16:32:24.000000000 +0200
+++ tablix2-0.3.5.new//modules/sametimeas.c	2011-08-23 17:58:47.000000000 +0200
@@ -71,7 +71,7 @@
 static struct sametime *sa;
 static int numsa;
 
-static int time;
+static int rtime;
 
 static int event_used(int tupleid2) {
         int n;
@@ -143,11 +143,11 @@
         int c;
 
         for(c=0;c<numsa;c++) {
-                if(updater_check(sa[c].tupleid2, time)) {
+                if(updater_check(sa[c].tupleid2, rtime)) {
                         error(_("Event '%s' already depends on another "
                         	"event"), dat_tuplemap[sa[c].tupleid2].name);
                 }
-                updater_new(sa[c].tupleid1, sa[c].tupleid2, time, updater);
+                updater_new(sa[c].tupleid1, sa[c].tupleid2, rtime, updater);
         }
         return(0);
 }
@@ -163,8 +163,8 @@
         }
         numsa=0;
 
-        time=restype_findid("time");
-        if(time<0) {
+        rtime=restype_findid("time");
+        if(rtime<0) {
                 error(_("Resource type '%s' not found"), "time");
                 return -1;
         }

Reply to: