diff options
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r-- | unix/tkUnixWm.c | 223 |
1 files changed, 110 insertions, 113 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index f1d1fe0..83b36e3 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -36,7 +36,7 @@ typedef struct ProtocolHandler { } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ - ((unsigned) ((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength)) + ((unsigned)((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength)) /* * Data for [wm attributes] command: @@ -564,10 +564,10 @@ void TkWmNewWindow( TkWindow *winPtr) /* Newly-created top-level window. */ { - register WmInfo *wmPtr; + WmInfo *wmPtr; TkDisplay *dispPtr = winPtr->dispPtr; - wmPtr = ckalloc(sizeof(WmInfo)); + wmPtr = (WmInfo *)ckalloc(sizeof(WmInfo)); memset(wmPtr, 0, sizeof(WmInfo)); wmPtr->winPtr = winPtr; wmPtr->reparent = None; @@ -659,7 +659,7 @@ TkWmMapWindow( TkWindow *winPtr) /* Top-level window that's about to be * mapped. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; XTextProperty textProp; if (wmPtr->flags & WM_NEVER_MAPPED) { @@ -827,7 +827,7 @@ void TkWmDeadWindow( TkWindow *winPtr) /* Top-level window that's being deleted. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; WmInfo *wmPtr2; if (wmPtr == NULL) { @@ -836,7 +836,7 @@ TkWmDeadWindow( if ((WmInfo *) winPtr->dispPtr->firstWmPtr == wmPtr) { winPtr->dispPtr->firstWmPtr = wmPtr->nextPtr; } else { - register WmInfo *prevPtr; + WmInfo *prevPtr; for (prevPtr = (WmInfo *) winPtr->dispPtr->firstWmPtr; ; prevPtr = prevPtr->nextPtr) { @@ -1005,7 +1005,6 @@ TkWmSetClass( *---------------------------------------------------------------------- */ - /* ARGSUSED */ int Tk_WmObjCmd( ClientData clientData, /* Main window associated with interpreter. */ @@ -1013,7 +1012,7 @@ Tk_WmObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = clientData; + Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", @@ -1182,13 +1181,13 @@ Tk_WmObjCmd( static int WmAspectCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int numer1, denom1, numer2, denom2; if ((objc != 3) && (objc != 7)) { @@ -1315,7 +1314,7 @@ WmSetAttribute( SetNetWmState(winPtr, "_NET_WM_STATE_FULLSCREEN", wmPtr->reqState.fullscreen); break; - case _WMATT_LAST_ATTRIBUTE: /* NOTREACHED */ + case _WMATT_LAST_ATTRIBUTE: return TCL_ERROR; } return TCL_OK; @@ -1352,10 +1351,9 @@ WmGetAttribute( return Tcl_NewBooleanObj(wmPtr->attributes.fullscreen); case WMATT_TYPE: return GetNetWmType(winPtr); - case _WMATT_LAST_ATTRIBUTE: /*NOTREACHED*/ + case _WMATT_LAST_ATTRIBUTE: break; } - /*NOTREACHED*/ return NULL; } @@ -1385,7 +1383,7 @@ WmGetAttribute( static int WmAttributesCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -1449,13 +1447,13 @@ WmAttributesCmd( static int WmClientCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; int length; @@ -1486,7 +1484,7 @@ WmClientCmd( if (wmPtr->clientMachine != NULL) { ckfree(wmPtr->clientMachine); } - wmPtr->clientMachine = ckalloc(length + 1); + wmPtr->clientMachine = (char *)ckalloc(length + 1); strcpy(wmPtr->clientMachine, argv3); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XTextProperty textProp; @@ -1541,7 +1539,7 @@ WmColormapwindowsCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Window *cmapList; TkWindow *winPtr2; int count, i, windowObjc, gotToplevel; @@ -1584,7 +1582,7 @@ WmColormapwindowsCmd( != TCL_OK) { return TCL_ERROR; } - cmapList = ckalloc((windowObjc+1) * sizeof(Window)); + cmapList = (Window *)ckalloc((windowObjc+1) * sizeof(Window)); gotToplevel = 0; for (i = 0; i < windowObjc; i++) { Tk_Window mapWin; @@ -1636,13 +1634,13 @@ WmColormapwindowsCmd( static int WmCommandCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; int cmdArgc; const char **cmdArgv; @@ -1705,13 +1703,13 @@ WmCommandCmd( static int WmDeiconifyCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -1755,13 +1753,13 @@ WmDeiconifyCmd( static int WmFocusmodelCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; static const char *const optionStrings[] = { "active", "passive", NULL }; enum options { @@ -1810,13 +1808,13 @@ WmFocusmodelCmd( static int WmForgetCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel or Frame to work with */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + TCL_UNUSED(Tcl_Interp *), /* Current interpreter. */ + TCL_UNUSED(int), /* Number of arguments. */ + TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ { - register Tk_Window frameWin = (Tk_Window) winPtr; + Tk_Window frameWin = (Tk_Window) winPtr; if (Tk_IsTopLevel(frameWin)) { TkFocusJoin(winPtr); @@ -1863,13 +1861,13 @@ WmForgetCmd( static int WmFrameCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Window window; char buf[TCL_INTEGER_SPACE]; @@ -1905,13 +1903,13 @@ WmFrameCmd( static int WmGeometryCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; char xSign, ySign; int width, height; const char *argv3; @@ -1965,13 +1963,13 @@ WmGeometryCmd( static int WmGridCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; if ((objc != 3) && (objc != 7)) { @@ -2070,7 +2068,7 @@ WmGroupCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; WmInfo *wmPtr2; const char *argv3; @@ -2114,7 +2112,7 @@ WmGroupCmd( } wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr); wmPtr->hints.flags |= WindowGroupHint; - wmPtr->leaderName = ckalloc(length + 1); + wmPtr->leaderName = (char *)ckalloc(length + 1); strcpy(wmPtr->leaderName, argv3); } UpdateHints(winPtr); @@ -2140,13 +2138,13 @@ WmGroupCmd( static int WmIconbitmapCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; const char *argv3; @@ -2200,13 +2198,13 @@ WmIconbitmapCmd( static int WmIconifyCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -2275,7 +2273,7 @@ WmIconmaskCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; const char *argv3; @@ -2328,13 +2326,13 @@ WmIconmaskCmd( static int WmIconnameCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; int length; @@ -2380,13 +2378,13 @@ WmIconnameCmd( static int WmIconphotoCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_PhotoHandle photo; Tk_PhotoImageBlock block; int i, size = 0, width, height, index = 0, x, y, isDefault = 0; @@ -2437,7 +2435,7 @@ WmIconphotoCmd( * defines CARD32 arrays to use. [Bug 2902814] */ - iconPropertyData = attemptckalloc(sizeof(unsigned long) * size); + iconPropertyData = (unsigned long *)attemptckalloc(sizeof(unsigned long) * size); if (iconPropertyData == NULL) { return TCL_ERROR; } @@ -2479,9 +2477,9 @@ WmIconphotoCmd( iconPropertyData[index++] = (unsigned long) height; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - register unsigned char *pixelPtr = + unsigned char *pixelPtr = block.pixelPtr + x*block.pixelSize + y*block.pitch; - register unsigned long R, G, B, A; + unsigned long R, G, B, A; R = pixelPtr[block.offset[0]]; G = pixelPtr[block.offset[1]]; @@ -2530,13 +2528,13 @@ WmIconphotoCmd( static int WmIconpositionCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y; if ((objc != 3) && (objc != 5)) { @@ -2593,7 +2591,7 @@ WmIconwindowCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; WmInfo *wmPtr2; XSetWindowAttributes atts; @@ -2707,14 +2705,14 @@ WmIconwindowCmd( static int WmManageCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel or Frame to work with */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ + TCL_UNUSED(int), /* Number of arguments. */ + TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ { - register Tk_Window frameWin = (Tk_Window) winPtr; - register WmInfo *wmPtr = winPtr->wmInfoPtr; + Tk_Window frameWin = (Tk_Window) winPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if (!Tk_IsTopLevel(frameWin)) { if (!Tk_IsManageable(frameWin)) { @@ -2769,13 +2767,13 @@ WmManageCmd( static int WmMaxsizeCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; if ((objc != 3) && (objc != 5)) { @@ -2828,13 +2826,13 @@ WmMaxsizeCmd( static int WmMinsizeCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; if ((objc != 3) && (objc != 5)) { @@ -2879,7 +2877,7 @@ WmMinsizeCmd( static int WmOverrideredirectCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -2937,13 +2935,13 @@ WmOverrideredirectCmd( static int WmPositionfromCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; static const char *const optionStrings[] = { "program", "user", NULL }; enum options { @@ -3004,14 +3002,14 @@ WmPositionfromCmd( static int WmProtocolCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; - register ProtocolHandler *protPtr, *prevPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; + ProtocolHandler *protPtr, *prevPtr; Atom protocol; const char *cmd; int cmdLength; @@ -3082,7 +3080,7 @@ WmProtocolCmd( } cmd = Tcl_GetStringFromObj(objv[4], &cmdLength); if (cmdLength > 0) { - protPtr = ckalloc(HANDLER_SIZE(cmdLength)); + protPtr = (ProtocolHandler *)ckalloc(HANDLER_SIZE(cmdLength)); protPtr->protocol = protocol; protPtr->nextPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr; @@ -3114,13 +3112,13 @@ WmProtocolCmd( static int WmResizableCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; if ((objc != 3) && (objc != 5)) { @@ -3173,13 +3171,13 @@ WmResizableCmd( static int WmSizefromCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; static const char *const optionStrings[] = { "program", "user", NULL }; enum options { @@ -3365,13 +3363,13 @@ WmStackorderCmd( static int WmStateCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; static const char *const optionStrings[] = { "normal", "iconic", "withdrawn", NULL }; enum options { @@ -3471,13 +3469,13 @@ WmStateCmd( static int WmTitleCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; int length; @@ -3496,7 +3494,7 @@ WmTitleCmd( ckfree(wmPtr->title); } argv3 = Tcl_GetStringFromObj(objv[3], &length); - wmPtr->title = ckalloc(length + 1); + wmPtr->title = (char *)ckalloc(length + 1); strcpy(wmPtr->title, argv3); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { @@ -3531,7 +3529,7 @@ WmTransientCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *containerPtr = wmPtr->containerPtr, *w; WmInfo *wmPtr2; @@ -3674,13 +3672,13 @@ WmTransientCmd( static int WmWithdrawCmd( - Tk_Window tkwin, /* Main window of the application. */ + TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -3729,7 +3727,7 @@ WmWaitMapProc( ClientData clientData, /* Pointer to window. */ XEvent *eventPtr) /* Information about event. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; TkWindow *containerPtr = winPtr->wmInfoPtr->containerPtr; if (containerPtr == NULL) { @@ -3780,7 +3778,7 @@ Tk_SetGrid( * of one grid unit. */ { TkWindow *winPtr = (TkWindow *) tkwin; - register WmInfo *wmPtr; + WmInfo *wmPtr; /* * Ensure widthInc and heightInc are greater than 0 @@ -3885,7 +3883,7 @@ Tk_UnsetGrid( * controlling gridding. */ { TkWindow *winPtr = (TkWindow *) tkwin; - register WmInfo *wmPtr; + WmInfo *wmPtr; /* * Find the top-level window for tkwin, plus the window manager @@ -4418,7 +4416,7 @@ WrapperEventProc( ClientData clientData, /* Information about toplevel window. */ XEvent *eventPtr) /* Event that just happened. */ { - WmInfo *wmPtr = clientData; + WmInfo *wmPtr = (WmInfo *)clientData; XEvent mapEvent; TkDisplay *dispPtr = wmPtr->winPtr->dispPtr; @@ -4498,10 +4496,9 @@ WrapperEventProc( *---------------------------------------------------------------------- */ - /* ARGSUSED */ static void TopLevelReqProc( - ClientData dummy, /* Not used. */ + TCL_UNUSED(void *), /* Not used. */ Tk_Window tkwin) /* Information about window. */ { TkWindow *winPtr = (TkWindow *) tkwin; @@ -4568,8 +4565,8 @@ static void UpdateGeometryInfo( ClientData clientData) /* Pointer to the window's record. */ { - register TkWindow *winPtr = clientData; - register WmInfo *wmPtr = winPtr->wmInfoPtr; + TkWindow *winPtr = (TkWindow *)clientData; + WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, min, max; unsigned long serial; @@ -4830,7 +4827,7 @@ UpdateSizeHints( int newWidth, int newHeight) { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; XSizeHints *hintsPtr; int maxWidth, maxHeight; @@ -5307,7 +5304,7 @@ WaitRestrictProc( ClientData clientData, /* Pointer to WaitRestrictInfo structure. */ XEvent *eventPtr) /* Event that is about to be handled. */ { - WaitRestrictInfo *infoPtr = clientData; + WaitRestrictInfo *infoPtr = (WaitRestrictInfo *)clientData; if (eventPtr->type == ReparentNotify) { return TK_PROCESS_EVENT; @@ -5463,7 +5460,7 @@ SetNetWmType( } if (objc > 0) { - atoms = ckalloc(sizeof(Atom) * objc); + atoms = (Atom *)ckalloc(sizeof(Atom) * objc); } for (n = 0; n < objc; ++n) { @@ -5576,10 +5573,10 @@ ParseGeometry( TkWindow *winPtr) /* Pointer to top-level window whose geometry * is to be changed. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, flags; char *end; - register const char *p = string; + const char *p = string; /* * The leading "=" is optional. @@ -5712,7 +5709,7 @@ Tk_GetRootCoords( int *yPtr) /* Where to store y-displacement of (0,0). */ { int x, y; - register TkWindow *winPtr = (TkWindow *) tkwin; + TkWindow *winPtr = (TkWindow *) tkwin; /* * Search back through this window's parents all the way to a top-level @@ -6179,7 +6176,7 @@ Tk_MoveToplevelWindow( int x, int y) /* New location for window (within parent). */ { TkWindow *winPtr = (TkWindow *) tkwin; - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if (!(winPtr->flags & TK_TOP_LEVEL)) { Tcl_Panic("Tk_MoveToplevelWindow called with non-toplevel window"); @@ -6227,9 +6224,9 @@ Tk_MoveToplevelWindow( static void UpdateWmProtocols( - register WmInfo *wmPtr) /* Information about top-level window. */ + WmInfo *wmPtr) /* Information about top-level window. */ { - register ProtocolHandler *protPtr; + ProtocolHandler *protPtr; Atom deleteWindowAtom, pingAtom; int count; Atom *arrayPtr, *atomPtr; @@ -6246,7 +6243,7 @@ UpdateWmProtocols( protPtr = protPtr->nextPtr, count++) { /* Empty loop body; we're just counting the handlers. */ } - arrayPtr = ckalloc(count * sizeof(Atom)); + arrayPtr = (Atom *)ckalloc(count * sizeof(Atom)); deleteWindowAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr, "WM_DELETE_WINDOW"); pingAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr, "_NET_WM_PING"); @@ -6288,7 +6285,7 @@ TkWmProtocolEventProc( XEvent *eventPtr) /* X event. */ { WmInfo *wmPtr; - register ProtocolHandler *protPtr; + ProtocolHandler *protPtr; Atom protocol; int result; const char *protocolName; @@ -6437,7 +6434,7 @@ TkWmStackorderToplevel( Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS); TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table); - window_ptr = windows = ckalloc((table.numEntries+1) * sizeof(TkWindow *)); + window_ptr = windows = (TkWindow **)ckalloc((table.numEntries+1) * sizeof(TkWindow *)); if (windows == NULL) { return NULL; } @@ -6453,7 +6450,7 @@ TkWmStackorderToplevel( goto done; case 1: hPtr = Tcl_FirstHashEntry(&table, &search); - windows[0] = Tcl_GetHashValue(hPtr); + windows[0] = (TkWindow *)Tcl_GetHashValue(hPtr); windows[1] = NULL; goto done; } @@ -6469,9 +6466,9 @@ TkWmStackorderToplevel( windows = NULL; } else { for (i = 0; i < numChildren; i++) { - hPtr = Tcl_FindHashEntry(&table, (char *) children[i]); + hPtr = Tcl_FindHashEntry(&table, (char *)children[i]); if (hPtr != NULL) { - childWinPtr = Tcl_GetHashValue(hPtr); + childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr); *window_ptr++ = childWinPtr; } } @@ -6644,7 +6641,7 @@ TkWmAddToColormapWindows( * add the toplevel itself as the last element of the list. */ - newPtr = ckalloc((count+2) * sizeof(Window)); + newPtr = (Window *)ckalloc((count+2) * sizeof(Window)); for (i = 0; i < count; i++) { newPtr[i] = oldPtr[i]; } @@ -6879,7 +6876,7 @@ GetMaxSize( static void TkSetTransientFor(Tk_Window tkwin, Tk_Window parent) { - if (parent == None) { + if (parent == NULL) { parent = Tk_Parent(tkwin); while (!Tk_IsTopLevel(parent)) parent = Tk_Parent(parent); @@ -6997,7 +6994,7 @@ CreateWrapper( TkWindow *winPtr, *wrapperPtr; Window parent; Tcl_HashEntry *hPtr; - int new; + int isNew; winPtr = wmPtr->winPtr; if (winPtr->window == None) { @@ -7041,7 +7038,7 @@ CreateWrapper( InputOutput, wrapperPtr->visual, wrapperPtr->dirtyAtts|CWOverrideRedirect, &wrapperPtr->atts); hPtr = Tcl_CreateHashEntry(&wrapperPtr->dispPtr->winTable, - (char *) wrapperPtr->window, &new); + (char *) wrapperPtr->window, &isNew); Tcl_SetHashValue(hPtr, wrapperPtr); wrapperPtr->mainPtr = winPtr->mainPtr; wrapperPtr->mainPtr->refCount++; @@ -7260,7 +7257,7 @@ MenubarReqProc( * for tkwin's toplevel. */ Tk_Window tkwin) /* Handle for menubar window. */ { - WmInfo *wmPtr = clientData; + WmInfo *wmPtr = (WmInfo *)clientData; wmPtr->menuHeight = Tk_ReqHeight(tkwin); if (wmPtr->menuHeight <= 0) { @@ -7295,7 +7292,7 @@ TkWindow * TkpGetWrapperWindow( TkWindow *winPtr) /* A toplevel window pointer. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; if ((winPtr == NULL) || (wmPtr == NULL)) { return NULL; @@ -7325,7 +7322,7 @@ static void UpdateCommand( TkWindow *winPtr) { - register WmInfo *wmPtr = winPtr->wmInfoPtr; + WmInfo *wmPtr = winPtr->wmInfoPtr; Tcl_DString cmds, ds; int i, *offsets; char **cmdArgv; @@ -7342,8 +7339,8 @@ UpdateCommand( * entire DString is done. */ - cmdArgv = ckalloc(sizeof(char *) * wmPtr->cmdArgc); - offsets = ckalloc(sizeof(int) * wmPtr->cmdArgc); + cmdArgv = (char **)ckalloc(sizeof(char *) * wmPtr->cmdArgc); + offsets = (int *)ckalloc(sizeof(int) * wmPtr->cmdArgc); Tcl_DStringInit(&cmds); for (i = 0; i < wmPtr->cmdArgc; i++) { Tcl_UtfToExternalDString(NULL, wmPtr->cmdArgv[i], -1, &ds); |