Changeset 1866 for proto/u8u16/u8u16_pablo.py
 Timestamp:
 Jan 21, 2012, 10:04:53 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

proto/u8u16/u8u16_pablo.py
r1822 r1866 56 56 57 57 def Utf8_to_utf16(u8_bits, u8, u16hi, u16lo): 58 u8.unibyte = (~u8_bits.bit_0) ;59 u8.prefix = (u8_bits.bit_0 & u8_bits.bit_1) ;60 u8.prefix2 = (u8.prefix &~ u8_bits.bit_2) ;61 temp1 = (u8_bits.bit_2 &~ u8_bits.bit_3) ;62 u8.prefix3 = (u8.prefix & temp1) ;63 temp2 = (u8_bits.bit_2 & u8_bits.bit_3) ;64 u8.prefix4 = (u8.prefix & temp2) ;65 u8.suffix = (u8_bits.bit_0 &~ u8_bits.bit_1) ;58 u8.unibyte = (~u8_bits.bit_0) 59 u8.prefix = (u8_bits.bit_0 & u8_bits.bit_1) 60 u8.prefix2 = (u8.prefix &~ u8_bits.bit_2) 61 temp1 = (u8_bits.bit_2 &~ u8_bits.bit_3) 62 u8.prefix3 = (u8.prefix & temp1) 63 temp2 = (u8_bits.bit_2 & u8_bits.bit_3) 64 u8.prefix4 = (u8.prefix & temp2) 65 u8.suffix = (u8_bits.bit_0 &~ u8_bits.bit_1) 66 66 # 67 67 u8.delmask = 0 … … 69 69 u8anyscope = 0 70 70 if u8_bits.bit_0: 71 temp3 = (u8_bits.bit_2  u8_bits.bit_3) ;72 temp4 = (u8.prefix &~ temp3) ;73 temp5 = (u8_bits.bit_4  u8_bits.bit_5) ;74 temp6 = (temp5  u8_bits.bit_6) ;75 badprefix2 = (temp4 &~ temp6) ;71 temp3 = (u8_bits.bit_2  u8_bits.bit_3) 72 temp4 = (u8.prefix &~ temp3) 73 temp5 = (u8_bits.bit_4  u8_bits.bit_5) 74 temp6 = (temp5  u8_bits.bit_6) 75 badprefix2 = (temp4 &~ temp6) 76 76 error_mask = badprefix2 77 77 u8.scope22 = pablo.Advance(u8.prefix2) … … 86 86 u8.delmask = u8.prefix 87 87 if u8.prefix3  u8.prefix4: 88 temp7 = (u8_bits.bit_6  u8_bits.bit_7) ;89 temp8 = (temp5  temp7) ;90 xE0 = (u8.prefix3 &~ temp8) ;91 temp9 = (u8_bits.bit_4 & u8_bits.bit_5) ;92 temp10 = (u8_bits.bit_7 &~ u8_bits.bit_6) ;93 temp11 = (temp9 & temp10) ;94 xED = (u8.prefix3 & temp11) ;95 xA0_xBF = (u8.suffix & u8_bits.bit_2) ;96 x80_x9F = (u8.suffix &~ u8_bits.bit_2) ;88 temp7 = (u8_bits.bit_6  u8_bits.bit_7) 89 temp8 = (temp5  temp7) 90 xE0 = (u8.prefix3 &~ temp8) 91 temp9 = (u8_bits.bit_4 & u8_bits.bit_5) 92 temp10 = (u8_bits.bit_7 &~ u8_bits.bit_6) 93 temp11 = (temp9 & temp10) 94 xED = (u8.prefix3 & temp11) 95 xA0_xBF = (u8.suffix & u8_bits.bit_2) 96 x80_x9F = (u8.suffix &~ u8_bits.bit_2) 97 97 error_mask = pablo.Advance(xE0) & x80_x9F 98 98 error_mask = pablo.Advance(xED) & xA0_xBF … … 109 109 u8.delmask = u8.scope32 110 110 if u8.prefix4: 111 temp12 = (u8_bits.bit_5 & temp7) ;112 temp13 = (u8_bits.bit_4  temp12) ;113 badprefix4 = (u8.prefix4 & temp13) ;111 temp12 = (u8_bits.bit_5 & temp7) 112 temp13 = (u8_bits.bit_4  temp12) 113 badprefix4 = (u8.prefix4 & temp13) 114 114 error_mask = badprefix4 115 xF0 = (u8.prefix4 &~ temp8) ;116 temp14 = (u8_bits.bit_5 &~ u8_bits.bit_4) ;117 temp15 = (temp14 &~ temp7) ;118 xF4 = (u8.prefix4 & temp15) ;119 x90_xBF = (u8.suffix & temp3) ;120 x80_x8F = (u8.suffix &~ temp3) ;115 xF0 = (u8.prefix4 &~ temp8) 116 temp14 = (u8_bits.bit_5 &~ u8_bits.bit_4) 117 temp15 = (temp14 &~ temp7) 118 xF4 = (u8.prefix4 & temp15) 119 x90_xBF = (u8.suffix & temp3) 120 x80_x8F = (u8.suffix &~ temp3) 121 121 error_mask = pablo.Advance(xF0) & x80_x8F 122 122 error_mask = pablo.Advance(xF4) & x90_xBF
Note: See TracChangeset
for help on using the changeset viewer.