Changeset 494 for trunk/thune/make.c

Show
Ignore:
Timestamp:
10/29/07 17:30:32 (13 months ago)
Author:
krobillard
Message:

Converting a UCS2 string to binary now creates big-endian words on all
platforms.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/make.c

    r480 r494  
    172172        if( size ) 
    173173        { 
    174             memCpy( bin->ptr.b, cpA, size ); 
     174#ifndef __BIG_ENDIAN__ 
     175            if( ur_is(cell, UT_STRING) && (ur_encoding(cell) == UR_ENC_UCS2) ) 
     176                memSwab( cpA, bin->ptr.b, size ); 
     177            else 
     178#endif 
     179                memCpy( bin->ptr.b, cpA, size ); 
     180 
    175181            bin->used = size; 
    176182        } 
     
    17111717                goto init_bin; 
    17121718            } 
     1719#if 0 
     1720            else if( ur_is(tos, UT_WORD) && (argc == 2) ) 
     1721            { 
     1722                binN = ur_makeBinaryFrom( ut, ur_s_prev(tos) ); 
     1723                goto init_bin; 
     1724            } 
     1725#endif 
    17131726            else if( ur_stringSlice(ut, tos, &spA, &spB) ) 
    17141727            {