summaryrefslogtreecommitdiffstats
path: root/win/tclWinReg.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-24 14:04:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-24 14:04:21 (GMT)
commit6d3d32f6d373f173eb5a62f8c2c82399f153e7f3 (patch)
tree902c3d660e3e92cd8c62e0fa557c6d8f87204025 /win/tclWinReg.c
parenta4a6708f275b281dc1883b18f5efb8acbe7fa2f3 (diff)
downloadtcl-6d3d32f6d373f173eb5a62f8c2c82399f153e7f3.zip
tcl-6d3d32f6d373f173eb5a62f8c2c82399f153e7f3.tar.gz
tcl-6d3d32f6d373f173eb5a62f8c2c82399f153e7f3.tar.bz2
Update dde and registry (int -> Tcl_Size)
Diffstat (limited to 'win/tclWinReg.c')
-rw-r--r--win/tclWinReg.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 4157380..650e88e 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -91,7 +91,7 @@ static DWORD lastType = REG_RESOURCE_LIST;
*/
static void AppendSystemError(Tcl_Interp *interp, DWORD error);
-static int BroadcastValue(Tcl_Interp *interp, int objc,
+static int BroadcastValue(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[]);
static DWORD ConvertDWORD(DWORD type, DWORD value);
static void DeleteCmd(void *clientData);
@@ -118,7 +118,7 @@ static int ParseKeyName(Tcl_Interp *interp, char *name,
static DWORD RecursiveDeleteKey(HKEY hStartKey,
const WCHAR * pKeyName, REGSAM mode);
static int RegistryObjCmd(void *clientData,
- Tcl_Interp *interp, int objc,
+ Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[]);
static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
Tcl_Obj *valueNameObj, Tcl_Obj *dataObj,
@@ -133,7 +133,7 @@ static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj,
# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString
# endif
#define Tcl_Size int
-#define TCL_INDEX_NONE -1
+#define Tcl_CreateObjCommand2 Tcl_CreateObjCommand
#endif
#ifdef __cplusplus
@@ -176,7 +176,7 @@ Registry_Init(
return TCL_ERROR;
}
- cmd = Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd,
+ cmd = Tcl_CreateObjCommand2(interp, "registry", RegistryObjCmd,
interp, DeleteCmd);
Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, cmd);
return Tcl_PkgProvideEx(interp, "registry", "1.3.7", NULL);
@@ -219,9 +219,9 @@ Registry_Unload(
* Unregister the registry package. There is no Tcl_PkgForget()
*/
- objv[0] = Tcl_NewStringObj("package", TCL_INDEX_NONE);
- objv[1] = Tcl_NewStringObj("forget", TCL_INDEX_NONE);
- objv[2] = Tcl_NewStringObj("registry", TCL_INDEX_NONE);
+ objv[0] = Tcl_NewStringObj("package", -1);
+ objv[1] = Tcl_NewStringObj("forget", -1);
+ objv[2] = Tcl_NewStringObj("registry", -1);
Tcl_EvalObjv(interp, 3, objv, TCL_EVAL_GLOBAL);
/*
@@ -291,11 +291,11 @@ static int
RegistryObjCmd(
void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
- int n = 1;
- int index, argc;
+ Tcl_Size n = 1, argc;
+ int index;
REGSAM mode = 0;
const char *errString = NULL;
@@ -461,7 +461,7 @@ DeleteKey(
if (*keyName == '\0') {
Tcl_SetObjResult(interp,
- Tcl_NewStringObj("bad key: cannot delete root keys", TCL_INDEX_NONE));
+ Tcl_NewStringObj("bad key: cannot delete root keys", -1));
Tcl_SetErrorCode(interp, "WIN_REG", "DEL_ROOT_KEY", (void *)NULL);
Tcl_Free(buffer);
return TCL_ERROR;
@@ -483,7 +483,7 @@ DeleteKey(
return TCL_OK;
}
Tcl_SetObjResult(interp,
- Tcl_NewStringObj("unable to delete key: ", TCL_INDEX_NONE));
+ Tcl_NewStringObj("unable to delete key: ", -1));
AppendSystemError(interp, result);
return TCL_ERROR;
}
@@ -493,13 +493,13 @@ DeleteKey(
*/
Tcl_DStringInit(&buf);
- nativeTail = Tcl_UtfToWCharDString(tail, TCL_INDEX_NONE, &buf);
+ nativeTail = Tcl_UtfToWCharDString(tail, -1, &buf);
result = RecursiveDeleteKey(subkey, nativeTail, saveMode);
Tcl_DStringFree(&buf);
if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
Tcl_SetObjResult(interp,
- Tcl_NewStringObj("unable to delete key: ", TCL_INDEX_NONE));
+ Tcl_NewStringObj("unable to delete key: ", -1));
AppendSystemError(interp, result);
result = TCL_ERROR;
} else {
@@ -731,7 +731,7 @@ GetType(
if (type > lastType) {
Tcl_SetObjResult(interp, Tcl_NewIntObj((int) type));
} else {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(typeNames[type], TCL_INDEX_NONE));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(typeNames[type], -1));
}
return TCL_OK;
}
@@ -995,7 +995,7 @@ OpenKey(
result = OpenSubKey(hostName, rootKey, keyName, mode, flags, keyPtr);
if (result != ERROR_SUCCESS) {
Tcl_SetObjResult(interp,
- Tcl_NewStringObj("unable to open key: ", TCL_INDEX_NONE));
+ Tcl_NewStringObj("unable to open key: ", -1));
AppendSystemError(interp, result);
result = TCL_ERROR;
} else {
@@ -1043,7 +1043,7 @@ OpenSubKey(
if (hostName) {
Tcl_DStringInit(&buf);
- hostName = (char *) Tcl_UtfToWCharDString(hostName, TCL_INDEX_NONE, &buf);
+ hostName = (char *) Tcl_UtfToWCharDString(hostName, -1, &buf);
result = RegConnectRegistryW((WCHAR *)hostName, rootKey,
&rootKey);
Tcl_DStringFree(&buf);
@@ -1059,7 +1059,7 @@ OpenSubKey(
if (keyName) {
Tcl_DStringInit(&buf);
- keyName = (char *) Tcl_UtfToWCharDString(keyName, TCL_INDEX_NONE, &buf);
+ keyName = (char *) Tcl_UtfToWCharDString(keyName, -1, &buf);
}
if (flags & REG_CREATE) {
DWORD create;
@@ -1163,7 +1163,7 @@ ParseKeyName(
* Look for a matching root name.
*/
- rootObj = Tcl_NewStringObj(rootName, TCL_INDEX_NONE);
+ rootObj = Tcl_NewStringObj(rootName, -1);
result = Tcl_GetIndexFromObj(interp, rootObj, rootKeyNames, "root name",
TCL_EXACT, &index);
Tcl_DecrRefCount(rootObj);
@@ -1399,7 +1399,7 @@ SetValue(
if (result != ERROR_SUCCESS) {
Tcl_SetObjResult(interp,
- Tcl_NewStringObj("unable to set value: ", TCL_INDEX_NONE));
+ Tcl_NewStringObj("unable to set value: ", -1));
AppendSystemError(interp, result);
return TCL_ERROR;
}
@@ -1426,7 +1426,7 @@ SetValue(
static int
BroadcastValue(
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
LRESULT result;