Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5ebb1583c361c2f9d6f55cead2c3dec881c29f33
Ticket: 218988ffffffffffffffffffffffffffffffffff
64bit integer support for lsort
User & Date: nobody on 2000-10-26 01:08:59
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3652 Bug
    Version: 8.2.2
    SubmitDate: '1999-11-23'
    LastModified: '1999-11-24'
    Severity: LOW
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: All Unix
    OSVersion: Tru64Unix 4.0F
    Machine: AlphaServer
    FixedDate: '1999-11-24'
    FixedInVersion: 8.3b1
    ClosedDate: '2000-10-25'
    
    
    Name: kazuro furukawa
    
    
    
    Comments:
    
    Since this patch does not do 
    
    any harm on 32bit machines, 
    
    I hope this patch is applied in 
    
    the core.
    
    
    
    ReproducibleScript:
    
    % lsort -integer "1234567890 12345678901"
    
    
    
    ObservedBehavior:
    
    "integer value too large to represent as non-long integer"
    
    
    
    DesiredBehavior:
    
    64bit integers should be handled on 
    
    64bit machines.
    
    
    
    Patch:
    
    % diff -u tclCmdIL.c.org tclCmdIL.c | more
    
    --- tclCmdIL.c.org      Wed Sep 22 13:12:46 1999
    
    +++ tclCmdIL.c  Mon Nov 15 14:46:35 1999
    
    @@ -2786,10 +2786,14 @@
    
            order = DictionaryCompare(
    
                    Tcl_GetString(objPtr1), Tcl_GetString(objPtr2));
    
         } else if (infoPtr->sortMode == SORTMODE_INTEGER) {
    
    -       int a, b;
    
    +       /*
    
    +        * for 64bit machines, integer comparison must be carried 
    
    +        * with long integer. k.furukawa.
    
    +        */
    
    +       long a, b;
    
     
    
    -       if ((Tcl_GetIntFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK)
    
    -               || (Tcl_GetIntFromObj(infoPtr->interp, objPtr2, &b)
    
    +       if ((Tcl_GetLongFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK)
    
    +               || (Tcl_GetLongFromObj(infoPtr->interp, objPtr2, &b)
    
                    != TCL_OK)) {
    
                infoPtr->resultCode = TCL_ERROR;
    
                return order;
    
    
    
    PatchFiles:
    
    tclCmdIL.c
    
    
    
    
    
    Added to 8.3b1 core. 
    -- 11/24/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.2.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "10. Objects"
  10. title changed to: "64bit integer support for lsort"
  11. type changed to: "Bug"