Results 1 to 2 of 2

Thread: [3.3.1 and 3.4b] slice2py const long problem

  1. #1
    Han
    Han is offline Registered User
    Name: Han Genuit
    Organization: FOM Rijnhuizen
    Project: Database for Magnum PSI (plasma research).
    Join Date
    Mar 2009
    Posts
    6

    Post [3.3.1 and 3.4b] slice2py const long problem

    The slice2py generator converts a long constant into a string when the value exceeds integer, where it should become a long.

    For instance, creating a test.ice file

    Code:
    module test {
    	const long TestLongConst1 = 0x7fffffff; // ((1<<31) - 1)
    	const long TestLongConst2 = 0x80000000; // (1<<31)
    };
    and importing it into Python

    Code:
    import test
    
    print test.TestLongConst1, type(test.TestLongConst1)
    print test.TestLongConst2, type(test.TestLongConst2)
    produces

    Code:
    2147483647 <type 'int'>
    2147483648 <type 'str'>

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    I think this mapping was originally necessary to work around some platform limitations, but that's no longer the case. We'll fix this for 3.4.

    Thanks,
    Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. slice2py out parameter problem
    By socketref in forum Help Center
    Replies: 1
    Last Post: 06-16-2010, 01:15 PM
  2. slice2py --no-package problem
    By mmarquar in forum Help Center
    Replies: 3
    Last Post: 06-15-2010, 07:59 PM
  3. [3.4b] slice2py gen hangs at "end of input"
    By joshmoore in forum Bug Reports
    Replies: 3
    Last Post: 01-20-2010, 11:43 AM
  4. Replies: 1
    Last Post: 06-23-2006, 12:45 PM
  5. Python: #include/import problem with slice2py
    By hiasl in forum Bug Reports
    Replies: 1
    Last Post: 02-21-2006, 09:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •