summaryrefslogtreecommitdiffstats
path: root/generic/tkBind.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-24 14:03:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-24 14:03:35 (GMT)
commit60091ce863fdbfbf444d6970d44fb50166ccd6fe (patch)
tree01d9762601541ddc55b930c28b3d547c496b3d67 /generic/tkBind.c
parente59d11829980b85d1a4c263d108f0a601fce5e5b (diff)
parent5a024656faa09acb77aa34603e41b1cd5e38fbe5 (diff)
downloadtk-60091ce863fdbfbf444d6970d44fb50166ccd6fe.zip
tk-60091ce863fdbfbf444d6970d44fb50166ccd6fe.tar.gz
tk-60091ce863fdbfbf444d6970d44fb50166ccd6fe.tar.bz2
Merge 8.6. Change macro names
Diffstat (limited to 'generic/tkBind.c')
-rw-r--r--generic/tkBind.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index bdc1f45..979d61e 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -790,7 +790,7 @@ GetButtonNumber(
}
static Time
-CurrentTimeInMilliSecs()
+CurrentTimeInMilliSecs(void)
{
Tcl_Time now;
Tcl_GetTime(&now);
@@ -942,7 +942,7 @@ ClearList(
static PSEntry *
FreePatSeqEntry(
- PSList *pool,
+ TCL_UNUSED(PSList *),
PSEntry *entry)
{
PSEntry *next = PSList_Next(entry);
@@ -1043,7 +1043,7 @@ MakeListEntry(
assert(TEST_PSENTRY(psPtr));
if (PSList_IsEmpty(pool)) {
- newEntry = ckalloc(sizeof(PSEntry));
+ newEntry = (PSEntry *)ckalloc(sizeof(PSEntry));
newEntry->lastModMaskArr = NULL;
DEBUG(countEntryItems += 1;)
} else {
@@ -1120,7 +1120,7 @@ GetLookupForEvent(
key.object = object;
key.type = eventPtr->xev.type;
hPtr = Tcl_FindHashEntry(&lookupTables->listTable, (char *) &key);
- return hPtr ? Tcl_GetHashValue(hPtr) : NULL;
+ return hPtr ? (PSList *)Tcl_GetHashValue(hPtr) : NULL;
}
/*
@@ -1158,13 +1158,13 @@ ClearLookupTable(
nextPtr = Tcl_NextHashEntry(&search);
if (object) {
- const PatternTableKey *key = Tcl_GetHashKey(&lookupTables->listTable, hPtr);
+ const PatternTableKey *key = (const PatternTableKey *)Tcl_GetHashKey(&lookupTables->listTable, hPtr);
if (key->object != object) {
continue;
}
}
- psList = Tcl_GetHashValue(hPtr);
+ psList = (PSList *)Tcl_GetHashValue(hPtr);
PSList_Move(pool, psList);
ckfree(psList);
DEBUG(countListItems -= 1;)
@@ -1375,7 +1375,7 @@ TkBindInit(
mainPtr->bindingTable = Tk_CreateBindingTable(mainPtr->interp);
- bindInfoPtr = ckalloc(sizeof(BindInfo));
+ bindInfoPtr = (BindInfo *)ckalloc(sizeof(BindInfo));
InitVirtualEventTable(&bindInfoPtr->virtualEventTable);
bindInfoPtr->screenInfo.curDispPtr = NULL;
bindInfoPtr->screenInfo.curScreenIndex = -1;
@@ -1451,7 +1451,7 @@ Tk_CreateBindingTable(
Tcl_Interp *interp) /* Interpreter to associate with the binding table: commands are
* executed in this interpreter. */
{
- BindingTable *bindPtr = ckalloc(sizeof(BindingTable));
+ BindingTable *bindPtr = (BindingTable *)ckalloc(sizeof(BindingTable));
unsigned i;
assert(interp);
@@ -1510,7 +1510,7 @@ Tk_DeleteBindingTable(
PatSeq *nextPtr;
PatSeq *psPtr;
- for (psPtr = Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
+ for (psPtr = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
assert(TEST_PSENTRY(psPtr));
nextPtr = psPtr->nextSeqPtr;
FreePatSeq(psPtr);
@@ -1577,12 +1577,12 @@ InsertPatSeq(
hPtr = Tcl_CreateHashEntry(&lookupTables->listTable, (char *) &key, &isNew);
if (isNew) {
- psList = ckalloc(sizeof(PSList));
+ psList = (PSList *)ckalloc(sizeof(PSList));
PSList_Init(psList);
Tcl_SetHashValue(hPtr, psList);
DEBUG(countListItems += 1;)
} else {
- psList = Tcl_GetHashValue(hPtr);
+ psList = (PSList *)Tcl_GetHashValue(hPtr);
}
psEntry = MakeListEntry(&lookupTables->entryPool, psPtr, 0);
@@ -1670,7 +1670,7 @@ Tk_CreateBinding(
*/
hPtr = Tcl_CreateHashEntry(&bindPtr->objectTable, (char *) object, &isNew);
- psPtr->ptr.nextObj = isNew ? NULL : Tcl_GetHashValue(hPtr);
+ psPtr->ptr.nextObj = isNew ? NULL : (PatSeq *)Tcl_GetHashValue(hPtr);
Tcl_SetHashValue(hPtr, psPtr);
InsertPatSeq(&bindPtr->lookupTables, psPtr);
}
@@ -1680,14 +1680,14 @@ Tk_CreateBinding(
size_t length1 = strlen(oldStr);
size_t length2 = strlen(script);
- newStr = ckalloc(length1 + length2 + 2);
+ newStr = (char *)ckalloc(length1 + length2 + 2);
memcpy(newStr, oldStr, length1);
newStr[length1] = '\n';
memcpy(newStr + length1 + 1, script, length2 + 1);
} else {
size_t length = strlen(script);
- newStr = ckalloc(length + 1);
+ newStr = (char *)ckalloc(length + 1);
memcpy(newStr, script, length + 1);
}
ckfree(oldStr);
@@ -1742,7 +1742,7 @@ Tk_DeleteBinding(
if (!(hPtr = Tcl_FindHashEntry(&bindPtr->objectTable, (char *) object))) {
Tcl_Panic("Tk_DeleteBinding couldn't find object table entry");
}
- prevPtr = Tcl_GetHashValue(hPtr);
+ prevPtr = (PatSeq *)Tcl_GetHashValue(hPtr);
if (prevPtr == psPtr) {
Tcl_SetHashValue(hPtr, psPtr->ptr.nextObj);
} else {
@@ -1843,7 +1843,7 @@ Tk_GetAllBindings(
* For each binding, output information about each of the patterns in its sequence.
*/
- for (psPtr = Tcl_GetHashValue(hPtr); psPtr; psPtr = psPtr->ptr.nextObj) {
+ for (psPtr = (const PatSeq *)Tcl_GetHashValue(hPtr); psPtr; psPtr = psPtr->ptr.nextObj) {
assert(TEST_PSENTRY(psPtr));
Tcl_ListObjAppendElement(NULL, resultObj, GetPatternObj(psPtr));
}
@@ -1882,7 +1882,7 @@ RemovePatSeqFromLookup(
SetupPatternKey(&key, psPtr);
if ((hPtr = Tcl_FindHashEntry(&lookupTables->listTable, (char *) &key))) {
- PSList *psList = Tcl_GetHashValue(hPtr);
+ PSList *psList = (PSList *)Tcl_GetHashValue(hPtr);
PSEntry *psEntry;
TK_DLIST_FOREACH(psEntry, psList) {
@@ -1966,7 +1966,7 @@ DeletePatSeq(
assert(!psPtr->added);
assert(!psPtr->owned);
- prevPtr = Tcl_GetHashValue(psPtr->hPtr);
+ prevPtr = (PatSeq *)Tcl_GetHashValue(psPtr->hPtr);
nextPtr = psPtr->ptr.nextObj;
/*
@@ -2037,7 +2037,7 @@ Tk_DeleteAllBindings(
ClearLookupTable(&bindPtr->lookupTables, object);
ClearPromotionLists(bindPtr, object);
- for (psPtr = Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
+ for (psPtr = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
assert(TEST_PSENTRY(psPtr));
DEBUG(psPtr->added = 0;)
nextPtr = DeletePatSeq(psPtr);
@@ -2362,7 +2362,7 @@ Tk_BindEvent(
if ((size_t) numObjects > SIZE_OF_ARRAY(matchPtrBuf)) {
/* it's unrealistic that the buffer size is too small, but who knows? */
- matchPtrArr = ckalloc(numObjects*sizeof(matchPtrArr[0]));
+ matchPtrArr = (PatSeq **)ckalloc(numObjects*sizeof(matchPtrArr[0]));
}
memset(matchPtrArr, 0, numObjects*sizeof(matchPtrArr[0]));
@@ -2403,8 +2403,8 @@ Tk_BindEvent(
PSList *psSuccList = PromArr_First(bindPtr->promArr);
PatSeq *bestPtr;
- psl[0] = GetLookupForEvent(physTables, curEvent, objArr[k], 1);
- psl[1] = GetLookupForEvent(physTables, curEvent, objArr[k], 0);
+ psl[0] = GetLookupForEvent(physTables, curEvent, (Tcl_Obj *)objArr[k], 1);
+ psl[1] = GetLookupForEvent(physTables, curEvent, (Tcl_Obj *)objArr[k], 0);
assert(psl[0] == NULL || psl[0] != psl[1]);
@@ -3468,7 +3468,7 @@ DeleteVirtualEventTable(
PatSeq *nextPtr;
PatSeq *psPtr;
- for (psPtr = Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
+ for (psPtr = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr; psPtr = nextPtr) {
assert(TEST_PSENTRY(psPtr));
nextPtr = psPtr->nextSeqPtr;
DEBUG(psPtr->owned = 0;)
@@ -3550,7 +3550,7 @@ CreateVirtualEvent(
* Make virtual event own the physical event.
*/
- owned = Tcl_GetHashValue(vhPtr);
+ owned = (PhysOwned *)Tcl_GetHashValue(vhPtr);
if (!PhysOwned_Contains(owned, psPtr)) {
PhysOwned_Append(&owned, psPtr);
@@ -3612,7 +3612,7 @@ DeleteVirtualEvent(
if (!(vhPtr = Tcl_FindHashEntry(&vetPtr->nameTable, virtUid))) {
return TCL_OK;
}
- owned = Tcl_GetHashValue(vhPtr);
+ owned = (PhysOwned *)Tcl_GetHashValue(vhPtr);
eventPSPtr = NULL;
if (eventString) {
@@ -3744,7 +3744,7 @@ GetVirtualEvent(
}
resultObj = Tcl_NewObj();
- owned = Tcl_GetHashValue(vhPtr);
+ owned = (const PhysOwned *)Tcl_GetHashValue(vhPtr);
for (iPhys = 0; iPhys < PhysOwned_Size(owned); ++iPhys) {
Tcl_ListObjAppendElement(NULL, resultObj, GetPatternObj(PhysOwned_Get(owned, iPhys)));
}
@@ -3833,7 +3833,7 @@ HandleEventGenerate(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- union { XEvent general; XVirtualEvent virtual; } event;
+ union { XEvent general; XVirtualEvent virt; } event;
const char *p;
const char *name;
@@ -3936,7 +3936,7 @@ HandleEventGenerate(
} else if (flags & BUTTON) {
event.general.xbutton.button = pat.info;
} else if (flags & VIRTUAL) {
- event.virtual.name = pat.name;
+ event.virt.name = pat.name;
}
}
if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
@@ -4376,7 +4376,7 @@ HandleEventGenerate(
* refcount before firing it into the low-level event subsystem; the
* refcount will be decremented once the event has been processed.
*/
- event.virtual.user_data = userDataObj;
+ event.virt.user_data = userDataObj;
Tcl_IncrRefCount(userDataObj);
}
@@ -4636,7 +4636,7 @@ FindSequence(
assert(lookupTables);
assert(eventString);
- psPtr = ckalloc(PATSEQ_MEMSIZE(patsBufSize));
+ psPtr = (PatSeq *)ckalloc(PATSEQ_MEMSIZE(patsBufSize));
/*
*------------------------------------------------------------------
@@ -4648,7 +4648,7 @@ FindSequence(
if (numPats >= patsBufSize) {
unsigned pos = patPtr - psPtr->pats;
patsBufSize += patsBufSize;
- psPtr = ckrealloc(psPtr, PATSEQ_MEMSIZE(patsBufSize));
+ psPtr = (PatSeq *)ckrealloc(psPtr, PATSEQ_MEMSIZE(patsBufSize));
patPtr = psPtr->pats + pos;
}
@@ -4697,18 +4697,18 @@ FindSequence(
return NULL;
}
if (patsBufSize > numPats) {
- psPtr = ckrealloc(psPtr, PATSEQ_MEMSIZE(numPats));
+ psPtr = (PatSeq *)ckrealloc(psPtr, PATSEQ_MEMSIZE(numPats));
}
patPtr = psPtr->pats;
- psPtr->object = object;
+ psPtr->object = (Tcl_Obj *)object;
SetupPatternKey(&key, psPtr);
hPtr = Tcl_CreateHashEntry(&lookupTables->patternTable, (char *) &key, &isNew);
if (!isNew) {
unsigned sequenceSize = numPats*sizeof(TkPattern);
PatSeq *psPtr2;
- for (psPtr2 = Tcl_GetHashValue(hPtr); psPtr2; psPtr2 = psPtr2->nextSeqPtr) {
+ for (psPtr2 = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr2; psPtr2 = psPtr2->nextSeqPtr) {
assert(TEST_PSENTRY(psPtr2));
if (numPats == psPtr2->numPats && memcmp(patPtr, psPtr2->pats, sequenceSize) == 0) {
ckfree(psPtr);
@@ -4744,7 +4744,7 @@ FindSequence(
psPtr->added = 0;
psPtr->modMaskUsed = (modMask != 0);
psPtr->script = NULL;
- psPtr->nextSeqPtr = Tcl_GetHashValue(hPtr);
+ psPtr->nextSeqPtr = (PatSeq *)Tcl_GetHashValue(hPtr);
psPtr->hPtr = hPtr;
psPtr->ptr.nextObj = NULL;
assert(psPtr->ptr.owners == NULL);
@@ -4886,7 +4886,7 @@ ParseEventDescription(
size = p - field;
if (size >= sizeof(buf)) {
- bufPtr = ckalloc(size + 1);
+ bufPtr = (char *)ckalloc(size + 1);
}
strncpy(bufPtr, field, size);
bufPtr[size] = '\0';
@@ -4918,7 +4918,7 @@ ParseEventDescription(
if (!(hPtr = Tcl_FindHashEntry(&modTable, field))) {
break;
}
- modPtr = Tcl_GetHashValue(hPtr);
+ modPtr = (ModInfo *)Tcl_GetHashValue(hPtr);
patPtr->modMask |= modPtr->mask;
if (modPtr->flags & MULT_CLICKS) {
unsigned i = modPtr->flags & MULT_CLICKS;
@@ -4933,7 +4933,7 @@ ParseEventDescription(
eventFlags = 0;
if ((hPtr = Tcl_FindHashEntry(&eventTable, field))) {
- const EventInfo *eiPtr = Tcl_GetHashValue(hPtr);
+ const EventInfo *eiPtr = (const EventInfo *)Tcl_GetHashValue(hPtr);
patPtr->eventType = eiPtr->type;
eventFlags = flagArray[eiPtr->type];
@@ -5169,7 +5169,7 @@ GetPatternObj(
case ButtonPress:
case ButtonRelease:
assert(patPtr->info <= Button5);
- Tcl_AppendPrintfToObj(patternObj, "-%d", (int) patPtr->info);
+ Tcl_AppendPrintfToObj(patternObj, "-%u", (unsigned) patPtr->info);
break;
#if PRINT_SHORT_MOTION_SYNTAX
case MotionNotify: {
@@ -5257,7 +5257,7 @@ TkKeysymToString(
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&nameTable, (char *)keysym);
if (hPtr) {
- return Tcl_GetHashValue(hPtr);
+ return (const char *)Tcl_GetHashValue(hPtr);
}
#endif /* REDO_KEYSYM_LOOKUP */