mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	dtdocbook: resolve 49 compiler warnings.
This commit is contained in:
		
							parent
							
								
									0a0e1eebf5
								
							
						
					
					
						commit
						93f3878b4e
					
				
					 8 changed files with 48 additions and 47 deletions
				
			
		| 
						 | 
					@ -162,7 +162,7 @@ Browse()
 | 
				
			||||||
	    if (av[1] && isdigit(*av[1])) {
 | 
						    if (av[1] && isdigit(*av[1])) {
 | 
				
			||||||
		n = atoi(av[1]);
 | 
							n = atoi(av[1]);
 | 
				
			||||||
		if (n < ce->ndcont) {
 | 
							if (n < ce->ndcont) {
 | 
				
			||||||
		    printf(ce->dcont[n]);
 | 
							    printf("%s", ce->dcont[n]);
 | 
				
			||||||
		    fputs("\n", stdout);
 | 
							    fputs("\n", stdout);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else if (ce->ndcont == 0)
 | 
							else if (ce->ndcont == 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,6 +47,7 @@
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <tptregexp.h>
 | 
					#include <tptregexp.h>
 | 
				
			||||||
#include "regmagic.h"
 | 
					#include "regmagic.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -671,7 +671,7 @@ Tcl_CreateTimerHandler(milliseconds, proc, clientData)
 | 
				
			||||||
    timerHandlerPtr->proc = proc;
 | 
					    timerHandlerPtr->proc = proc;
 | 
				
			||||||
    timerHandlerPtr->clientData = clientData;
 | 
					    timerHandlerPtr->clientData = clientData;
 | 
				
			||||||
    id++;
 | 
					    id++;
 | 
				
			||||||
    timerHandlerPtr->token = (Tcl_TimerToken) id;
 | 
					    timerHandlerPtr->token = (Tcl_TimerToken) (intptr_t) id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Add the event to the queue in the correct position
 | 
					     * Add the event to the queue in the correct position
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -880,7 +880,7 @@ AliasHelper(curInterp, slaveInterp, masterInterp, masterPtr,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    do {
 | 
					    do {
 | 
				
			||||||
        hPtr = Tcl_CreateHashEntry(&(masterPtr->targetTable),
 | 
					        hPtr = Tcl_CreateHashEntry(&(masterPtr->targetTable),
 | 
				
			||||||
                (char *) aliasCounter, &new);
 | 
					                (char *) (intptr_t) aliasCounter, &new);
 | 
				
			||||||
	aliasCounter++;
 | 
						aliasCounter++;
 | 
				
			||||||
    } while (new == 0);
 | 
					    } while (new == 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -201,7 +201,7 @@ CommonBlockModeProc(instanceData, inFile, outFile, mode)
 | 
				
			||||||
    int fd;
 | 
					    int fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (inFile != NULL) {
 | 
					    if (inFile != NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
        curStatus = fcntl(fd, F_GETFL);
 | 
					        curStatus = fcntl(fd, F_GETFL);
 | 
				
			||||||
        if (mode == TCL_MODE_BLOCKING) {
 | 
					        if (mode == TCL_MODE_BLOCKING) {
 | 
				
			||||||
            curStatus &= (~(O_NONBLOCK));
 | 
					            curStatus &= (~(O_NONBLOCK));
 | 
				
			||||||
| 
						 | 
					@ -214,7 +214,7 @@ CommonBlockModeProc(instanceData, inFile, outFile, mode)
 | 
				
			||||||
        curStatus = fcntl(fd, F_GETFL);
 | 
					        curStatus = fcntl(fd, F_GETFL);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (outFile != NULL) {
 | 
					    if (outFile != NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
        curStatus = fcntl(fd, F_GETFL);
 | 
					        curStatus = fcntl(fd, F_GETFL);
 | 
				
			||||||
        if (mode == TCL_MODE_BLOCKING) {
 | 
					        if (mode == TCL_MODE_BLOCKING) {
 | 
				
			||||||
            curStatus &= (~(O_NONBLOCK));
 | 
					            curStatus &= (~(O_NONBLOCK));
 | 
				
			||||||
| 
						 | 
					@ -262,7 +262,7 @@ FilePipeInputProc(instanceData, inFile, buf, toRead, errorCodePtr)
 | 
				
			||||||
                                         * read from the input device? */
 | 
					                                         * read from the input device? */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *errorCodePtr = 0;
 | 
					    *errorCodePtr = 0;
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Assume there is always enough input available. This will block
 | 
					     * Assume there is always enough input available. This will block
 | 
				
			||||||
| 
						 | 
					@ -311,7 +311,7 @@ FilePipeOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr)
 | 
				
			||||||
    int fd;
 | 
					    int fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *errorCodePtr = 0;
 | 
					    *errorCodePtr = 0;
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
    written = write(fd, buf, (size_t) toWrite);
 | 
					    written = write(fd, buf, (size_t) toWrite);
 | 
				
			||||||
    if (written > -1) {
 | 
					    if (written > -1) {
 | 
				
			||||||
        return written;
 | 
					        return written;
 | 
				
			||||||
| 
						 | 
					@ -356,7 +356,7 @@ FileCloseProc(instanceData, interp, inFile, outFile)
 | 
				
			||||||
	if (inFile == outFile) {
 | 
						if (inFile == outFile) {
 | 
				
			||||||
	    outFile = NULL;
 | 
						    outFile = NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
        Tcl_FreeFile(inFile);
 | 
					        Tcl_FreeFile(inFile);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (close(fd) < 0) {
 | 
						if (close(fd) < 0) {
 | 
				
			||||||
| 
						 | 
					@ -365,7 +365,7 @@ FileCloseProc(instanceData, interp, inFile, outFile)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (outFile != NULL) {
 | 
					    if (outFile != NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
        Tcl_FreeFile(outFile);        
 | 
					        Tcl_FreeFile(outFile);        
 | 
				
			||||||
	if ((close(fd) < 0) && (errorCode == 0)) {
 | 
						if ((close(fd) < 0) && (errorCode == 0)) {
 | 
				
			||||||
	    errorCode = errno;
 | 
						    errorCode = errno;
 | 
				
			||||||
| 
						 | 
					@ -412,9 +412,9 @@ FileSeekProc(instanceData, inFile, outFile, offset, mode, errorCodePtr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *errorCodePtr = 0;
 | 
					    *errorCodePtr = 0;
 | 
				
			||||||
    if (inFile != (Tcl_File) NULL) {
 | 
					    if (inFile != (Tcl_File) NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
    } else if (outFile != (Tcl_File) NULL) {
 | 
					    } else if (outFile != (Tcl_File) NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        *errorCodePtr = EFAULT;
 | 
					        *errorCodePtr = EFAULT;
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
| 
						 | 
					@ -509,14 +509,14 @@ PipeCloseProc(instanceData, interp, inFile, outFile)
 | 
				
			||||||
    errorCode = 0;
 | 
					    errorCode = 0;
 | 
				
			||||||
    pipePtr = (PipeState *) instanceData;
 | 
					    pipePtr = (PipeState *) instanceData;
 | 
				
			||||||
    if (pipePtr->readFile != NULL) {
 | 
					    if (pipePtr->readFile != NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(pipePtr->readFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(pipePtr->readFile, NULL);
 | 
				
			||||||
        Tcl_FreeFile(pipePtr->readFile);
 | 
					        Tcl_FreeFile(pipePtr->readFile);
 | 
				
			||||||
	if (close(fd) < 0) {
 | 
						if (close(fd) < 0) {
 | 
				
			||||||
	    errorCode = errno;
 | 
						    errorCode = errno;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (pipePtr->writeFile != NULL) {
 | 
					    if (pipePtr->writeFile != NULL) {
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(pipePtr->writeFile, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(pipePtr->writeFile, NULL);
 | 
				
			||||||
        Tcl_FreeFile(pipePtr->writeFile);
 | 
					        Tcl_FreeFile(pipePtr->writeFile);
 | 
				
			||||||
	if ((close(fd) < 0) && (errorCode == 0)) {
 | 
						if ((close(fd) < 0) && (errorCode == 0)) {
 | 
				
			||||||
	    errorCode = errno;
 | 
						    errorCode = errno;
 | 
				
			||||||
| 
						 | 
					@ -626,7 +626,7 @@ Tcl_OpenFileChannel(interp, fileName, modeString, permissions)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    sprintf(channelName, "file%d", fd);
 | 
					    sprintf(channelName, "file%d", fd);
 | 
				
			||||||
    file = Tcl_GetFile((ClientData) fd, TCL_UNIX_FD);
 | 
					    file = Tcl_GetFile((ClientData) (intptr_t) fd, TCL_UNIX_FD);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    chan = Tcl_CreateChannel(&fileChannelType, channelName,
 | 
					    chan = Tcl_CreateChannel(&fileChannelType, channelName,
 | 
				
			||||||
            (channelPermissions & TCL_READABLE) ? file : NULL,
 | 
					            (channelPermissions & TCL_READABLE) ? file : NULL,
 | 
				
			||||||
| 
						 | 
					@ -698,12 +698,12 @@ Tcl_MakeFileChannel(inFd, outFd, mode)
 | 
				
			||||||
    outFile = (Tcl_File) NULL;
 | 
					    outFile = (Tcl_File) NULL;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (mode & TCL_READABLE) {
 | 
					    if (mode & TCL_READABLE) {
 | 
				
			||||||
	sprintf(channelName, "file%d", (int) inFd);
 | 
						sprintf(channelName, "file%d", (int) (intptr_t) inFd);
 | 
				
			||||||
        inFile = Tcl_GetFile(inFd, TCL_UNIX_FD);
 | 
					        inFile = Tcl_GetFile(inFd, TCL_UNIX_FD);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (mode & TCL_WRITABLE) {
 | 
					    if (mode & TCL_WRITABLE) {
 | 
				
			||||||
	sprintf(channelName, "file%d", (int) outFd);
 | 
						sprintf(channelName, "file%d", (int) (intptr_t) outFd);
 | 
				
			||||||
        outFile = Tcl_GetFile(outFd, TCL_UNIX_FD);
 | 
					        outFile = Tcl_GetFile(outFd, TCL_UNIX_FD);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -758,11 +758,11 @@ TclCreateCommandChannel(readFile, writeFile, errorFile, numPids, pidPtr)
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (readFile) {
 | 
					    if (readFile) {
 | 
				
			||||||
	channelId = (int) Tcl_GetFileInfo(readFile, NULL);
 | 
						channelId = (int) (intptr_t) Tcl_GetFileInfo(readFile, NULL);
 | 
				
			||||||
    } else if (writeFile) {
 | 
					    } else if (writeFile) {
 | 
				
			||||||
	channelId = (int) Tcl_GetFileInfo(writeFile, NULL);
 | 
						channelId = (int) (intptr_t) Tcl_GetFileInfo(writeFile, NULL);
 | 
				
			||||||
    } else if (errorFile) {
 | 
					    } else if (errorFile) {
 | 
				
			||||||
	channelId = (int) Tcl_GetFileInfo(errorFile, NULL);
 | 
						channelId = (int) (intptr_t) Tcl_GetFileInfo(errorFile, NULL);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
	channelId = 0;
 | 
						channelId = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -926,7 +926,7 @@ WaitForConnect(statePtr, fileToWaitFor, errorCodePtr)
 | 
				
			||||||
        state = TclWaitForFile(fileToWaitFor, TCL_WRITABLE | TCL_EXCEPTION,
 | 
					        state = TclWaitForFile(fileToWaitFor, TCL_WRITABLE | TCL_EXCEPTION,
 | 
				
			||||||
                timeOut);
 | 
					                timeOut);
 | 
				
			||||||
        if (!(statePtr->flags & TCP_ASYNC_SOCKET)) {
 | 
					        if (!(statePtr->flags & TCP_ASYNC_SOCKET)) {
 | 
				
			||||||
            sock = (int) Tcl_GetFileInfo(statePtr->sock, NULL);
 | 
					            sock = (int) (intptr_t) Tcl_GetFileInfo(statePtr->sock, NULL);
 | 
				
			||||||
            flags = fcntl(sock, F_GETFL);
 | 
					            flags = fcntl(sock, F_GETFL);
 | 
				
			||||||
            flags &= (~(O_NONBLOCK));
 | 
					            flags &= (~(O_NONBLOCK));
 | 
				
			||||||
            (void) fcntl(sock, F_SETFL, flags);
 | 
					            (void) fcntl(sock, F_SETFL, flags);
 | 
				
			||||||
| 
						 | 
					@ -982,7 +982,7 @@ TcpInputProc(instanceData, inFile, buf, bufSize, errorCodePtr)
 | 
				
			||||||
    int state;				/* Of waiting for connection. */
 | 
					    int state;				/* Of waiting for connection. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *errorCodePtr = 0;
 | 
					    *errorCodePtr = 0;
 | 
				
			||||||
    sock = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
					    sock = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
    statePtr = (TcpState *) instanceData;
 | 
					    statePtr = (TcpState *) instanceData;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    state = WaitForConnect(statePtr, inFile, errorCodePtr);
 | 
					    state = WaitForConnect(statePtr, inFile, errorCodePtr);
 | 
				
			||||||
| 
						 | 
					@ -1040,7 +1040,7 @@ TcpOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr)
 | 
				
			||||||
    int state;				/* Of waiting for connection. */
 | 
					    int state;				/* Of waiting for connection. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *errorCodePtr = 0;
 | 
					    *errorCodePtr = 0;
 | 
				
			||||||
    sock = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
					    sock = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
    statePtr = (TcpState *) instanceData;
 | 
					    statePtr = (TcpState *) instanceData;
 | 
				
			||||||
    state = WaitForConnect(statePtr, outFile, errorCodePtr);
 | 
					    state = WaitForConnect(statePtr, outFile, errorCodePtr);
 | 
				
			||||||
    if (state != 0) {
 | 
					    if (state != 0) {
 | 
				
			||||||
| 
						 | 
					@ -1086,7 +1086,7 @@ TcpCloseProc(instanceData, interp, inFile, outFile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    statePtr = (TcpState *) instanceData;
 | 
					    statePtr = (TcpState *) instanceData;
 | 
				
			||||||
    sockFile = statePtr->sock;
 | 
					    sockFile = statePtr->sock;
 | 
				
			||||||
    sock = (int) Tcl_GetFileInfo(sockFile, NULL);
 | 
					    sock = (int) (intptr_t) Tcl_GetFileInfo(sockFile, NULL);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Delete a file handler that may be active for this socket if this
 | 
					     * Delete a file handler that may be active for this socket if this
 | 
				
			||||||
| 
						 | 
					@ -1156,7 +1156,7 @@ TcpGetOptionProc(instanceData, optionName, dsPtr)
 | 
				
			||||||
    char buf[128];
 | 
					    char buf[128];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    statePtr = (TcpState *) instanceData;
 | 
					    statePtr = (TcpState *) instanceData;
 | 
				
			||||||
    sock = (int) Tcl_GetFileInfo(statePtr->sock, NULL);
 | 
					    sock = (int) (intptr_t) Tcl_GetFileInfo(statePtr->sock, NULL);
 | 
				
			||||||
    if (optionName != (char *) NULL) {
 | 
					    if (optionName != (char *) NULL) {
 | 
				
			||||||
        len = strlen(optionName);
 | 
					        len = strlen(optionName);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -1355,7 +1355,7 @@ bindError:
 | 
				
			||||||
    if (asyncConnect) {
 | 
					    if (asyncConnect) {
 | 
				
			||||||
        statePtr->flags = TCP_ASYNC_CONNECT;
 | 
					        statePtr->flags = TCP_ASYNC_CONNECT;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    statePtr->sock = Tcl_GetFile((ClientData) sock, TCL_UNIX_FD);
 | 
					    statePtr->sock = Tcl_GetFile((ClientData) (intptr_t) sock, TCL_UNIX_FD);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    return statePtr;
 | 
					    return statePtr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1478,7 +1478,7 @@ Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async)
 | 
				
			||||||
    statePtr->acceptProcData = (ClientData) NULL;
 | 
					    statePtr->acceptProcData = (ClientData) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sprintf(channelName, "sock%d",
 | 
					    sprintf(channelName, "sock%d",
 | 
				
			||||||
	    (int) Tcl_GetFileInfo(statePtr->sock, NULL));
 | 
						    (int) (intptr_t) Tcl_GetFileInfo(statePtr->sock, NULL));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    chan = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr->sock,
 | 
					    chan = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr->sock,
 | 
				
			||||||
	    statePtr->sock, (ClientData) statePtr);
 | 
						    statePtr->sock, (ClientData) statePtr);
 | 
				
			||||||
| 
						 | 
					@ -1521,7 +1521,7 @@ Tcl_MakeTcpClientChannel(sock)
 | 
				
			||||||
    statePtr->acceptProc = NULL;
 | 
					    statePtr->acceptProc = NULL;
 | 
				
			||||||
    statePtr->acceptProcData = (ClientData) NULL;
 | 
					    statePtr->acceptProcData = (ClientData) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sprintf(channelName, "sock%d", (int) sock);
 | 
					    sprintf(channelName, "sock%d", (int) (intptr_t) sock);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    chan = Tcl_CreateChannel(&tcpChannelType, channelName, sockFile, sockFile,
 | 
					    chan = Tcl_CreateChannel(&tcpChannelType, channelName, sockFile, sockFile,
 | 
				
			||||||
            (ClientData) statePtr);
 | 
					            (ClientData) statePtr);
 | 
				
			||||||
| 
						 | 
					@ -1585,7 +1585,7 @@ Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData)
 | 
				
			||||||
    Tcl_CreateFileHandler(statePtr->sock, TCL_READABLE, TcpAccept,
 | 
					    Tcl_CreateFileHandler(statePtr->sock, TCL_READABLE, TcpAccept,
 | 
				
			||||||
            (ClientData) statePtr);
 | 
					            (ClientData) statePtr);
 | 
				
			||||||
    sprintf(channelName, "sock%d",
 | 
					    sprintf(channelName, "sock%d",
 | 
				
			||||||
	    (int) Tcl_GetFileInfo(statePtr->sock, NULL));
 | 
						    (int) (intptr_t) Tcl_GetFileInfo(statePtr->sock, NULL));
 | 
				
			||||||
    chan = Tcl_CreateChannel(&tcpChannelType, channelName, NULL, NULL,
 | 
					    chan = Tcl_CreateChannel(&tcpChannelType, channelName, NULL, NULL,
 | 
				
			||||||
            (ClientData) statePtr);
 | 
					            (ClientData) statePtr);
 | 
				
			||||||
    return chan;
 | 
					    return chan;
 | 
				
			||||||
| 
						 | 
					@ -1625,13 +1625,13 @@ TcpAccept(data, mask)
 | 
				
			||||||
    sockState = (TcpState *) data;
 | 
					    sockState = (TcpState *) data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    len = sizeof(struct sockaddr_in);
 | 
					    len = sizeof(struct sockaddr_in);
 | 
				
			||||||
    newsock = accept((int) Tcl_GetFileInfo(sockState->sock, NULL),
 | 
					    newsock = accept((int) (intptr_t) Tcl_GetFileInfo(sockState->sock, NULL),
 | 
				
			||||||
	    (struct sockaddr *)&addr, &len);
 | 
						    (struct sockaddr *)&addr, &len);
 | 
				
			||||||
    if (newsock < 0) {
 | 
					    if (newsock < 0) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    newFile = Tcl_GetFile((ClientData) newsock, TCL_UNIX_FD);
 | 
					    newFile = Tcl_GetFile((ClientData) (intptr_t) newsock, TCL_UNIX_FD);
 | 
				
			||||||
    if (newFile) {
 | 
					    if (newFile) {
 | 
				
			||||||
        newSockState = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
 | 
					        newSockState = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1713,7 +1713,7 @@ TclGetDefaultStdChannel(type)
 | 
				
			||||||
	    break;
 | 
						    break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    channel = Tcl_MakeFileChannel((ClientData) fd, (ClientData) fd, mode);
 | 
					    channel = Tcl_MakeFileChannel((ClientData) (intptr_t) fd, (ClientData) (intptr_t) fd, mode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Set up the normal channel options for stdio handles.
 | 
					     * Set up the normal channel options for stdio handles.
 | 
				
			||||||
| 
						 | 
					@ -1755,7 +1755,7 @@ void
 | 
				
			||||||
TclClosePipeFile(file)
 | 
					TclClosePipeFile(file)
 | 
				
			||||||
    Tcl_File file;
 | 
					    Tcl_File file;
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int fd = (int) Tcl_GetFileInfo(file, NULL);
 | 
					    int fd = (int) (intptr_t) Tcl_GetFileInfo(file, NULL);
 | 
				
			||||||
    close(fd);
 | 
					    close(fd);
 | 
				
			||||||
    Tcl_FreeFile(file);
 | 
					    Tcl_FreeFile(file);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1827,7 +1827,7 @@ Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr)
 | 
				
			||||||
            || (chanTypePtr == &tcpChannelType)) {
 | 
					            || (chanTypePtr == &tcpChannelType)) {
 | 
				
			||||||
        tf = Tcl_GetChannelFile(chan,
 | 
					        tf = Tcl_GetChannelFile(chan,
 | 
				
			||||||
                (forWriting ? TCL_WRITABLE : TCL_READABLE));
 | 
					                (forWriting ? TCL_WRITABLE : TCL_READABLE));
 | 
				
			||||||
        fd = (int) Tcl_GetFileInfo(tf, NULL);
 | 
					        fd = (int) (intptr_t) Tcl_GetFileInfo(tf, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /*
 | 
					        /*
 | 
				
			||||||
         * The call to fdopen below is probably dangerous, since it will
 | 
					         * The call to fdopen below is probably dangerous, since it will
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -269,7 +269,7 @@ TclOpenFile(fname, mode)
 | 
				
			||||||
    fd = open(fname, mode, 0600);
 | 
					    fd = open(fname, mode, 0600);
 | 
				
			||||||
    if (fd != -1) {
 | 
					    if (fd != -1) {
 | 
				
			||||||
        fcntl(fd, F_SETFD, FD_CLOEXEC);
 | 
					        fcntl(fd, F_SETFD, FD_CLOEXEC);
 | 
				
			||||||
        return Tcl_GetFile((ClientData)fd, TCL_UNIX_FD);
 | 
					        return Tcl_GetFile((ClientData) (intptr_t) fd, TCL_UNIX_FD);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -298,7 +298,7 @@ TclCloseFile(file)
 | 
				
			||||||
    int fd;
 | 
					    int fd;
 | 
				
			||||||
    int result;
 | 
					    int result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_CloseFile: unexpected file type");
 | 
						panic("Tcl_CloseFile: unexpected file type");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -343,7 +343,7 @@ TclReadFile(file, shouldBlock, buf, toRead)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int type, fd;
 | 
					    int type, fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_ReadFile: unexpected file type");
 | 
						panic("Tcl_ReadFile: unexpected file type");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -377,7 +377,7 @@ TclWriteFile(file, shouldBlock, buf, toWrite)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int type, fd;
 | 
					    int type, fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_WriteFile: unexpected file type");
 | 
						panic("Tcl_WriteFile: unexpected file type");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -410,7 +410,7 @@ TclSeekFile(file, offset, whence)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int type, fd;
 | 
					    int type, fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_SeekFile: unexpected file type");
 | 
						panic("Tcl_SeekFile: unexpected file type");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -449,7 +449,7 @@ TclCreateTempFile(contents)
 | 
				
			||||||
    unlink(fileName);
 | 
					    unlink(fileName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((file != NULL) && (length > 0)) {
 | 
					    if ((file != NULL) && (length > 0)) {
 | 
				
			||||||
	int fd = (int)Tcl_GetFileInfo(file, NULL);
 | 
						int fd = (int) (intptr_t) Tcl_GetFileInfo(file, NULL);
 | 
				
			||||||
	while (1) {
 | 
						while (1) {
 | 
				
			||||||
	    if (write(fd, contents, length) != -1) {
 | 
						    if (write(fd, contents, length) != -1) {
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -101,7 +101,7 @@ Tcl_WatchFile(file, mask)
 | 
				
			||||||
    int fd, type, index;
 | 
					    int fd, type, index;
 | 
				
			||||||
    fd_mask bit;
 | 
					    fd_mask bit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_WatchFile: unexpected file type");
 | 
						panic("Tcl_WatchFile: unexpected file type");
 | 
				
			||||||
| 
						 | 
					@ -159,7 +159,7 @@ Tcl_FileReady(file, mask)
 | 
				
			||||||
    int index, result, type, fd;
 | 
					    int index, result, type, fd;
 | 
				
			||||||
    fd_mask bit;
 | 
					    fd_mask bit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = (int) Tcl_GetFileInfo(file, &type);
 | 
					    fd = (int) (intptr_t) Tcl_GetFileInfo(file, &type);
 | 
				
			||||||
    if (type != TCL_UNIX_FD) {
 | 
					    if (type != TCL_UNIX_FD) {
 | 
				
			||||||
	panic("Tcl_FileReady: unexpected file type");
 | 
						panic("Tcl_FileReady: unexpected file type");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -170,7 +170,7 @@ SetupStdFile(file, type)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (file) {
 | 
					    if (file) {
 | 
				
			||||||
	fd = (int)Tcl_GetFileInfo(file, NULL);
 | 
						fd = (int) (intptr_t) Tcl_GetFileInfo(file, NULL);
 | 
				
			||||||
	if (fd != targetFd) {
 | 
						if (fd != targetFd) {
 | 
				
			||||||
	    if (dup2(fd, targetFd) == -1) {
 | 
						    if (dup2(fd, targetFd) == -1) {
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
| 
						 | 
					@ -450,8 +450,8 @@ TclCreatePipe(readPipe, writePipe)
 | 
				
			||||||
    fcntl(pipeIds[0], F_SETFD, FD_CLOEXEC);
 | 
					    fcntl(pipeIds[0], F_SETFD, FD_CLOEXEC);
 | 
				
			||||||
    fcntl(pipeIds[1], F_SETFD, FD_CLOEXEC);
 | 
					    fcntl(pipeIds[1], F_SETFD, FD_CLOEXEC);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *readPipe = Tcl_GetFile((ClientData)pipeIds[0], TCL_UNIX_FD);
 | 
					    *readPipe = Tcl_GetFile((ClientData) (intptr_t) pipeIds[0], TCL_UNIX_FD);
 | 
				
			||||||
    *writePipe = Tcl_GetFile((ClientData)pipeIds[1], TCL_UNIX_FD);
 | 
					    *writePipe = Tcl_GetFile((ClientData) (intptr_t) pipeIds[1], TCL_UNIX_FD);
 | 
				
			||||||
    return 1;
 | 
					    return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -494,7 +494,7 @@ Tcl_CreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (inPipePtr) {
 | 
					    if (inPipePtr) {
 | 
				
			||||||
	if (inFile) {
 | 
						if (inFile) {
 | 
				
			||||||
	    *inPipePtr = (int) Tcl_GetFileInfo(inFile, NULL);
 | 
						    *inPipePtr = (int) (intptr_t) Tcl_GetFileInfo(inFile, NULL);
 | 
				
			||||||
	    Tcl_FreeFile(inFile);
 | 
						    Tcl_FreeFile(inFile);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
	    *inPipePtr = -1;
 | 
						    *inPipePtr = -1;
 | 
				
			||||||
| 
						 | 
					@ -502,7 +502,7 @@ Tcl_CreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (outPipePtr) {
 | 
					    if (outPipePtr) {
 | 
				
			||||||
	if (outFile) {
 | 
						if (outFile) {
 | 
				
			||||||
	    *outPipePtr = (int) Tcl_GetFileInfo(outFile, NULL);
 | 
						    *outPipePtr = (int) (intptr_t) Tcl_GetFileInfo(outFile, NULL);
 | 
				
			||||||
	    Tcl_FreeFile(outFile);
 | 
						    Tcl_FreeFile(outFile);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
	    *outPipePtr = -1;
 | 
						    *outPipePtr = -1;
 | 
				
			||||||
| 
						 | 
					@ -510,7 +510,7 @@ Tcl_CreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (errFilePtr) {
 | 
					    if (errFilePtr) {
 | 
				
			||||||
	if (errFile) {
 | 
						if (errFile) {
 | 
				
			||||||
	    *errFilePtr = (int) Tcl_GetFileInfo(errFile, NULL);
 | 
						    *errFilePtr = (int) (intptr_t) Tcl_GetFileInfo(errFile, NULL);
 | 
				
			||||||
	    Tcl_FreeFile(errFile);
 | 
						    Tcl_FreeFile(errFile);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
	    *errFilePtr = -1;
 | 
						    *errFilePtr = -1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue