Ignore:
Timestamp:
Feb 10, 2008, 5:55:02 AM (11 years ago)
Author:
cameron
Message:

Caseless comparison fix; encoding names (prelim)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/multiliteral.h

    r26 r33  
    144144  const uint16_t UC = c2int16<C, lc2UC<c1>::value, lc2UC<c2>::value>::value;
    145145  const uint16_t case_mask = lc ^ UC;
    146   const uint16_t canon = lc & case_mask;
    147   return (s2int16(s) & case_mask) == canon;
     146  const uint16_t canon = lc & ~case_mask;
     147  return (s2int16(s) & ~case_mask) == canon;
    148148}
    149149
     
    153153  const uint32_t UC = c3int32<C, lc2UC<c1>::value, lc2UC<c2>::value, lc2UC<c3>::value>::value;
    154154  const uint32_t case_mask = lc ^ UC;
    155   const uint32_t canon = lc & case_mask;
    156   return (s3int32(s) & case_mask) == canon;
     155  const uint32_t canon = lc & ~case_mask;
     156  return (s3int32(s) & ~case_mask) == canon;
    157157}
    158158
     
    165165                                 lc2UC<c3>::value, lc2UC<c4>::value>::value;
    166166  const uint32_t case_mask = lc ^ UC;
    167   const uint32_t canon = lc & case_mask;
    168   return (s4int32(s) & case_mask) == canon;
     167  const uint32_t canon = lc & ~case_mask;
     168  return (s4int32(s) & ~case_mask) == canon;
    169169}
    170170
     
    180180                                 lc2UC<c5>::value>::value;
    181181  const uint64_t case_mask = lc ^ UC;
    182   const uint64_t canon = lc & case_mask;
    183   return (s5int64(s) & case_mask) == canon;
     182  const uint64_t canon = lc & ~case_mask;
     183  return (s5int64(s) & ~case_mask) == canon;
    184184}
    185185
     
    195195                                 lc2UC<c5>::value, lc2UC<c6>::value>::value;
    196196  const uint64_t case_mask = lc ^ UC;
    197   const uint64_t canon = lc & case_mask;
    198   return (s6int64(s) & case_mask) == canon;
     197  const uint64_t canon = lc & ~case_mask;
     198  return (s6int64(s) & ~case_mask) == canon;
    199199}
    200200
     
    213213                                 lc2UC<c7>::value>::value;
    214214  const uint64_t case_mask = lc ^ UC;
    215   const uint64_t canon = lc & case_mask;
    216   return (s7int64(s) & case_mask) == canon;
     215  const uint64_t canon = lc & ~case_mask;
     216  return (s7int64(s) & ~case_mask) == canon;
    217217}
    218218
     
    231231                                 lc2UC<c7>::value, lc2UC<c8>::value>::value;
    232232  const uint64_t case_mask = lc ^ UC;
    233   const uint64_t canon = lc & case_mask;
    234   return (s8int64(s) & case_mask) == canon;
     233  const uint64_t canon = lc & ~case_mask;
     234  return (s8int64(s) & ~case_mask) == canon;
    235235}
    236236
Note: See TracChangeset for help on using the changeset viewer.