summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-21 08:07:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-21 08:07:40 (GMT)
commit07bdaceb97e059a802ca158f1661c23e651ec949 (patch)
tree1ed1f0a3e8be5199be20e9651bf3251f474087b3
parent040753e40a5a86ac36162436f039def7a7238dc9 (diff)
parentdbf049c0fba4506927b17c7ff9f7d66aa61cde18 (diff)
downloadtcl-jn_no_struct_names.zip
tcl-jn_no_struct_names.tar.gz
tcl-jn_no_struct_names.tar.bz2
unnecessary hook struct definitionsjn_no_struct_names
-rw-r--r--ChangeLog13
-rw-r--r--generic/tclDecls.h4
-rw-r--r--generic/tclIntDecls.h2
-rw-r--r--generic/tclIntPlatDecls.h2
-rw-r--r--generic/tclOODecls.h4
-rw-r--r--generic/tclOOIntDecls.h2
-rw-r--r--generic/tclPathObj.c9
-rw-r--r--generic/tclPlatDecls.h2
-rw-r--r--generic/tclStubInit.c8
-rw-r--r--generic/tclTomMathDecls.h2
-rw-r--r--tools/genStubs.tcl8
-rw-r--r--win/tclWinPort.h1
-rw-r--r--win/tclWinSock.c18
13 files changed, 37 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 3f2b3b3..e8f96e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2012-08-20 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclPathObj.c: [Bug 3559678] Fix bad filename normalization
+ when the last component is the empty string.
+
+2012-08-20 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinPort.h: Remove wrapper macro for ntohs(): unnecessary,
+ because it doesn't require an initialized winsock_2 library. See:
+ <http://msdn.microsoft.com/en-us/library/windows/desktop/ms740075%28v=vs.85%29.aspx>
+ * win/tclWinSock.c
+ * generic/tclStubInit.c
+
2012-08-17 Jan Nijtmans <nijtmans@users.sf.net>
* win/nmakehlp.c: Add "-V<num>" option, in order to be able
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 1e2a68b..fb4173b 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1808,7 +1808,7 @@ EXTERN void * Tcl_FindSymbol(Tcl_Interp *interp,
EXTERN int Tcl_FSUnloadFile(Tcl_Interp *interp,
Tcl_LoadHandle handlePtr);
-typedef struct TclStubHooks {
+typedef struct {
const struct TclPlatStubs *tclPlatStubs;
const struct TclIntStubs *tclIntStubs;
const struct TclIntPlatStubs *tclIntPlatStubs;
@@ -1816,7 +1816,7 @@ typedef struct TclStubHooks {
typedef struct TclStubs {
int magic;
- const struct TclStubHooks *hooks;
+ const TclStubHooks *hooks;
int (*tcl_PkgProvideEx) (Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 0 */
CONST84_RETURN char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index d01d10a..df5ac97 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -604,7 +604,7 @@ EXTERN void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags,
typedef struct TclIntStubs {
int magic;
- const struct TclIntStubHooks *hooks;
+ void *hooks;
void (*reserved0)(void);
void (*reserved1)(void);
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 7322a37..9fa5764 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -240,7 +240,7 @@ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
typedef struct TclIntPlatStubs {
int magic;
- const struct TclIntPlatStubHooks *hooks;
+ void *hooks;
#if !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
diff --git a/generic/tclOODecls.h b/generic/tclOODecls.h
index 6316303..58871c6 100644
--- a/generic/tclOODecls.h
+++ b/generic/tclOODecls.h
@@ -100,13 +100,13 @@ TCLOOAPI void Tcl_ClassSetDestructor(Tcl_Interp *interp,
TCLOOAPI Tcl_Obj * Tcl_GetObjectName(Tcl_Interp *interp,
Tcl_Object object);
-typedef struct TclOOStubHooks {
+typedef struct {
const struct TclOOIntStubs *tclOOIntStubs;
} TclOOStubHooks;
typedef struct TclOOStubs {
int magic;
- const struct TclOOStubHooks *hooks;
+ const TclOOStubHooks *hooks;
Tcl_Object (*tcl_CopyObjectInstance) (Tcl_Interp *interp, Tcl_Object sourceObject, const char *targetName, const char *targetNamespaceName); /* 0 */
Tcl_Object (*tcl_GetClassAsObject) (Tcl_Class clazz); /* 1 */
diff --git a/generic/tclOOIntDecls.h b/generic/tclOOIntDecls.h
index c751838..acafb18 100644
--- a/generic/tclOOIntDecls.h
+++ b/generic/tclOOIntDecls.h
@@ -90,7 +90,7 @@ TCLOOAPI void TclOOClassSetMixins(Tcl_Interp *interp,
typedef struct TclOOIntStubs {
int magic;
- const struct TclOOIntStubHooks *hooks;
+ void *hooks;
Tcl_Object (*tclOOGetDefineCmdContext) (Tcl_Interp *interp); /* 0 */
Tcl_Method (*tclOOMakeProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, ClientData clientData, Proc **procPtrPtr); /* 1 */
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 14c61a9..f4d61f2 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1764,7 +1764,7 @@ Tcl_FSGetNormalizedPath(
*/
Tcl_Obj *dir, *copy;
- int cwdLen, pathType;
+ int tailLen, cwdLen, pathType;
pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr);
@@ -1776,7 +1776,12 @@ Tcl_FSGetNormalizedPath(
UpdateStringOfFsPath(pathPtr);
}
- copy = AppendPath(dir, fsPathPtr->normPathPtr);
+ Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &tailLen);
+ if (tailLen) {
+ copy = AppendPath(dir, fsPathPtr->normPathPtr);
+ } else {
+ copy = Tcl_DuplicateObj(dir);
+ }
Tcl_IncrRefCount(dir);
Tcl_IncrRefCount(copy);
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index 48ad390..e9b92fe 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -69,7 +69,7 @@ EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
typedef struct TclPlatStubs {
int magic;
- const struct TclPlatStubHooks *hooks;
+ void *hooks;
#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
TCHAR * (*tcl_WinUtfToTChar) (const char *str, int len, Tcl_DString *dsPtr); /* 0 */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 87cd4eb..7eb1788 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -53,6 +53,8 @@ static int TclSockMinimumBuffersOld(int sock, int size)
}
#endif
+#define TclWinNToHS ntohs
+
#ifdef __WIN32__
# define TclUnixWaitForFile 0
# define TclUnixCopyFile 0
@@ -89,12 +91,6 @@ void *TclWinGetTclInstance()
return hInstance;
}
-unsigned short
-TclWinNToHS(unsigned short ns)
-{
- return ntohs(ns);
-}
-
int
TclWinSetSockOpt(SOCKET s, int level, int optname,
const char *optval, int optlen)
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index 4f6c3bf..ef22153 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -278,7 +278,7 @@ EXTERN int TclBN_mp_cnt_lsb(const mp_int *a);
typedef struct TclTomMathStubs {
int magic;
- const struct TclTomMathStubHooks *hooks;
+ void *hooks;
int (*tclBN_epoch) (void); /* 0 */
int (*tclBN_revision) (void); /* 1 */
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index dea63e6..bbeb4bf 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -986,7 +986,7 @@ proc genStubs::emitHeader {name} {
emitDeclarations $name text
if {[info exists hooks($name)]} {
- append text "\ntypedef struct ${capName}StubHooks {\n"
+ append text "\ntypedef struct {\n"
foreach hook $hooks($name) {
set capHook [string toupper [string index $hook 0]]
append capHook [string range $hook 1 end]
@@ -1000,7 +1000,11 @@ proc genStubs::emitHeader {name} {
append text " int epoch;\n"
append text " int revision;\n"
}
- append text " const struct ${capName}StubHooks *hooks;\n\n"
+ if {[info exists hooks($name)]} {
+ append text " const ${capName}StubHooks *hooks;\n\n"
+ } else {
+ append text " void *hooks;\n\n"
+ }
emitSlots $name text
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index c6ac2b7..48f7894 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -538,7 +538,6 @@ typedef DWORD_PTR * PDWORD_PTR;
#define getservbyname TclWinGetServByName
#define getsockopt TclWinGetSockOpt
-#define ntohs TclWinNToHS
#define setsockopt TclWinSetSockOpt
/* This type is not defined in the Windows headers */
#define socklen_t int
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 62b2f7f..1a74354 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -72,7 +72,6 @@
#undef getservbyname
#undef getsockopt
-#undef ntohs
#undef setsockopt
/*
@@ -2736,23 +2735,6 @@ TclWinSetSockOpt(
return setsockopt(s, level, optname, optval, optlen);
}
-unsigned short
-TclWinNToHS(
- unsigned short netshort)
-{
- /*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- return (unsigned short) -1;
- }
-
- return ntohs(netshort);
-}
-
char *
TclpInetNtoa(
struct in_addr addr)