Patch to avoid mingw compiler warnings
Closed / Fixed219098ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:10:43
OriginalBugID: 5794 Bug
Version: 8.4a1
SubmitDate: '2000-06-02'
LastModified: '2000-06-13'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: All Windows
FixedDate: '2000-06-13'
FixedInVersion: 8.4a2
ClosedDate: '2000-10-25'
Name:
Mo
CVS:
Fri Jun 2
ReproducibleScript:
When I compile Tcl from the CVS under mingw, I get a bunch of warnings.
DesiredBehavior:
No warnings.
Patch:
Index: win/tclWinDde.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinDde.c,v
retrieving revision 1.5
diff -u -r1.5 tclWinDde.c
--- tclWinDde.c1999/06/26 22:41:531.5
+++ tclWinDde.c2000/06/02 12:06:08
@@ -733,7 +733,6 @@
{
HSZ ddeTopic, ddeService;
HCONV ddeConv;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
ddeService = DdeCreateStringHandle(ddeInstance, "TclEval", 0);
ddeTopic = DdeCreateStringHandle(ddeInstance, name, 0);
Index: win/tclWinInit.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinInit.c,v
retrieving revision 1.22
diff -u -r1.22 tclWinInit.c
--- tclWinInit.c2000/03/31 08:52:311.22
+++ tclWinInit.c2000/06/02 12:06:08
@@ -88,7 +88,6 @@
static voidAppendEnvironment(Tcl_Obj *listPtr, CONST char *lib);
static voidAppendDllPath(Tcl_Obj *listPtr, HMODULE hModule,
CONST char *lib);
-static voidAppendRegistry(Tcl_Obj *listPtr, CONST char *lib);
static intToUtf(CONST WCHAR *wSrc, char *dst);
/*
@@ -622,7 +621,7 @@
Tcl_DStringSetLength(&ds, 100);
if (TclGetEnv("USERNAME", &ds) == NULL) {
-if (GetUserName(Tcl_DStringValue(&ds), &Tcl_DStringLength(&ds)) == 0) {
+if (GetUserName(Tcl_DStringValue(&ds), (LPDWORD) &Tcl_DStringLength(&ds)) == 0) {
Tcl_DStringSetLength(&ds, 0);
}
}
Index: win/tclWinNotify.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinNotify.c,v
retrieving revision 1.5
diff -u -r1.5 tclWinNotify.c
--- tclWinNotify.c1999/07/02 22:08:281.5
+++ tclWinNotify.c2000/06/02 12:06:08
@@ -20,8 +20,6 @@
* The follwing static indicates whether this module has been initialized.
*/
-static int initialized = 0;
-
#define INTERVAL_TIMER 1/* Handle of interval timer. */
#define WM_WAKEUP WM_USER/* Message that is send by
@@ -468,7 +466,7 @@
* propagate the quit message and start unwinding.
*/
- PostQuitMessage(msg.wParam);
+ PostQuitMessage((int) msg.wParam);
status = -1;
} else if (result == -1) {
/*
@@ -510,5 +508,5 @@
Tcl_Sleep(ms)
int ms;/* Number of milliseconds to sleep. */
{
- Sleep(ms);
+ Sleep((DWORD) ms);
}
Index: win/tclWinPipe.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinPipe.c,v
retrieving revision 1.11
diff -u -r1.11 tclWinPipe.c
--- tclWinPipe.c2000/04/11 21:42:121.11
+++ tclWinPipe.c2000/06/02 12:06:10
@@ -1194,7 +1194,7 @@
if ((*tclWinProcs->createProcessProc)(NULL,
(TCHAR *) Tcl_DStringValue(&cmdLine), NULL, NULL, TRUE,
- createFlags, NULL, NULL, &startInfo, &procInfo) == 0) {
+ (DWORD) createFlags, NULL, NULL, &startInfo, &procInfo) == 0) {
TclWinConvertError(GetLastError());
Tcl_AppendResult(interp, "couldn't execute \"", argv[0],
"\": ", Tcl_PosixError(interp), (char *) NULL);
@@ -2112,9 +2112,9 @@
ckfree(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = ckalloc((unsigned int) toWrite);
}
-memcpy(infoPtr->writeBuf, buf, toWrite);
+memcpy(infoPtr->writeBuf, buf, (size_t) toWrite);
infoPtr->toWrite = toWrite;
ResetEvent(infoPtr->writable);
SetEvent(infoPtr->startWriter);
@@ -2357,7 +2357,7 @@
int options)
{
ProcInfo *infoPtr, **prevPtrPtr;
- int flags;
+ DWORD flags;
Tcl_Pid result;
DWORD ret;
Index: win/tclWinReg.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinReg.c,v
retrieving revision 1.11
diff -u -r1.11 tclWinReg.c
--- tclWinReg.c2000/03/31 08:52:321.11
+++ tclWinReg.c2000/06/02 12:06:11
@@ -367,7 +367,7 @@
*/
keyName = Tcl_GetStringFromObj(keyNameObj, &length);
- buffer = ckalloc(length + 1);
+ buffer = ckalloc((unsigned int) length + 1);
strcpy(buffer, keyName);
if (ParseKeyName(interp, buffer, &hostName, &rootKey, &keyName)
@@ -621,7 +621,7 @@
*/
if (type > lastType || type < 0) {
-Tcl_SetIntObj(resultPtr, type);
+Tcl_SetIntObj(resultPtr, (int) type);
} else {
Tcl_SetStringObj(resultPtr, typeNames[type], -1);
}
@@ -680,7 +680,7 @@
Tcl_DStringInit(&data);
length = TCL_DSTRING_STATIC_SIZE - 1;
- Tcl_DStringSetLength(&data, length);
+ Tcl_DStringSetLength(&data, (int) length);
resultPtr = Tcl_GetObjResult(interp);
@@ -696,7 +696,7 @@
* Required for HKEY_PERFORMANCE_DATA
*/
length *= 2;
- Tcl_DStringSetLength(&data, length);
+ Tcl_DStringSetLength(&data, (int) length);
result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL,
&type, (BYTE *) Tcl_DStringValue(&data), &length);
}
@@ -719,7 +719,7 @@
*/
if (type == REG_DWORD || type == REG_DWORD_BIG_ENDIAN) {
-Tcl_SetIntObj(resultPtr, ConvertDWORD(type,
+Tcl_SetIntObj(resultPtr, (int) ConvertDWORD(type,
*((DWORD*) Tcl_DStringValue(&data))));
} else if (type == REG_MULTI_SZ) {
char *p = Tcl_DStringValue(&data);
@@ -754,7 +754,7 @@
* Save binary data as a byte array.
*/
-Tcl_SetByteArrayObj(resultPtr, Tcl_DStringValue(&data), length);
+Tcl_SetByteArrayObj(resultPtr, Tcl_DStringValue(&data), (int) length);
}
Tcl_DStringFree(&data);
return result;
@@ -822,7 +822,7 @@
Tcl_DStringInit(&buffer);
Tcl_DStringSetLength(&buffer,
- (regWinProcs->useWide) ? maxSize*2 : maxSize);
+ (int) ((regWinProcs->useWide) ? maxSize*2 : maxSize));
index = 0;
result = TCL_OK;
@@ -847,7 +847,7 @@
size *= 2;
}
-Tcl_WinTCharToUtf((TCHAR *) Tcl_DStringValue(&buffer), size, &ds);
+Tcl_WinTCharToUtf((TCHAR *) Tcl_DStringValue(&buffer), (int) size, &ds);
name = Tcl_DStringValue(&ds);
if (!pattern || Tcl_StringMatch(name, pattern)) {
result = Tcl_ListObjAppendElement(interp, resultPtr,
@@ -901,7 +901,7 @@
DWORD result;
keyName = Tcl_GetStringFromObj(keyNameObj, &length);
- buffer = ckalloc(length + 1);
+ buffer = ckalloc((unsigned int) length + 1);
strcpy(buffer, keyName);
result = ParseKeyName(interp, buffer, &hostName, &rootKey, &keyName);
@@ -1135,7 +1135,7 @@
Tcl_DStringInit(&subkey);
Tcl_DStringSetLength(&subkey,
- (regWinProcs->useWide) ? maxSize * 2 : maxSize);
+ (int) ((regWinProcs->useWide) ? maxSize * 2 : maxSize));
while (result == ERROR_SUCCESS) {
/*
@@ -1272,7 +1272,7 @@
length = Tcl_DStringLength(&buf) + 1;
result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type,
-(BYTE*)data, length);
+(BYTE*)data, (DWORD) length);
Tcl_DStringFree(&buf);
} else {
char *data;
@@ -1283,7 +1283,7 @@
data = Tcl_GetByteArrayFromObj(dataObj, &length);
result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type,
-(BYTE *)data, length);
+(BYTE *)data, (DWORD) length);
}
Tcl_DStringFree(&nameBuf);
RegCloseKey(key);
@@ -1346,7 +1346,7 @@
if (error == ERROR_CALL_NOT_IMPLEMENTED) {
msg = "function not supported under Win32s";
} else {
- sprintf(msgBuf, "unknown error: %d", error);
+ sprintf(msgBuf, "unknown error: %ld", error);
msg = msgBuf;
}
} else {
@@ -1371,7 +1371,7 @@
}
}
- sprintf(id, "%d", error);
+ sprintf(id, "%ld", error);
Tcl_SetErrorCode(interp, "WINDOWS", id, msg, (char *) NULL);
Tcl_AppendToObj(resultPtr, msg, length);
Index: win/tclWinThrd.c
===================================================================
RCS file: /cvsroot/tcl/win/tclWinThrd.c,v
retrieving revision 1.10
diff -u -r1.10 tclWinThrd.c
--- tclWinThrd.c2000/05/09 19:13:551.10
+++ tclWinThrd.c2000/06/02 12:06:11
@@ -136,7 +136,7 @@
EnterCriticalSection(&joinLock);
- code = _beginthreadex(NULL, stackSize, proc, clientData, 0,
+ code = _beginthreadex(NULL, (unsigned) stackSize, proc, clientData, 0,
(unsigned *)idPtr);
if (code == 0) {
PatchFiles:
win/tclWinDde.c
win/tclWinInit.c
win/tclWinNotify.c
win/tclWinPipe.c
win/tclWinReg.c
win/tclWinThrd.c
I applied this patch to the sources in CVS; it will go out with 8.4a2. Thanks for the patch,
- eric
-- 06/13/2000 ericm
welch Closed ticket [219098ffff].
[History diff]2000-10-26 08:34:56
Log in (anonymous is fine) to add a comment.