summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authornijtmans <nijtmans>2007-02-20 23:24:02 (GMT)
committernijtmans <nijtmans>2007-02-20 23:24:02 (GMT)
commit6ad116f411885307607d5bebcd6a987ebfafff40 (patch)
tree2fc3ee74f9099dbc66a0d0d154665561411fd654 /win
parent7ae3600bbf1577f02278766a0cca9d439a933bf9 (diff)
downloadtcl-6ad116f411885307607d5bebcd6a987ebfafff40.zip
tcl-6ad116f411885307607d5bebcd6a987ebfafff40.tar.gz
tcl-6ad116f411885307607d5bebcd6a987ebfafff40.tar.bz2
various "const" additions, in line with TIP #27
Diffstat (limited to 'win')
-rw-r--r--win/tclWinPipe.c34
-rw-r--r--win/tclWinSock.c28
2 files changed, 31 insertions, 31 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 1795d3a..b27a762 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.64 2006/03/29 01:22:49 hobbs Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.65 2007/02/20 23:24:07 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -180,7 +180,7 @@ typedef struct PipeEvent {
static int ApplicationType(Tcl_Interp *interp,
const char *fileName, char *fullName);
static void BuildCommandLine(const char *executable, int argc,
- CONST char **argv, Tcl_DString *linePtr);
+ const char **argv, Tcl_DString *linePtr);
static BOOL HasConsole(void);
static int PipeBlockModeProc(ClientData instanceData, int mode);
static void PipeCheckProc(ClientData clientData, int flags);
@@ -193,7 +193,7 @@ static void PipeInit(void);
static int PipeInputProc(ClientData instanceData, char *buf,
int toRead, int *errorCode);
static int PipeOutputProc(ClientData instanceData,
- CONST char *buf, int toWrite, int *errorCode);
+ const char *buf, int toWrite, int *errorCode);
static DWORD WINAPI PipeReaderThread(LPVOID arg);
static void PipeSetupProc(ClientData clientData, int flags);
static void PipeWatchProc(ClientData instanceData, int mask);
@@ -549,13 +549,13 @@ TclpMakeFile(
TclFile
TclpOpenFile(
- CONST char *path, /* The name of the file to open. */
+ const char *path, /* The name of the file to open. */
int mode) /* In what mode to open the file? */
{
HANDLE handle;
DWORD accessMode, createMode, shareMode, flags;
Tcl_DString ds;
- CONST TCHAR *nativePath;
+ const TCHAR *nativePath;
/*
* Map the access bits to the NT access mode.
@@ -670,10 +670,10 @@ TclpOpenFile(
TclFile
TclpCreateTempFile(
- CONST char *contents) /* String to write into temp file, or NULL. */
+ const char *contents) /* String to write into temp file, or NULL. */
{
WCHAR name[MAX_PATH];
- CONST char *native;
+ const char *native;
Tcl_DString dstring;
HANDLE handle;
@@ -694,7 +694,7 @@ TclpCreateTempFile(
if (contents != NULL) {
DWORD result, length;
- CONST char *p;
+ const char *p;
/*
* Convert the contents from UTF to native encoding
@@ -932,7 +932,7 @@ TclpCreateProcess(
* Error messages from the child process
* itself are sent to errorFile. */
int argc, /* Number of arguments in following array. */
- CONST char **argv, /* Array of argument strings. argv[0] contains
+ const char **argv, /* Array of argument strings. argv[0] contains
* the name of the executable converted to
* native format (using the
* Tcl_TranslateFileName call). Additional
@@ -1377,7 +1377,7 @@ ApplicationType(
DWORD attr, read;
IMAGE_DOS_HEADER header;
Tcl_DString nameBuf, ds;
- CONST TCHAR *nativeName;
+ const TCHAR *nativeName;
WCHAR nativeFullPath[MAX_PATH];
static char extensions[][5] = {"", ".com", ".exe", ".bat"};
@@ -1538,14 +1538,14 @@ ApplicationType(
static void
BuildCommandLine(
- CONST char *executable, /* Full path of executable (including
+ const char *executable, /* Full path of executable (including
* extension). Replacement for argv[0]. */
int argc, /* Number of arguments. */
- CONST char **argv, /* Argument strings in UTF. */
+ const char **argv, /* Argument strings in UTF. */
Tcl_DString *linePtr) /* Initialized Tcl_DString that receives the
* command line (TCHAR). */
{
- CONST char *arg, *start, *special;
+ const char *arg, *start, *special;
int quote, i;
Tcl_DString ds;
@@ -1770,7 +1770,7 @@ TclGetAndDetachPids(
Tcl_Channel chan)
{
PipeInfo *pipePtr;
- Tcl_ChannelType *chanTypePtr;
+ const Tcl_ChannelType *chanTypePtr;
int i;
char buf[TCL_INTEGER_SPACE];
@@ -2195,7 +2195,7 @@ PipeInputProc(
static int
PipeOutputProc(
ClientData instanceData, /* Pipe state. */
- CONST char *buf, /* The data buffer. */
+ const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCode) /* Where to store error code. */
{
@@ -2685,10 +2685,10 @@ Tcl_PidObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Argument strings. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
Tcl_Channel chan;
- Tcl_ChannelType *chanTypePtr;
+ const Tcl_ChannelType *chanTypePtr;
PipeInfo *pipePtr;
int i;
Tcl_Obj *resultPtr;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 9b609a2..d46bfc0 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.56 2007/01/02 18:43:51 dkf Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.57 2007/02/20 23:24:07 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -229,10 +229,10 @@ static WNDCLASS windowClass;
*/
static SocketInfo * CreateSocket(Tcl_Interp *interp, int port,
- CONST char *host, int server, CONST char *myaddr,
+ const char *host, int server, const char *myaddr,
int myport, int async);
static int CreateSocketAddress(LPSOCKADDR_IN sockaddrPtr,
- CONST char *host, int port);
+ const char *host, int port);
static void InitSockets(void);
static SocketInfo * NewSocketInfo(SOCKET socket);
static void SocketExitHandler(ClientData clientData);
@@ -1069,10 +1069,10 @@ static SocketInfo *
CreateSocket(
Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port, /* Port number to open. */
- CONST char *host, /* Name of host on which to open port. */
+ const char *host, /* Name of host on which to open port. */
int server, /* 1 if socket should be a server socket, else
* 0 for a client socket. */
- CONST char *myaddr, /* Optional client-side address */
+ const char *myaddr, /* Optional client-side address */
int myport, /* Optional client-side port */
int async) /* If nonzero, connect client socket
* asynchronously. */
@@ -1265,7 +1265,7 @@ CreateSocket(
static int
CreateSocketAddress(
LPSOCKADDR_IN sockaddrPtr, /* Socket address */
- CONST char *host, /* Host. NULL implies INADDR_ANY */
+ const char *host, /* Host. NULL implies INADDR_ANY */
int port) /* Port number */
{
struct hostent *hostent; /* Host database entry */
@@ -1406,8 +1406,8 @@ Tcl_Channel
Tcl_OpenTcpClient(
Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port, /* Port number to open. */
- CONST char *host, /* Host on which to open port. */
- CONST char *myaddr, /* Client-side address */
+ const char *host, /* Host on which to open port. */
+ const char *myaddr, /* Client-side address */
int myport, /* Client-side port */
int async) /* If nonzero, should connect client socket
* asynchronously. */
@@ -1521,7 +1521,7 @@ Tcl_Channel
Tcl_OpenTcpServer(
Tcl_Interp *interp, /* For error reporting - may be NULL. */
int port, /* Port number to open. */
- CONST char *host, /* Name of local host. */
+ const char *host, /* Name of local host. */
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
@@ -1813,7 +1813,7 @@ TcpInputProc(
static int
TcpOutputProc(
ClientData instanceData, /* The socket state. */
- CONST char *buf, /* Where to get data. */
+ const char *buf, /* Where to get data. */
int toWrite, /* Maximum number of bytes to write. */
int *errorCodePtr) /* Where to store error codes. */
{
@@ -1923,8 +1923,8 @@ static int
TcpSetOptionProc(
ClientData instanceData, /* Socket state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
- CONST char *optionName, /* Name of the option to set. */
- CONST char *value) /* New value for option. */
+ const char *optionName, /* Name of the option to set. */
+ const char *value) /* New value for option. */
{
SocketInfo *infoPtr;
SOCKET sock;
@@ -2020,7 +2020,7 @@ static int
TcpGetOptionProc(
ClientData instanceData, /* Socket state. */
Tcl_Interp *interp, /* For error reporting - can be NULL */
- CONST char *optionName, /* Name of the option to retrieve the value
+ const char *optionName, /* Name of the option to retrieve the value
* for, or NULL to get all options and their
* values. */
Tcl_DString *dsPtr) /* Where to store the computed value;
@@ -2529,7 +2529,7 @@ SocketProc(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tcl_GetHostName(void)
{
return Tcl_GetString(TclGetProcessGlobalValue(&hostName));