Tk Source Code

View Ticket
Login
2002-02-02
07:18 Closed ticket [511956ffff]: "bool" is #defined to _Bool in ISO 99 C plus 8 other changes artifact: 409858bdb8 user: hobbs
2002-02-01
23:21 New ticket [511956ffff]. artifact: 59e0be9e70 user: wolfsuit

Ticket UUID: 511956
Title: "bool" is #defined to _Bool in ISO 99 C
Type: Bug Version: obsolete: 8.4a4
Submitter: wolfsuit Created on: 2002-02-01 23:21:04
Subsystem: 81. Portability Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-02-02 07:18:01
Resolution: Fixed Closed By: hobbs
    Closed on: 2002-02-02 00:18:01
Description:
The ISO 99 C standard now requires that C 
compilers define bool to be _Bool.  If you want to 
use bool in your code, you have to undef it first.  
This only shows up in one place in Tk, so rather 
than fighting with the compiler, we should just 
change it.  Here is the patch (just changing the int 
bool variable to int boolval):

Index: tkCmds.c
=======================================
============================
RCS file: /cvsroot/tktoolkit/tk/generic/tkCmds.c,v
retrieving revision 1.20.2.2
diff -c -w -r1.20.2.2 tkCmds.c
*** tkCmds.c    2001/10/17 07:02:07     1.20.2.2
--- tkCmds.c    2002/02/01 23:14:46
***************
*** 709,721 ****
                 * That will indicate to the user that input 
methods
                 * are just not available.
                 */
!               int bool;
!               if (Tcl_GetBooleanFromObj(interp, objv[2+
skip], &bool)
                        != TCL_OK) {
                    return TCL_ERROR;
                }
  #ifdef TK_USE_INPUT_METHODS
!               dispPtr->useInputMethods = bool;
  #endif /* TK_USE_INPUT_METHODS */
            } else if ((objc - skip) != 2) {
                Tcl_WrongNumArgs(interp, 2, objv,
--- 709,721 ----
                 * That will indicate to the user that input 
methods
                 * are just not available.
                 */
!               int boolval;
!               if (Tcl_GetBooleanFromObj(interp, objv[2+
skip], &boolval)
                        != TCL_OK) {
                    return TCL_ERROR;
                }
  #ifdef TK_USE_INPUT_METHODS
!               dispPtr->useInputMethods = boolval;
  #endif /* TK_USE_INPUT_METHODS */
            } else if ((objc - skip) != 2) {
                Tcl_WrongNumArgs(interp, 2, objv,
User Comments: hobbs added on 2002-02-02 07:18:01:
Logged In: YES 
user_id=72656

applied to head and core-8-3-1-branch.  silly spec ...