diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-12-13 22:43:15 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-12-13 22:43:15 (GMT) |
commit | 47ed8302270238b3263e8c7e6fb103e6c12e4d9c (patch) | |
tree | f5971ca2525b7271645c996adc428790015b1fe6 /win/tclWinReg.c | |
parent | 0def411fa61fa15627a6b3b0cad45918f27ca675 (diff) | |
download | tcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.zip tcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.tar.gz tcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.tar.bz2 |
Export stubs for libtommath; fix mingw compiler warnings
Diffstat (limited to 'win/tclWinReg.c')
-rw-r--r-- | win/tclWinReg.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c index cebb97c..d7d442a 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinReg.c,v 1.34 2005/11/04 00:06:51 dkf Exp $ + * RCS: @(#) $Id: tclWinReg.c,v 1.35 2005/12/13 22:43:18 kennykb Exp $ */ #include "tclInt.h" @@ -818,7 +818,9 @@ GetValue( Tcl_NewStringObj(Tcl_DStringValue(&buf), Tcl_DStringLength(&buf))); if (regWinProcs->useWide) { - while (*((Tcl_UniChar *)p)++ != 0) {} + Tcl_UniChar* up = (Tcl_UniChar*) p; + while (*up++ != 0) {} + p = (char*) up; } else { while (*p++ != '\0') {} } @@ -1256,7 +1258,8 @@ SetValue( Tcl_Obj *dataObj, /* Data to be written. */ Tcl_Obj *typeObj) /* Type of data to be written. */ { - DWORD type, result; + int type; + DWORD result; HKEY key; int length; char *valueName; @@ -1279,15 +1282,16 @@ SetValue( valueName = (char *) Tcl_WinUtfToTChar(valueName, length, &nameBuf); if (type == REG_DWORD || type == REG_DWORD_BIG_ENDIAN) { - DWORD value; - if (Tcl_GetIntFromObj(interp, dataObj, (int*) &value) != TCL_OK) { + int value; + if (Tcl_GetIntFromObj(interp, dataObj, &value) != TCL_OK) { RegCloseKey(key); Tcl_DStringFree(&nameBuf); return TCL_ERROR; } - value = ConvertDWORD(type, value); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + value = ConvertDWORD((DWORD)type, (DWORD)value); + result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, + (DWORD)type, (BYTE*) &value, sizeof(DWORD)); } else if (type == REG_MULTI_SZ) { Tcl_DString data, buf; @@ -1322,7 +1326,8 @@ SetValue( Tcl_WinUtfToTChar(Tcl_DStringValue(&data), Tcl_DStringLength(&data)+1, &buf); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, + (DWORD)type, (BYTE *) Tcl_DStringValue(&buf), (DWORD) Tcl_DStringLength(&buf)); Tcl_DStringFree(&data); @@ -1342,7 +1347,8 @@ SetValue( } length = Tcl_DStringLength(&buf) + 1; - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, + (DWORD)type, (BYTE*)data, (DWORD) length); Tcl_DStringFree(&buf); } else { @@ -1353,7 +1359,8 @@ SetValue( */ data = Tcl_GetByteArrayFromObj(dataObj, &length); - result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, type, + result = (*regWinProcs->regSetValueExProc)(key, valueName, 0, + (DWORD)type, (BYTE *)data, (DWORD) length); } |