[Ns-developers] nam 1.11 - x86_64 64bit and gcc 4.1.1 patch

Anush Elangovan anush.e at gmail.com
Fri Nov 17 07:32:00 PST 2006


Looks like defining tcl.h -DNO_VOID in the makefile is good for
architectures where void* != int*. Some other minor cleanup to keep
gcc happy.

I haven't tested on ia32 platforms. Works for me on x86_64. Patched
against latest cvs.

Anush



Only in nam-1-snapshot-20060220: Makefile
diff -ur nam-1-snapshot-20060220/Makefile.in
nam-1-snapshot-20060220-mine/Makefile.in
--- nam-1-snapshot-20060220/Makefile.in	2001-08-16 19:11:47.000000000 -0700
+++ nam-1-snapshot-20060220-mine/Makefile.in	2006-11-17 00:44:25.000000000 -0800
@@ -61,7 +61,7 @@
 	@V_INCLUDE_X11@

 STATIC = @V_STATIC@
-DEFINE = -DTCL_TK @V_DEFINE@ @V_DEFINES@
+DEFINE = -DTCL_TK -DNO_VOID @V_DEFINE@ @V_DEFINES@
 CFLAGS = $(CCOPT) $(DEFINE) $(INCLUDE)

 INSTALL = @INSTALL@
@@ -161,7 +161,7 @@
 	$(TCLSH) bin/string2c.tcl version < VERSION > $@

 install: force
-	$(INSTALL) -m 555 -o bin -g bin nam $(DESTDIR)$(BINDEST)
+	$(INSTALL) -m 755 nam $(DESTDIR)$(BINDEST)

 clean:
 	$(RM) $(CLEANFILES)
Only in nam-1-snapshot-20060220-mine: autoconf.h
Only in nam-1-snapshot-20060220: config.log
diff -ur nam-1-snapshot-20060220/editview.cc
nam-1-snapshot-20060220-mine/editview.cc
--- nam-1-snapshot-20060220/editview.cc	2003-10-11 15:56:49.000000000 -0700
+++ nam-1-snapshot-20060220-mine/editview.cc	2006-11-17 00:24:23.000000000 -0800
@@ -66,7 +66,7 @@
 	}
 	char str[256];
 	model_ = m;
-	sprintf(str, "def%-u", (int)this);
+	sprintf(str, "def%-u", (long)this);
 	defTag_ = new Tag(str);
 	model_->add_tag(defTag_);
 	editing_stage_ = NONE;
@@ -89,7 +89,7 @@
 	}

 	model_ = m;
-	sprintf(str, "def%-u", (int)this);
+	sprintf(str, "def%-u", (long)this);
 	defTag_ = new Tag(name);
 	model_->add_tag(defTag_);
 	editing_stage_ = NONE;
diff -ur nam-1-snapshot-20060220/group.cc nam-1-snapshot-20060220-mine/group.cc
--- nam-1-snapshot-20060220/group.cc	2001-04-17 17:14:15.000000000 -0700
+++ nam-1-snapshot-20060220-mine/group.cc	2006-11-17 00:18:48.000000000 -0800
@@ -81,7 +81,7 @@
 	for (he = Tcl_FirstHashEntry(nodeHash_, &hs);
 	     he != NULL;
 	     he = Tcl_NextHashEntry(&hs), i++)
-		mbrs[i] = (int) Tcl_GetHashValue(he);
+		mbrs[i] = *Tcl_GetHashValue(he);
 }

 void Group::draw(View * nv, double now) {
diff -ur nam-1-snapshot-20060220/netgraph.h
nam-1-snapshot-20060220-mine/netgraph.h
--- nam-1-snapshot-20060220/netgraph.h	2000-05-18 11:06:32.000000000 -0700
+++ nam-1-snapshot-20060220-mine/netgraph.h	2006-11-16 23:49:28.000000000 -0800
@@ -68,7 +68,7 @@
 	virtual void handle(const TraceEvent&, double now, int direction);
 	virtual int command(int argc, const char *const *argv);
 	virtual void BoundingBox(BBox&);
-	virtual void NetGraph::render(GraphView* view);
+	virtual void render(GraphView* view);
     protected:
 	GraphView *views_;
 	float graphdata_[MAX_GRAPH];
diff -ur nam-1-snapshot-20060220/netmodel.cc
nam-1-snapshot-20060220-mine/netmodel.cc
--- nam-1-snapshot-20060220/netmodel.cc	2003-10-11 15:56:50.000000000 -0700
+++ nam-1-snapshot-20060220-mine/netmodel.cc	2006-11-17 00:55:50.000000000 -0800
@@ -308,7 +308,7 @@
 	Tcl_HashEntry *he = Tcl_FindHashEntry(addrHash_, (const char *)addr);
 	if (he == NULL)
 		return -1;
-	return (int)Tcl_GetHashValue(he);
+	return *Tcl_GetHashValue(he);
 }

 //----------------------------------------------------------------------
@@ -2761,7 +2761,7 @@
 	Tcl_HashEntry *he = Tcl_FindHashEntry(objnameHash_, n);
 	if (he == NULL)
 		return -1;
-	return (int)Tcl_GetHashValue(he);
+	return *Tcl_GetHashValue(he);
 #undef STATIC_NAMELEN
 }

diff -ur nam-1-snapshot-20060220/node.h nam-1-snapshot-20060220-mine/node.h
--- nam-1-snapshot-20060220/node.h	2001-08-09 18:45:47.000000000 -0700
+++ nam-1-snapshot-20060220-mine/node.h	2006-11-16 23:42:23.000000000 -0800
@@ -223,7 +223,7 @@
 	Queue* queue() { return queue_; }
 	void add_sess_queue(unsigned int grp, Queue *q);
 	char * getTclScript();
-	char * Node::getTclScriptLabel();
+	char * getTclScriptLabel();
 	void setTclScript(const char * label, const char * script);

 	int command(int argc, const char * const * argv);
diff -ur nam-1-snapshot-20060220/parser.h nam-1-snapshot-20060220-mine/parser.h
--- nam-1-snapshot-20060220/parser.h	2005-01-24 11:55:14.000000000 -0800
+++ nam-1-snapshot-20060220-mine/parser.h	2006-11-17 00:53:51.000000000 -0800
@@ -94,8 +94,8 @@
 class ParseTable {
 public:
   //<zheng: +++>
-  static bool ParseTable::nam4wpan;
-  static int ParseTable::wpan_bradius;
+  static bool nam4wpan;
+  static int  wpan_bradius;
   //</zheng: +++>
   TraceSyntax * syntax_list;
 private:


More information about the Ns-developers mailing list