Index: tclUnixNotfy.c
===================================================================
RCS file: /repository/src/ext/tcl/tclUnixNotfy.c,v
retrieving revision 1.2
retrieving revision 1.2.126.1.303.2
diff -u -b -d -r1.2 -r1.2.126.1.303.2
--- tclUnixNotfy.c	2001/01/29 20:25:11	1.2
+++ tclUnixNotfy.c	2001/12/04 16:51:46	1.2.126.1.303.2
@@ -410,7 +410,8 @@
 {
     ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
     FileHandler *filePtr;
-    int index, bit;
+    int index;
+    fd_mask bit;
 
     if (tclStubs.tcl_CreateFileHandler != Tcl_CreateFileHandler) {
 	tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData);
@@ -439,7 +440,7 @@
      */
 
     index = fd/(NBBY*sizeof(fd_mask));
-    bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
+    bit = ((unsigned long)1) << (fd%(NBBY*sizeof(fd_mask)));
     if (mask & TCL_READABLE) {
 	tsdPtr->checkMasks[index] |= bit;
     } else {
@@ -482,7 +483,8 @@
     int fd;		/* Stream id for which to remove callback procedure. */
 {
     FileHandler *filePtr, *prevPtr;
-    int index, bit, i;
+    int index, i;
+    fd_mask bit;
     unsigned long flags;
     ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
 
@@ -510,7 +512,7 @@
      */
 
     index = fd/(NBBY*sizeof(fd_mask));
-    bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
+    bit = ((unsigned long)1) << (fd%(NBBY*sizeof(fd_mask)));
 
     if (filePtr->mask & TCL_READABLE) {
 	tsdPtr->checkMasks[index] &= ~bit;
@@ -654,7 +656,8 @@
     FileHandler *filePtr;
     FileHandlerEvent *fileEvPtr;
     struct timeval timeout, *timeoutPtr;
-    int bit, index, mask;
+    int index, mask;
+    fd_mask bit;
 #ifdef TCL_THREADS
     int waitForFiles;
 #else
@@ -790,7 +793,7 @@
     for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL);
 	 filePtr = filePtr->nextPtr) {
 	index = filePtr->fd / (NBBY*sizeof(fd_mask));
-	bit = 1 << (filePtr->fd % (NBBY*sizeof(fd_mask)));
+	bit = ((unsigned long)1) << (filePtr->fd % (NBBY*sizeof(fd_mask)));
 	mask = 0;
 
 	if (tsdPtr->readyMasks[index] & bit) {
@@ -861,7 +864,8 @@
     fd_mask masks[3*MASK_SIZE];
     long *maskPtr = (long *)masks;	/* masks[] cast to type long[] */
     int fds[2];
-    int i, status, index, bit, numFdBits, found, receivePipe, word;
+    int i, status, index, numFdBits, found, receivePipe, word;
+    fd_mask bit;
     struct timeval poll = {0., 0.}, *timePtr;
     int maskSize = 3 * ((MASK_SIZE) / sizeof(long)) * sizeof(fd_mask);
     char buf[2];
@@ -918,7 +922,7 @@
 	memset((VOID *)masks, 0, 3*MASK_SIZE*sizeof(fd_mask));
         numFdBits = receivePipe + 1;
 	index = receivePipe / (NBBY*sizeof(fd_mask));
-	bit = 1 << (receivePipe % (NBBY*sizeof(fd_mask)));
+	bit = ((unsigned long)1) << (receivePipe % (NBBY*sizeof(fd_mask)));
 	masks[index] |= bit;
 
 	/*
