Changeset 5631

Show
Ignore:
Timestamp:
08/03/12 19:36:04 (7 years ago)
Author:
cmatthew
Message:

Added support for a P type, which is a pointer. Pointers are 4 bytes. Pointers which are 0 are converted to None. This gives us a C NULL to Python None path. Non-null pointers will be displayed as hex numbers. I imagine this could be used for debugging.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/branches/nacl_repy/seattlelib/struct.repy

    r5559 r5631  
    525525        # shouldn't happen because we checked above 
    526526        assert(endianness == "none") 
    527         assert(len(currentpackedstring) >= 8) 
    528    
    529   
    530         thisnumberstring = currentpackedstring[:8] 
    531   
    532         currentpackedstring = currentpackedstring[8:] 
     527        assert(len(currentpackedstring) >= 4) 
     528   
     529  
     530        thisnumberstring = currentpackedstring[:4] 
     531  
     532        currentpackedstring = currentpackedstring[4:] 
    533533 
    534534        # okay, so now we have the big-endian description... 
     
    686686 
    687687      # add the size of an integer + the number of integers 
    688       currentlength += 8 * repeatcount 
    689  
    690     elif typetounpack == 'N' or typetounpack == 'n': 
    691       # None does not take any extra space 
    692       pass 
    693      
     688      currentlength += 4 * repeatcount 
    694689 
    695690    else: