summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-02-03 23:10:57 (GMT)
committernijtmans <nijtmans>2009-02-03 23:10:57 (GMT)
commit6b40f13d26013e672072cb794817a2d322d8127e (patch)
treea72237070484512e9aa19c3f44b7ed7313fe1086 /unix
parent78da1e5f1b89986ba2526d799110ffc708040c21 (diff)
downloadtcl-6b40f13d26013e672072cb794817a2d322d8127e.zip
tcl-6b40f13d26013e672072cb794817a2d322d8127e.tar.gz
tcl-6b40f13d26013e672072cb794817a2d322d8127e.tar.bz2
- eliminate some unnessary type casts
- some internal const decorations - spacing
Diffstat (limited to 'unix')
-rw-r--r--unix/tclLoadDyld.c14
-rw-r--r--unix/tclUnixCompat.c6
-rw-r--r--unix/tclUnixFCmd.c12
-rw-r--r--unix/tclUnixFile.c7
4 files changed, 20 insertions, 19 deletions
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index 93d29ab..e30742b 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclLoadDyld.c,v 1.30 2008/04/27 22:21:34 dkf Exp $
+ * RCS: @(#) $Id: tclLoadDyld.c,v 1.31 2009/02/03 23:10:57 nijtmans Exp $
*/
#include "tclInt.h"
@@ -629,14 +629,14 @@ TclpLoadMemory(
uint32_t ms = 0;
#ifndef __LP64__
const struct mach_header *mh = NULL;
- #define mh_size sizeof(struct mach_header)
- #define mh_magic MH_MAGIC
- #define arch_abi 0
+# define mh_size sizeof(struct mach_header)
+# define mh_magic MH_MAGIC
+# define arch_abi 0
#else
const struct mach_header_64 *mh = NULL;
- #define mh_size sizeof(struct mach_header_64)
- #define mh_magic MH_MAGIC_64
- #define arch_abi CPU_ARCH_ABI64
+# define mh_size sizeof(struct mach_header_64)
+# define mh_magic MH_MAGIC_64
+# define arch_abi CPU_ARCH_ABI64
#endif
if ((size_t) codeSize >= sizeof(struct fat_header)
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index e61f17d..727eaaf 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -6,7 +6,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixCompat.c,v 1.16 2009/01/09 11:21:46 dkf Exp $
+ * RCS: @(#) $Id: tclUnixCompat.c,v 1.17 2009/02/03 23:10:57 nijtmans Exp $
*
*/
@@ -127,7 +127,7 @@ static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
static int CopyHostent(struct hostent *tgtPtr, char *buf,
int buflen);
static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
-static int CopyString(char *src, char *buf, int buflen);
+static int CopyString(const char *src, char *buf, int buflen);
#endif
#endif /* TCL_THREADS */
@@ -772,7 +772,7 @@ CopyArray(
#ifdef NEED_COPYSTRING
static int
CopyString(
- char *src, /* String to copy. */
+ const char *src, /* String to copy. */
char *buf, /* Buffer to copy into. */
int buflen) /* Size of buffer. */
{
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 2523800..75fc727 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFCmd.c,v 1.71 2008/12/16 23:24:13 nijtmans Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.72 2009/02/03 23:10:57 nijtmans Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -86,7 +86,7 @@ static int SetPermissionsAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj *attributePtr);
static int GetModeFromPermString(Tcl_Interp *interp,
- char *modeStringPtr, mode_t *modePtr);
+ const char *modeStringPtr, mode_t *modePtr);
#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
static int GetReadOnlyAttribute(Tcl_Interp *interp, int objIndex,
Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr);
@@ -1600,7 +1600,7 @@ SetPermissionsAttribute(
mode_t newMode;
int result = TCL_ERROR;
const char *native;
- char *modeStringPtr = TclGetString(attributePtr);
+ const char *modeStringPtr = TclGetString(attributePtr);
int scanned = TclParseAllWhiteSpace(modeStringPtr, -1);
/*
@@ -1713,7 +1713,7 @@ TclpObjListVolumes(void)
static int
GetModeFromPermString(
Tcl_Interp *interp, /* The interp we are using for errors. */
- char *modeStringPtr, /* Permissions string */
+ const char *modeStringPtr, /* Permissions string */
mode_t *modePtr) /* pointer to the mode value */
{
mode_t newMode;
@@ -1906,10 +1906,10 @@ TclpObjNormalizePath(
Tcl_Obj *pathPtr,
int nextCheckpoint)
{
- char *currentPathEndPosition;
+ const char *currentPathEndPosition;
int pathLen;
char cur;
- char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
+ const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
#ifndef NO_REALPATH
char normPath[MAXPATHLEN];
Tcl_DString ds;
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index a24966c..8eabbbb 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.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: tclUnixFile.c,v 1.53 2008/04/27 22:21:34 dkf Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.54 2009/02/03 23:10:57 nijtmans Exp $
*/
#include "tclInt.h"
@@ -314,7 +314,7 @@ TclpMatchInDirectory(
matchHiddenPat = (pattern[0] == '.')
|| ((pattern[0] == '\\') && (pattern[1] == '.'));
- matchHidden = matchHiddenPat
+ matchHidden = matchHiddenPat
|| (types && (types->perm & TCL_GLOB_PERM_HIDDEN));
while ((entryPtr = TclOSreaddir(d)) != NULL) { /* INTL: Native. */
Tcl_DString utfDs;
@@ -1080,7 +1080,8 @@ ClientData
TclNativeCreateNativeRep(
Tcl_Obj *pathPtr)
{
- char *nativePathPtr, *str;
+ char *nativePathPtr;
+ const char *str;
Tcl_DString ds;
Tcl_Obj *validPathPtr;
int len;