[40054] trunk/base/src/pextlib1.0

toby at macports.org toby at macports.org
Thu Sep 18 19:22:42 PDT 2008


Revision: 40054
          http://trac.macports.org/changeset/40054
Author:   toby at macports.org
Date:     2008-09-18 19:22:41 -0700 (Thu, 18 Sep 2008)
Log Message:
-----------
fix typecasts

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/Pextlib.c
    trunk/base/src/pextlib1.0/filemap.c

Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c	2008-09-19 02:12:52 UTC (rev 40053)
+++ trunk/base/src/pextlib1.0/Pextlib.c	2008-09-19 02:22:41 UTC (rev 40054)
@@ -537,7 +537,7 @@
 		Tcl_SetResult(interp, "error getting channel handle", TCL_STATIC);
 		return TCL_ERROR;
 	}
-	fd = (int) handle;
+	fd = (int)(intptr_t)handle;
 
 	for (i = 2; i < objc; i++) {
 		char *arg = Tcl_GetString(objv[i]);
@@ -773,7 +773,7 @@
 		free(fd_as_char_star);
 	}
 
-	theChannel = Tcl_MakeFileChannel((ClientData) fd, readOrWrite);
+	theChannel = Tcl_MakeFileChannel((ClientData)(intptr_t)fd, readOrWrite);
 	if (theChannel == NULL) {
 		return TCL_ERROR;
 	}
@@ -832,7 +832,7 @@
 		return TCL_ERROR;
 	}
 
-	channel = Tcl_MakeFileChannel((ClientData) fd, TCL_READABLE|TCL_WRITABLE);
+	channel = Tcl_MakeFileChannel((ClientData)(intptr_t)fd, TCL_READABLE|TCL_WRITABLE);
 	Tcl_RegisterChannel(interp, channel);
 	channelname = (char *)Tcl_GetChannelName(channel);
 	Tcl_AppendResult(interp, channelname, " ", template, NULL);

Modified: trunk/base/src/pextlib1.0/filemap.c
===================================================================
--- trunk/base/src/pextlib1.0/filemap.c	2008-09-19 02:12:52 UTC (rev 40053)
+++ trunk/base/src/pextlib1.0/filemap.c	2008-09-19 02:22:41 UTC (rev 40054)
@@ -767,7 +767,7 @@
 
 		/* one char too far */
 		endCursor--;
-		partLength = (int) endCursor - (int) beginCursor;
+		partLength = endCursor - beginCursor;
 
 		/* do we have a node for this entry? */
 		for (indexSubnodes = 0; indexSubnodes < nbSubnodes; indexSubnodes++)
@@ -907,7 +907,7 @@
 
 		/* one char too far */
 		endCursor--;
-		partLength = (int) endCursor - (int) beginCursor;
+		partLength = endCursor - beginCursor;
 
 		/* do we have a node for this entry? */
 		for (indexSubnodes = 0; indexSubnodes < nbSubnodes; indexSubnodes++)
@@ -1106,7 +1106,7 @@
 
 		/* one char too far */
 		endCursor--;
-		partLength = (int) endCursor - (int) beginCursor;
+		partLength = endCursor - beginCursor;
 
 		/* do we have a node for this entry? */
 		for (indexSubnodes = 0; indexSubnodes < nbSubnodes; indexSubnodes++)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080918/57cff21a/attachment.html 


More information about the macports-changes mailing list