diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-03-31 21:48:30 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-03-31 21:48:30 (GMT) |
commit | 4f54d474a1792c52f1a156354e132b799edb7c6d (patch) | |
tree | 51effa4ab375927e3d3c262330eb38a1be3f3586 | |
parent | 5a347dcb1e566abc32c8880a9b517ab48e989a39 (diff) | |
download | blt-4f54d474a1792c52f1a156354e132b799edb7c6d.zip blt-4f54d474a1792c52f1a156354e132b799edb7c6d.tar.gz blt-4f54d474a1792c52f1a156354e132b799edb7c6d.tar.bz2 |
fix a issue with new xcode 8.3 compiler
-rw-r--r-- | tk8.6/macosx/tkMacOSXWm.c | 4 | ||||
-rw-r--r-- | tk8.6/macosx/tkMacOSXWm.h | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tk8.6/macosx/tkMacOSXWm.c b/tk8.6/macosx/tkMacOSXWm.c index 39990e6..ac5f43d 100644 --- a/tk8.6/macosx/tkMacOSXWm.c +++ b/tk8.6/macosx/tkMacOSXWm.c @@ -2899,11 +2899,13 @@ WmProtocolCmd( } cmd = Tcl_GetStringFromObj(objv[4], &cmdLength); if (cmdLength > 0) { - protPtr = ckalloc(HANDLER_SIZE(cmdLength)); + /* protPtr = ckalloc(HANDLER_SIZE(cmdLength));*/ + protPtr = ckalloc(sizeof(ProtocolHandler)); protPtr->protocol = protocol; protPtr->nextPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr; protPtr->interp = interp; + protPtr->command = malloc(cmdLength+1); strcpy(protPtr->command, cmd); } return TCL_OK; diff --git a/tk8.6/macosx/tkMacOSXWm.h b/tk8.6/macosx/tkMacOSXWm.h index d98010f..b504896 100644 --- a/tk8.6/macosx/tkMacOSXWm.h +++ b/tk8.6/macosx/tkMacOSXWm.h @@ -29,7 +29,8 @@ typedef struct ProtocolHandler { * same top-level window, or NULL for end of * list. */ Tcl_Interp *interp; /* Interpreter in which to invoke command. */ - char command[4]; /* Tcl command to invoke when a client message + /* char command[4]; Tcl command to invoke when a client message*/ + char* command; /* Tcl command to invoke when a client message * for this protocol arrives. The actual size * of the structure varies to accommodate the * needs of the actual command. THIS MUST BE @@ -37,7 +38,7 @@ typedef struct ProtocolHandler { } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ -((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength)) + ((unsigned) (sizeof(ProtocolHandler) -3 + cmdLength)) /* * A data structure of the following type holds window-manager-related |