lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r930424 - in /lucene/lucy/trunk/core/Lucy/Util: IndexFileNames.bp IndexFileNames.c NumberUtils.bp NumberUtils.c PriorityQueue.bp PriorityQueue.c Sleep.bp Sleep.c SortUtils.bp SortUtils.c StringHelper.bp StringHelper.c
Date Fri, 02 Apr 2010 23:07:52 GMT
Author: marvin
Date: Fri Apr  2 23:07:51 2010
New Revision: 930424

URL: http://svn.apache.org/viewvc?rev=930424&view=rev
Log:
Change to stdint.h integer types within core/Lucy/Util.

Modified:
    lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.bp
    lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.c
    lucene/lucy/trunk/core/Lucy/Util/NumberUtils.bp
    lucene/lucy/trunk/core/Lucy/Util/NumberUtils.c
    lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.bp
    lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.c
    lucene/lucy/trunk/core/Lucy/Util/Sleep.bp
    lucene/lucy/trunk/core/Lucy/Util/Sleep.c
    lucene/lucy/trunk/core/Lucy/Util/SortUtils.bp
    lucene/lucy/trunk/core/Lucy/Util/SortUtils.c
    lucene/lucy/trunk/core/Lucy/Util/StringHelper.bp
    lucene/lucy/trunk/core/Lucy/Util/StringHelper.c

Modified: lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.bp Fri Apr  2 23:07:51 2010
@@ -10,7 +10,7 @@ inert class Lucy::Util::IndexFileNames c
      *
      * @return a generation number, or 0 if no number can be extracted.
      */
-    inert u64_t
+    inert uint64_t
     extract_gen(const CharBuf *name);
 
     /** Return the name of the latest generation snapshot file in the Folder,

Modified: lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/IndexFileNames.c Fri Apr  2 23:07:51 2010
@@ -12,7 +12,7 @@ IxFileNames_latest_snapshot(Folder *fold
     DirHandle *dh = Folder_Open_Dir(folder, NULL);
     CharBuf   *entry = dh ? DH_Get_Entry(dh) : NULL;
     CharBuf   *retval   = NULL;
-    u64_t      latest_gen = 0;
+    uint64_t   latest_gen = 0;
 
     if (!dh) { RETHROW(INCREF(Err_get_error())); }
 
@@ -20,7 +20,7 @@ IxFileNames_latest_snapshot(Folder *fold
         if (   CB_Starts_With_Str(entry, "snapshot_", 9)
             && CB_Ends_With_Str(entry, ".json", 5)
         ) {
-            u64_t gen = IxFileNames_extract_gen(entry);
+            uint64_t gen = IxFileNames_extract_gen(entry);
             if (gen > latest_gen) {
                 latest_gen = gen;
                 if (!retval) retval = CB_Clone(entry);
@@ -33,7 +33,7 @@ IxFileNames_latest_snapshot(Folder *fold
     return retval;
 }
 
-u64_t
+uint64_t
 IxFileNames_extract_gen(const CharBuf *name)
 {
     ZombieCharBuf *num_string = ZCB_WRAP(name);
@@ -41,20 +41,20 @@ IxFileNames_extract_gen(const CharBuf *n
     /* Advance past first underscore.  Bail if we run out of string or if we
      * encounter a NULL. */
     while (1) {
-        u32_t code_point = ZCB_Nip_One(num_string);
+        uint32_t code_point = ZCB_Nip_One(num_string);
         if (code_point == 0) { return 0; }
         else if (code_point == '_') { break; }
     }
 
-    return (u64_t)ZCB_BaseX_To_I64(num_string, 36);
+    return (uint64_t)ZCB_BaseX_To_I64(num_string, 36);
 }
 
 ZombieCharBuf*
 IxFileNames_local_part(const CharBuf *path, ZombieCharBuf *target)
 {
-    ZombieCharBuf *scratch  = ZCB_WRAP(path);
+    ZombieCharBuf *scratch = ZCB_WRAP(path);
     size_t local_part_start = CB_Length(path);
-    u32_t  code_point;
+    uint32_t code_point;
 
     ZCB_Assign(target, path);
 

Modified: lucene/lucy/trunk/core/Lucy/Util/NumberUtils.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/NumberUtils.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/NumberUtils.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/NumberUtils.bp Fri Apr  2 23:07:51 2010
@@ -7,43 +7,43 @@ parcel Lucy;
  */
 inert class Lucy::Util::NumberUtils cnick NumUtil { 
 
-    inert const u8_t[8] u1masks;
-    inert const u8_t[4] u2masks;
-    inert const u8_t[4] u2shifts;
-    inert const u8_t[2] u4masks;
-    inert const u8_t[2] u4shifts;
+    inert const uint8_t[8] u1masks;
+    inert const uint8_t[4] u2masks;
+    inert const uint8_t[4] u2shifts;
+    inert const uint8_t[2] u4masks;
+    inert const uint8_t[2] u4shifts;
     
     /** Encode an unsigned 16-bit integer as 2 bytes in the buffer provided,
      * using big-endian byte order.
      */
     inert inline void
-    encode_bigend_u16(u16_t value, void *dest);
+    encode_bigend_u16(uint16_t value, void *dest);
 
     /** Encode an unsigned 32-bit integer as 4 bytes in the buffer provided,
      * using big-endian byte order.
      */
     inert inline void
-    encode_bigend_u32(u32_t value, void *dest);
+    encode_bigend_u32(uint32_t value, void *dest);
 
     /** Encode an unsigned 64-bit integer as 8 bytes in the buffer provided,
      * using big-endian byte order. 
      */
     inert inline void
-    encode_bigend_u64(u64_t value, void *dest);
+    encode_bigend_u64(uint64_t value, void *dest);
 
     /** Interpret a sequence of bytes as a big-endian unsigned 16-bit int.
      */
-    inert inline u16_t
+    inert inline uint16_t
     decode_bigend_u16(void *source);
 
     /** Interpret a sequence of bytes as a big-endian unsigned 32-bit int.
      */
-    inert inline u32_t
+    inert inline uint32_t
     decode_bigend_u32(void *source);
 
     /** Interpret a sequence of bytes as a big-endian unsigned 64-bit int.
      */
-    inert inline u64_t
+    inert inline uint64_t
     decode_bigend_u64(void *source);
 
     /** Encode a 32-bit floating point number as 4 bytes in the buffer
@@ -75,7 +75,7 @@ inert class Lucy::Util::NumberUtils cnic
      * of the C32.
      */
     inert inline void
-    encode_c32(u32_t value, char **dest);
+    encode_c32(uint32_t value, char **dest);
 
     /** Encode a C32 at the space pointed to by <code>dest</code>, but add
      * "leading zeroes" so that the space consumed will always be 5 bytes.  As
@@ -83,27 +83,27 @@ inert class Lucy::Util::NumberUtils cnic
      * the end of the C32.
      */
     inert inline void
-    encode_padded_c32(u32_t value, char **dest);
+    encode_padded_c32(uint32_t value, char **dest);
 
     /** Encode a C64 at the space pointed to by <code>dest</code>. As a side
      * effect, <code>dest</code> will be advanced to immediately after the end
      * of the C64.
      */
     inert inline void
-    encode_c64(u64_t value, char **dest);
+    encode_c64(uint64_t value, char **dest);
 
     /** Read a C32 from the buffer pointed to by <code>source</code>.  As a
      * side effect, advance the pointer, consuming the bytes occupied by the
      * C32.
      */
-    inert inline u32_t
+    inert inline uint32_t
     decode_c32(char **source);
 
     /** Read a C64 from the buffer pointed to by <code>source</code>.  As a
      * side effect, advance the pointer, consuming the bytes occupied by the
      * C64.
      */
-    inert inline u64_t
+    inert inline uint64_t
     decode_c64(char **source);
 
     /** Advance <code>source</code> past one encoded C32 or C64.
@@ -115,74 +115,74 @@ inert class Lucy::Util::NumberUtils cnic
      * bit at <code>tick</code> is set, false otherwise.
      */
     inert inline bool_t
-    u1get(void *array, u32_t tick);
+    u1get(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of bits; set the bit at
      * <code>tick</code>.
      */
     inert inline void 
-    u1set(void *array, u32_t tick);
+    u1set(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of bits; clear the bit at
      * <code>tick</code>.
      */
     inert inline void 
-    u1clear(void *array, u32_t tick);
+    u1clear(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of bits; flip the bit at
      * <code>tick</code>.
      */
     inert inline void
-    u1flip(void *array, u32_t tick);
+    u1flip(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of two-bit integers; return
      * the value at <code>tick</code>.
      */
-    inert inline u8_t
-    u2get(void *array, u32_t tick);
+    inert inline uint8_t
+    u2get(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of two-bit integers; set the
      * element at <code>tick</code> to <code>value</code>.
      */
     inert inline void 
-    u2set(void *array, u32_t tick, u8_t value);
+    u2set(void *array, uint32_t tick, uint8_t value);
 
     /** Interpret <code>array</code> as an array of four-bit integers; return
      * the value at <code>tick</code>.
      */
-    inert inline u8_t
-    u4get(void *array, u32_t tick);
+    inert inline uint8_t
+    u4get(void *array, uint32_t tick);
 
     /** Interpret <code>array</code> as an array of four-bit integers; set the
      * element at <code>tick</code> to <code>value</code>.
      */
     inert inline void 
-    u4set(void *array, u32_t tick, u8_t value);
+    u4set(void *array, uint32_t tick, uint8_t value);
 }
 
 __C__
 
 static CHY_INLINE void
-lucy_NumUtil_encode_bigend_u16(chy_u16_t num, void *dest_ptr)
+lucy_NumUtil_encode_bigend_u16(uint16_t num, void *dest_ptr)
 {
-    chy_u8_t *dest = *(chy_u8_t**)dest_ptr;
+    uint8_t *dest = *(uint8_t**)dest_ptr;
 #ifdef CHY_BIG_END
-    memcpy(dest, &num, sizeof(chy_u16_t));
+    memcpy(dest, &num, sizeof(uint16_t));
 #else // little endian 
-    chy_u8_t *source = (chy_u8_t*)&num;
+    uint8_t *source = (uint8_t*)&num;
     dest[0] = source[1];
     dest[1] = source[0];
 #endif // CHY_BIG_END (and little endian) 
 }
 
 static CHY_INLINE void
-lucy_NumUtil_encode_bigend_u32(chy_u32_t num, void *dest_ptr)
+lucy_NumUtil_encode_bigend_u32(uint32_t num, void *dest_ptr)
 {
-    chy_u8_t *dest = *(chy_u8_t**)dest_ptr;
+    uint8_t *dest = *(uint8_t**)dest_ptr;
 #ifdef CHY_BIG_END
-    memcpy(dest, &num, sizeof(chy_u32_t));
+    memcpy(dest, &num, sizeof(uint32_t));
 #else // little endian 
-    chy_u8_t *source = (chy_u8_t*)&num;
+    uint8_t *source = (uint8_t*)&num;
     dest[0] = source[3];
     dest[1] = source[2];
     dest[2] = source[1];
@@ -191,13 +191,13 @@ lucy_NumUtil_encode_bigend_u32(chy_u32_t
 }
 
 static CHY_INLINE void
-lucy_NumUtil_encode_bigend_u64(chy_u64_t num, void *dest_ptr)
+lucy_NumUtil_encode_bigend_u64(uint64_t num, void *dest_ptr)
 {
-    chy_u8_t *dest = *(chy_u8_t**)dest_ptr;
+    uint8_t *dest = *(uint8_t**)dest_ptr;
 #ifdef CHY_BIG_END
-    memcpy(dest, &num, sizeof(chy_u64_t));
+    memcpy(dest, &num, sizeof(uint64_t));
 #else // little endian 
-    chy_u8_t *source = (chy_u8_t*)&num;
+    uint8_t *source = (uint8_t*)&num;
     dest[0] = source[7];
     dest[1] = source[6];
     dest[2] = source[5];
@@ -209,37 +209,37 @@ lucy_NumUtil_encode_bigend_u64(chy_u64_t
 #endif // CHY_BIG_END (and little endian) 
 }
 
-static CHY_INLINE chy_u16_t
+static CHY_INLINE uint16_t
 lucy_NumUtil_decode_bigend_u16(void *source)
 {
-    chy_u8_t *const buf = (chy_u8_t*)source;
+    uint8_t *const buf = (uint8_t*)source;
     return  (buf[0] << 8) |
             (buf[1]);
 }
 
-static CHY_INLINE chy_u32_t
+static CHY_INLINE uint32_t
 lucy_NumUtil_decode_bigend_u32(void *source)
 {
-    chy_u8_t *const buf = (chy_u8_t*)source;
+    uint8_t *const buf = (uint8_t*)source;
     return  (buf[0]  << 24) |
             (buf[1]  << 16) |
             (buf[2]  << 8)  |
             (buf[3]);
 }
 
-static CHY_INLINE chy_u64_t
+static CHY_INLINE uint64_t
 lucy_NumUtil_decode_bigend_u64(void *source)
 {
-    chy_u8_t *const buf = (chy_u8_t*)source;
-    chy_u64_t high_bits = (buf[0]  << 24) |
-                          (buf[1]  << 16) |
-                          (buf[2]  << 8)  |
-                          (buf[3]);
-    chy_u32_t low_bits  = (buf[4]  << 24) |
-                          (buf[5]  << 16) |
-                          (buf[6]  << 8)  |
-                          (buf[7]);
-    chy_u64_t retval = high_bits << 32;
+    uint8_t *const buf = (uint8_t*)source;
+    uint64_t high_bits = (buf[0]  << 24) |
+                         (buf[1]  << 16) |
+                         (buf[2]  << 8)  |
+                         (buf[3]);
+    uint32_t low_bits  = (buf[4]  << 24) |
+                         (buf[5]  << 16) |
+                         (buf[6]  << 8)  |
+                         (buf[7]);
+    uint64_t retval = high_bits << 32;
     retval |= low_bits;
     return retval;
 }
@@ -247,11 +247,11 @@ lucy_NumUtil_decode_bigend_u64(void *sou
 static CHY_INLINE void 
 lucy_NumUtil_encode_bigend_f32(float value, void *dest_ptr)
 {
-    chy_u8_t *dest = *(chy_u8_t**)dest_ptr;
+    uint8_t *dest = *(uint8_t**)dest_ptr;
 #ifdef CHY_BIG_END
     memcpy(dest, &value, sizeof(float));
 #else 
-    union { float f; chy_u32_t u32; } duo; 
+    union { float f; uint32_t u32; } duo; 
     duo.f = value;
     lucy_NumUtil_encode_bigend_u32(duo.u32, &dest);
 #endif
@@ -260,11 +260,11 @@ lucy_NumUtil_encode_bigend_f32(float val
 static CHY_INLINE void 
 lucy_NumUtil_encode_bigend_f64(double value, void *dest_ptr)
 {
-    chy_u8_t *dest = *(chy_u8_t**)dest_ptr;
+    uint8_t *dest = *(uint8_t**)dest_ptr;
 #ifdef CHY_BIG_END
     memcpy(dest, &value, sizeof(double));
 #else 
-    union { double d; chy_u64_t u64; } duo; 
+    union { double d; uint64_t u64; } duo; 
     duo.d = value;
     lucy_NumUtil_encode_bigend_u64(duo.u64, &dest);
 #endif
@@ -273,7 +273,7 @@ lucy_NumUtil_encode_bigend_f64(double va
 static CHY_INLINE float 
 lucy_NumUtil_decode_bigend_f32(void *source)
 {
-    union { float f; chy_u32_t u32; } duo;
+    union { float f; uint32_t u32; } duo;
     memcpy(&duo, source, sizeof(float));
 #ifdef CHY_LITTLE_END 
     duo.u32 = lucy_NumUtil_decode_bigend_u32(&duo.u32);
@@ -284,7 +284,7 @@ lucy_NumUtil_decode_bigend_f32(void *sou
 static CHY_INLINE double 
 lucy_NumUtil_decode_bigend_f64(void *source)
 {
-    union { double d; chy_u64_t u64; } duo;
+    union { double d; uint64_t u64; } duo;
     memcpy(&duo, source, sizeof(double));
 #ifdef CHY_LITTLE_END 
     duo.u64 = lucy_NumUtil_decode_bigend_u64(&duo.u64);
@@ -292,16 +292,16 @@ lucy_NumUtil_decode_bigend_f64(void *sou
     return duo.d;
 }
 
-#define LUCY_NUMUTIL_C32_MAX_BYTES  ((sizeof(chy_u32_t) * 8 / 7) + 1) // 5 
-#define LUCY_NUMUTIL_C64_MAX_BYTES ((sizeof(chy_u64_t) * 8 / 7) + 1)  // 10 
+#define LUCY_NUMUTIL_C32_MAX_BYTES  ((sizeof(uint32_t) * 8 / 7) + 1) // 5 
+#define LUCY_NUMUTIL_C64_MAX_BYTES ((sizeof(uint64_t) * 8 / 7) + 1)  // 10 
 
 static CHY_INLINE void
-lucy_NumUtil_encode_c32(chy_u32_t number, char **out_buf)
+lucy_NumUtil_encode_c32(uint32_t number, char **out_buf)
 {
-    chy_u8_t   buf[LUCY_NUMUTIL_C32_MAX_BYTES];
-    chy_u32_t  aU32        = number;
-    chy_u8_t  *const limit = buf + sizeof(buf);
-    chy_u8_t  *ptr         = limit - 1;
+    uint8_t   buf[LUCY_NUMUTIL_C32_MAX_BYTES];
+    uint32_t  aU32        = number;
+    uint8_t  *const limit = buf + sizeof(buf);
+    uint8_t  *ptr         = limit - 1;
     int        num_bytes;
     // Write last byte first, which has no continue bit. 
     *ptr = aU32 & 0x7f;
@@ -317,12 +317,12 @@ lucy_NumUtil_encode_c32(chy_u32_t number
 }
 
 static CHY_INLINE void
-lucy_NumUtil_encode_c64(chy_u64_t number, char **out_buf)
+lucy_NumUtil_encode_c64(uint64_t number, char **out_buf)
 {
-    chy_u8_t   buf[LUCY_NUMUTIL_C64_MAX_BYTES];
-    chy_u64_t  aU64        = number;
-    chy_u8_t  *const limit = buf + sizeof(buf);
-    chy_u8_t  *ptr         = limit - 1;
+    uint8_t   buf[LUCY_NUMUTIL_C64_MAX_BYTES];
+    uint64_t  aU64        = number;
+    uint8_t  *const limit = buf + sizeof(buf);
+    uint8_t  *ptr         = limit - 1;
     int        num_bytes;
     // Write last byte first, which has no continue bit. 
     *ptr = aU64 & 0x7f;
@@ -338,13 +338,13 @@ lucy_NumUtil_encode_c64(chy_u64_t number
 }
 
 static CHY_INLINE void
-lucy_NumUtil_encode_padded_c32(chy_u32_t number, char **out_buf)
+lucy_NumUtil_encode_padded_c32(uint32_t number, char **out_buf)
 {
-    chy_u8_t buf[LUCY_NUMUTIL_C32_MAX_BYTES]
+    uint8_t buf[LUCY_NUMUTIL_C32_MAX_BYTES]
         = { 0x80, 0x80, 0x80, 0x80, 0x80 };
-    chy_u32_t aU32        = number;
-    chy_u8_t *const limit = buf + sizeof(buf);
-    chy_u8_t *ptr         = limit - 1;
+    uint32_t aU32        = number;
+    uint8_t *const limit = buf + sizeof(buf);
+    uint8_t *ptr         = limit - 1;
     // Write last byte first, which has no continue bit. 
     *ptr = aU32 & 0x7f;
     aU32 >>= 7;
@@ -366,21 +366,21 @@ lucy_NumUtil_encode_padded_c32(chy_u32_t
         }  \
     } while (0)
 
-static CHY_INLINE chy_u32_t
+static CHY_INLINE uint32_t
 lucy_NumUtil_decode_c32(char **source_ptr)
 {
     char *source = *source_ptr;
-    chy_u32_t decoded = (*source & 0x7f); 
+    uint32_t decoded = (*source & 0x7f); 
     LUCY_NUMUTIL_DECODE_CINT(decoded, source);
     *source_ptr = source;
     return decoded;
 }
 
-static CHY_INLINE chy_u64_t
+static CHY_INLINE uint64_t
 lucy_NumUtil_decode_c64(char **source_ptr)
 {
     char *source = *source_ptr;
-    chy_u64_t decoded = (*source & 0x7f); 
+    uint64_t decoded = (*source & 0x7f); 
     LUCY_NUMUTIL_DECODE_CINT(decoded, source);
     *source_ptr = source;
     return decoded;
@@ -389,87 +389,87 @@ lucy_NumUtil_decode_c64(char **source_pt
 static CHY_INLINE void
 lucy_NumUtil_skip_cint(char **source_ptr)
 {
-    chy_u8_t *ptr = *(chy_u8_t**)source_ptr;
+    uint8_t *ptr = *(uint8_t**)source_ptr;
     while ((*ptr++ & 0x80) != 0) { }
     *source_ptr = (char*)ptr;
 }
 
 static CHY_INLINE chy_bool_t
-lucy_NumUtil_u1get(void *array, chy_u32_t tick) 
+lucy_NumUtil_u1get(void *array, uint32_t tick) 
 {
-    chy_u8_t *const u8bits      = (chy_u8_t*)array;
-    const chy_u32_t byte_offset = tick >> 3;
-    const chy_u8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
+    uint8_t *const u8bits      = (uint8_t*)array;
+    const uint32_t byte_offset = tick >> 3;
+    const uint8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
     return !((u8bits[byte_offset] & mask) == 0);
 }
 
 static CHY_INLINE void 
-lucy_NumUtil_u1set(void *array, chy_u32_t tick) 
+lucy_NumUtil_u1set(void *array, uint32_t tick) 
 {
-    chy_u8_t *const u8bits      = (chy_u8_t*)array;
-    const chy_u32_t byte_offset = tick >> 3;
-    const chy_u8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
+    uint8_t *const u8bits      = (uint8_t*)array;
+    const uint32_t byte_offset = tick >> 3;
+    const uint8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
     u8bits[byte_offset] |= mask;
 }
 
 static CHY_INLINE void 
-lucy_NumUtil_u1clear(void *array, chy_u32_t tick) 
+lucy_NumUtil_u1clear(void *array, uint32_t tick) 
 {
-    chy_u8_t *const u8bits      = (chy_u8_t*)array;
-    const chy_u32_t byte_offset = tick >> 3;
-    const chy_u8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
+    uint8_t *const u8bits      = (uint8_t*)array;
+    const uint32_t byte_offset = tick >> 3;
+    const uint8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
     u8bits[byte_offset] &= ~mask;
 }
 
 static CHY_INLINE void
-lucy_NumUtil_u1flip(void *array, chy_u32_t tick) 
+lucy_NumUtil_u1flip(void *array, uint32_t tick) 
 {
-    chy_u8_t *const u8bits      = (chy_u8_t*)array;
-    const chy_u32_t byte_offset = tick >> 3;
-    const chy_u8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
+    uint8_t *const u8bits      = (uint8_t*)array;
+    const uint32_t byte_offset = tick >> 3;
+    const uint8_t  mask        = lucy_NumUtil_u1masks[tick & 0x7];
     u8bits[byte_offset] ^= mask;
 }
 
-static CHY_INLINE chy_u8_t
-lucy_NumUtil_u2get(void *array, chy_u32_t tick) 
+static CHY_INLINE uint8_t
+lucy_NumUtil_u2get(void *array, uint32_t tick) 
 {
-    chy_u8_t *ints  = (chy_u8_t*)array;
-    chy_u8_t  byte  = ints[ (tick >> 2) ];
-    int       shift = lucy_NumUtil_u2shifts[ tick & 0x3 ];
+    uint8_t *ints  = (uint8_t*)array;
+    uint8_t  byte  = ints[ (tick >> 2) ];
+    int      shift = lucy_NumUtil_u2shifts[ tick & 0x3 ];
     return (byte >> shift) & 0x3;
 }
 
 static CHY_INLINE void 
-lucy_NumUtil_u2set(void *array, chy_u32_t tick, chy_u8_t value) 
+lucy_NumUtil_u2set(void *array, uint32_t tick, uint8_t value) 
 {
-    chy_u8_t *ints     = (chy_u8_t*)array;
-    unsigned  sub_tick = tick & 0x3;
-    int       shift    = lucy_NumUtil_u2shifts[sub_tick];
-    chy_u8_t  mask     = lucy_NumUtil_u2masks[sub_tick];
-    chy_u8_t  new_val  = value & 0x3;
-    chy_u8_t  new_bits = new_val << shift;
+    uint8_t *ints     = (uint8_t*)array;
+    unsigned sub_tick = tick & 0x3;
+    int      shift    = lucy_NumUtil_u2shifts[sub_tick];
+    uint8_t  mask     = lucy_NumUtil_u2masks[sub_tick];
+    uint8_t  new_val  = value & 0x3;
+    uint8_t  new_bits = new_val << shift;
     ints[(tick >> 2)]  = (ints[(tick >> 2)] & ~mask) | new_bits;
 }
 
 
-static CHY_INLINE chy_u8_t
-lucy_NumUtil_u4get(void *array, chy_u32_t tick) 
+static CHY_INLINE uint8_t
+lucy_NumUtil_u4get(void *array, uint32_t tick) 
 {
-    chy_u8_t *ints  = (chy_u8_t*)array;
-    chy_u8_t  byte  = ints[ (tick >> 1) ];
-    int       shift = lucy_NumUtil_u4shifts[(tick & 1)]; 
+    uint8_t *ints  = (uint8_t*)array;
+    uint8_t  byte  = ints[ (tick >> 1) ];
+    int      shift = lucy_NumUtil_u4shifts[(tick & 1)]; 
     return (byte >> shift) & 0xF;
 }
 
 static CHY_INLINE void 
-lucy_NumUtil_u4set(void *array, chy_u32_t tick, chy_u8_t value) 
+lucy_NumUtil_u4set(void *array, uint32_t tick, uint8_t value) 
 {
-    chy_u8_t *ints     = (chy_u8_t*)array;
+    uint8_t  *ints     = (uint8_t*)array;
     unsigned  sub_tick = tick & 0x1;
     int       shift    = lucy_NumUtil_u4shifts[sub_tick];
-    chy_u8_t  mask     = lucy_NumUtil_u4masks[sub_tick];
-    chy_u8_t  new_val  = value & 0xF;
-    chy_u8_t  new_bits = new_val << shift;
+    uint8_t   mask     = lucy_NumUtil_u4masks[sub_tick];
+    uint8_t   new_val  = value & 0xF;
+    uint8_t   new_bits = new_val << shift;
     ints[(tick >> 1)]  = (ints[(tick >> 1)] & ~mask) | new_bits;
 }
 

Modified: lucene/lucy/trunk/core/Lucy/Util/NumberUtils.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/NumberUtils.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/NumberUtils.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/NumberUtils.c Fri Apr  2 23:07:51 2010
@@ -6,15 +6,15 @@
 
 #include "Lucy/Util/NumberUtils.h"
 
-const chy_u8_t NumUtil_u1masks[8] = {
+const uint8_t NumUtil_u1masks[8] = {
     0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
 };
 
-const u8_t NumUtil_u2shifts[4] = { 0x0, 0x2, 0x4,  0x6  };
-const u8_t NumUtil_u2masks[4]  = { 0x3, 0xC, 0x30, 0xC0 };
+const uint8_t NumUtil_u2shifts[4] = { 0x0, 0x2, 0x4,  0x6  };
+const uint8_t NumUtil_u2masks[4]  = { 0x3, 0xC, 0x30, 0xC0 };
 
-const u8_t NumUtil_u4shifts[2] = { 0x00, 0x04 };
-const u8_t NumUtil_u4masks[2]  = { 0x0F, 0xF0 };
+const uint8_t NumUtil_u4shifts[2] = { 0x00, 0x04 };
+const uint8_t NumUtil_u4masks[2]  = { 0x0F, 0xF0 };
 
 /* Copyright 2009 The Apache Software Foundation
  *

Modified: lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.bp Fri Apr  2 23:07:51 2010
@@ -10,8 +10,8 @@ parcel Lucy;
 
 class Lucy::Util::PriorityQueue cnick PriQ
     extends Lucy::Object::Obj {
-    u32_t   size;
-    u32_t   max_size;
+    uint32_t   size;
+    uint32_t   max_size;
 
     /* This particular priority queue variant leaves slot 0 open in order to
      * keep the relationship between node rank and index clear in the up_heap
@@ -23,7 +23,7 @@ class Lucy::Util::PriorityQueue cnick Pr
      * @param max_size Max elements the queue can hold.
      */
     inert PriorityQueue*
-    init(PriorityQueue *self, u32_t max_size);
+    init(PriorityQueue *self, uint32_t max_size);
 
     /** Compare queue elements.
      */
@@ -61,7 +61,7 @@ class Lucy::Util::PriorityQueue cnick Pr
 
     /** Accessor for "size" member. 
      */
-    u32_t
+    uint32_t
     Get_Size(PriorityQueue *self);
 
     public void

Modified: lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/PriorityQueue.c Fri Apr  2 23:07:51 2010
@@ -27,9 +27,9 @@ static void
 S_down_heap(PriorityQueue *self);
 
 PriorityQueue*
-PriQ_init(PriorityQueue *self, u32_t max_size)
+PriQ_init(PriorityQueue *self, uint32_t max_size)
 {
-    u32_t heap_size = max_size + 1;
+    uint32_t heap_size = max_size + 1;
 
     // Init. 
     self->size = 0;
@@ -54,7 +54,7 @@ PriQ_destroy(PriorityQueue *self) 
     SUPER_DESTROY(self, PRIORITYQUEUE);
 }
 
-u32_t
+uint32_t
 PriQ_get_size(PriorityQueue *self) { return self->size; }
 
 static void
@@ -138,7 +138,7 @@ PriQ_pop_all(PriorityQueue *self)
 
     // Map the queue nodes onto the array in reverse order. 
     if (self->size) {
-        u32_t i;
+        uint32_t i;
         for (i = self->size; i--; ) {
             Obj *const elem = PriQ_Pop(self);
             VA_Store(retval, i, elem);
@@ -162,7 +162,7 @@ PriQ_peek(PriorityQueue *self) 
 static void 
 S_clear(PriorityQueue *self) 
 {
-    u32_t i;
+    uint32_t i;
     Obj **elem_ptr = (self->heap + 1);
 
     // Node 0 is held empty, to make the algo clearer. 
@@ -177,8 +177,8 @@ S_clear(PriorityQueue *self) 
 static void
 S_up_heap(PriorityQueue *self) 
 {
-    u32_t i = self->size;
-    u32_t j = i >> 1;
+    uint32_t i = self->size;
+    uint32_t j = i >> 1;
     Obj *const node = self->heap[i]; // save bottom node 
 
     while (    j > 0 
@@ -194,9 +194,9 @@ S_up_heap(PriorityQueue *self) 
 static void
 S_down_heap(PriorityQueue *self) 
 {
-    u32_t i = 1;
-    u32_t j = i << 1;
-    u32_t k = j + 1;
+    uint32_t i = 1;
+    uint32_t j = i << 1;
+    uint32_t k = j + 1;
     Obj *node = self->heap[i]; // save top node 
 
     // Find smaller child. 

Modified: lucene/lucy/trunk/core/Lucy/Util/Sleep.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/Sleep.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/Sleep.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/Sleep.bp Fri Apr  2 23:07:51 2010
@@ -7,12 +7,12 @@ inert class Lucy::Util::Sleep {
     /** Sleep for <code>seconds</code> seconds.  
      */
     inert void
-    sleep(u32_t seconds);
+    sleep(uint32_t seconds);
 
     /** Sleep for <code>milliseconds</code> milliseconds.  
      */
     inert void
-    millisleep(u32_t milliseconds);
+    millisleep(uint32_t milliseconds);
 }
 
 /* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Util/Sleep.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/Sleep.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/Sleep.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/Sleep.c Fri Apr  2 23:07:51 2010
@@ -7,13 +7,13 @@
 #include <windows.h>
 
 void
-lucy_Sleep_sleep(chy_u32_t seconds)
+lucy_Sleep_sleep(uint32_t seconds)
 {
     Sleep(seconds * 1000);
 }
 
 void
-lucy_Sleep_millisleep(chy_u32_t milliseconds)
+lucy_Sleep_millisleep(uint32_t milliseconds)
 {
     Sleep(milliseconds);
 }
@@ -24,15 +24,15 @@ lucy_Sleep_millisleep(chy_u32_t millisec
 #include <unistd.h>
 
 void
-lucy_Sleep_sleep(chy_u32_t seconds)
+lucy_Sleep_sleep(uint32_t seconds)
 {
     sleep(seconds);
 }
 
 void
-lucy_Sleep_millisleep(chy_u32_t milliseconds)
+lucy_Sleep_millisleep(uint32_t milliseconds)
 {
-    chy_u32_t seconds = milliseconds / 1000;
+    uint32_t seconds = milliseconds / 1000;
     milliseconds  = milliseconds % 1000;
     sleep(seconds);
     // TODO: probe for usleep. 

Modified: lucene/lucy/trunk/core/Lucy/Util/SortUtils.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/SortUtils.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/SortUtils.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/SortUtils.bp Fri Apr  2 23:07:51 2010
@@ -24,13 +24,13 @@ inert class Lucy::Util::SortUtils cnick 
      * sorted.
      */
     inert void
-    mergesort(void *elems, void *scratch, u32_t num_elems, u32_t width,
+    mergesort(void *elems, void *scratch, uint32_t num_elems, uint32_t width,
               Sort_compare_t compare, void *context);
 
     /** Standard mergesort function.
      */
     inert void
-    do_sort(void *elems, void *scratch, u32_t left, u32_t right,
+    do_sort(void *elems, void *scratch, uint32_t left, uint32_t right,
             Sort_compare_t compare, void *context);
 
     /** Merge two source arrays together using the classic mergesort merge
@@ -47,8 +47,8 @@ inert class Lucy::Util::SortUtils cnick 
      * consolidated buffer.
      */
     inert void
-    merge(void *left_ptr,  u32_t left_num_elems,
-          void *right_ptr, u32_t right_num_elems,
+    merge(void *left_ptr,  uint32_t left_num_elems,
+          void *right_ptr, uint32_t right_num_elems,
           void *dest, size_t width, Sort_compare_t compare, void *context);
 
     /** Quicksort. 

Modified: lucene/lucy/trunk/core/Lucy/Util/SortUtils.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/SortUtils.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/SortUtils.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/SortUtils.c Fri Apr  2 23:07:51 2010
@@ -7,11 +7,11 @@
 #include "Lucy/Object/Err.h"
 
 /* Define four-byte and eight-byte types so that we can dereference void
- * pointers like integer pointers.  The only significance of using i32_t and
- * i64_t is that they are 4 and 8 bytes.
+ * pointers like integer pointers.  The only significance of using int32_t and
+ * int64_t is that they are 4 and 8 bytes.
  */
-#define FOUR_BYTE_TYPE  i32_t
-#define EIGHT_BYTE_TYPE i64_t
+#define FOUR_BYTE_TYPE  int32_t
+#define EIGHT_BYTE_TYPE int64_t
 
 /***************************** mergesort ************************************/
 
@@ -33,7 +33,7 @@ SI_merge(void *left_vptr,  uint32_t left
          void *vdest, size_t width, Sort_compare_t compare, void *context);
 
 void
-Sort_mergesort(void *elems, void *scratch, u32_t num_elems, u32_t width,
+Sort_mergesort(void *elems, void *scratch, uint32_t num_elems, uint32_t width,
                Sort_compare_t compare, void *context) 
 {
     // Arrays of 0 or 1 items are already sorted. 
@@ -42,7 +42,7 @@ Sort_mergesort(void *elems, void *scratc
     // Validate. 
     if (num_elems >= I32_MAX) {
         THROW(ERR, "Provided %u64 elems, but can't handle more than %i32",
-            (u64_t)num_elems, I32_MAX);
+            (uint64_t)num_elems, I32_MAX);
     }
 
     // Dispatch by element size. 
@@ -171,18 +171,18 @@ SI_merge(void *left_vptr,  uint32_t left
 /* Quicksort implementations optimized for four-byte and eight-byte elements.
  */
 static void 
-S_qsort4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right,
+S_qsort4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
          Sort_compare_t compare, void *context);
 static void 
-S_qsort8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right,
+S_qsort8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
          Sort_compare_t compare, void *context);
 
 /* Swap two elements. 
  */
 static INLINE void
-SI_exchange4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right);
+SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right);
 static INLINE void
-SI_exchange8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right);
+SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right);
 
 /* Select a pivot by choosing the median of three values, guarding against
  * the worst-case behavior of quicksort.  Place the pivot in the rightmost
@@ -205,10 +205,10 @@ SI_exchange8(EIGHT_BYTE_TYPE *elems, i32
  *   aaa => aaa => aaa => aaa
  */
 static INLINE FOUR_BYTE_TYPE*
-SI_choose_pivot4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right,
+SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
                  Sort_compare_t compare, void *context);
 static INLINE EIGHT_BYTE_TYPE*
-SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right,
+SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
                  Sort_compare_t compare, void *context);
 
 void
@@ -221,7 +221,7 @@ Sort_quicksort(void *elems, size_t num_e
     // Validate. 
     if (num_elems >= I32_MAX) {
         THROW(ERR, "Provided %u64 elems, but can't handle more than %i32",
-            (u64_t)num_elems, I32_MAX);
+            (uint64_t)num_elems, I32_MAX);
     }
 
     if (width == 4) { 
@@ -231,14 +231,14 @@ Sort_quicksort(void *elems, size_t num_e
         S_qsort8((EIGHT_BYTE_TYPE*)elems, 0, num_elems - 1, compare, context);
     }
     else {
-        THROW(ERR, "Unsupported width: %i64", (i64_t)width);
+        THROW(ERR, "Unsupported width: %i64", (int64_t)width);
     }
 }
 
 /************************* quicksort 4 byte *********************************/
 
 static INLINE void
-SI_exchange4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right)
+SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right)
 {
     FOUR_BYTE_TYPE saved = elems[left];
     elems[left]  = elems[right];
@@ -246,11 +246,11 @@ SI_exchange4(FOUR_BYTE_TYPE *elems, i32_
 }
 
 static INLINE FOUR_BYTE_TYPE*
-SI_choose_pivot4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right,
+SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
                  Sort_compare_t compare, void *context)
 {
     if (right - left > 1) { 
-        i32_t mid = left + (right - left) / 2;
+        int32_t mid = left + (right - left) / 2;
         if (compare(context, elems + left, elems + mid) > 0) {
             SI_exchange4(elems, left, mid);
         }
@@ -265,15 +265,15 @@ SI_choose_pivot4(FOUR_BYTE_TYPE *elems, 
 }
 
 static void 
-S_qsort4(FOUR_BYTE_TYPE *elems, i32_t left, i32_t right,
+S_qsort4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
          Sort_compare_t compare, void *context)
 { 
     FOUR_BYTE_TYPE *const pivot 
         = SI_choose_pivot4(elems, left, right, compare, context);
-    i32_t i = left - 1;
-    i32_t j = right; 
-    i32_t p = left - 1;
-    i32_t q = right; 
+    int32_t i = left - 1;
+    int32_t j = right; 
+    int32_t p = left - 1;
+    int32_t q = right; 
 
     if (right <= left) { return; }
 
@@ -328,7 +328,7 @@ S_qsort4(FOUR_BYTE_TYPE *elems, i32_t le
      *    less_than  |       equal       |  greater_than
      */
     {
-        i32_t k;
+        int32_t k;
         SI_exchange4(elems, i, right);
         j = i - 1;
         i++;
@@ -344,7 +344,7 @@ S_qsort4(FOUR_BYTE_TYPE *elems, i32_t le
 /************************* quicksort 8 byte *********************************/
 
 static INLINE void
-SI_exchange8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right)
+SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right)
 {
     EIGHT_BYTE_TYPE saved = elems[left];
     elems[left]  = elems[right];
@@ -352,11 +352,11 @@ SI_exchange8(EIGHT_BYTE_TYPE *elems, i32
 }
 
 static INLINE EIGHT_BYTE_TYPE*
-SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right,
+SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
                  Sort_compare_t compare, void *context)
 {
     if (right - left > 1) { 
-        i32_t mid = left + (right - left) / 2;
+        int32_t mid = left + (right - left) / 2;
         if (compare(context, elems + left, elems + mid) > 0) {
             SI_exchange8(elems, left, mid);
         }
@@ -371,15 +371,15 @@ SI_choose_pivot8(EIGHT_BYTE_TYPE *elems,
 }
 
 static void 
-S_qsort8(EIGHT_BYTE_TYPE *elems, i32_t left, i32_t right,
+S_qsort8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
          Sort_compare_t compare, void *context)
 { 
     EIGHT_BYTE_TYPE *const pivot 
         = SI_choose_pivot8(elems, left, right, compare, context);
-    i32_t i = left - 1;
-    i32_t j = right; 
-    i32_t p = left - 1;
-    i32_t q = right; 
+    int32_t i = left - 1;
+    int32_t j = right; 
+    int32_t p = left - 1;
+    int32_t q = right; 
 
     if (right <= left) { return; }
 
@@ -434,7 +434,7 @@ S_qsort8(EIGHT_BYTE_TYPE *elems, i32_t l
      *    less_than  |       equal       |  greater_than
      */
     {
-        i32_t k;
+        int32_t k;
         SI_exchange8(elems, i, right);
         j = i - 1;
         i++;

Modified: lucene/lucy/trunk/core/Lucy/Util/StringHelper.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/StringHelper.bp?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/StringHelper.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/StringHelper.bp Fri Apr  2 23:07:51 2010
@@ -5,7 +5,7 @@ inert class Lucy::Util::StringHelper cni
     /* A table where the values indicate the number of bytes in a UTF-8
      * sequence implied by the leading utf8 byte.
      */
-    inert const u8_t[] UTF8_SKIP;
+    inert const uint8_t[] UTF8_SKIP;
 
     /* A table where the values indicate the number of trailing bytes in a
      * UTF-8 sequence implied by the leading utf8 byte.
@@ -15,11 +15,11 @@ inert class Lucy::Util::StringHelper cni
      * 
      * Exposed for testing only.
      */
-    inert const u8_t[] UTF8_TRAILING;
+    inert const uint8_t[] UTF8_TRAILING;
 
     /** Return the number of bytes that two strings have in common.
      */
-    inert i32_t
+    inert int32_t
     overlap(const char *a, const char *b, size_t a_len,  size_t b_len);
 
     /** Encode a NULL-terminated string representation of a value in base 36
@@ -30,8 +30,8 @@ inert class Lucy::Util::StringHelper cni
      * @return the number of digits encoded (not including the terminating
      * NULL).
      */
-    inert u32_t 
-    to_base36(u64_t value, void *buffer);
+    inert uint32_t 
+    to_base36(uint64_t value, void *buffer);
 
     /** Return true if the string is valid UTF-8, false otherwise.
      */
@@ -41,7 +41,7 @@ inert class Lucy::Util::StringHelper cni
     /** Returns true if the code point qualifies as Unicode whitespace.
      */
     inert bool_t
-    is_whitespace(u32_t code_point); 
+    is_whitespace(uint32_t code_point); 
 
     /** Encode a Unicode code point to a UTF-8 sequence.  
      * 
@@ -49,12 +49,12 @@ inert class Lucy::Util::StringHelper cni
      * @param buffer Write buffer which must hold at least 4 bytes (the
      * maximum legal length for a UTF-8 char).
      */
-    inert u32_t
-    encode_utf8_char(u32_t code_point, void *buffer);
+    inert uint32_t
+    encode_utf8_char(uint32_t code_point, void *buffer);
 
     /** Decode a UTF-8 sequence to a Unicode code point.  Assumes valid UTF-8. 
      */
-    inert u32_t
+    inert uint32_t
     decode_utf8_char(const char *utf8);
 
     /** Return the first non-continuation byte before the supplied pointer.

Modified: lucene/lucy/trunk/core/Lucy/Util/StringHelper.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/StringHelper.c?rev=930424&r1=930423&r2=930424&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/StringHelper.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/StringHelper.c Fri Apr  2 23:07:51 2010
@@ -8,7 +8,7 @@
 #include "Lucy/Object/Err.h"
 #include "Lucy/Util/Memory.h"
 
-const u8_t StrHelp_UTF8_SKIP[] = {
+const uint8_t StrHelp_UTF8_SKIP[] = {
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
@@ -20,7 +20,7 @@ const u8_t StrHelp_UTF8_SKIP[] = {
 };
 #define SKIP_MASK 0x7
 
-const u8_t StrHelp_UTF8_TRAILING[] = {
+const uint8_t StrHelp_UTF8_TRAILING[] = {
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -32,7 +32,7 @@ const u8_t StrHelp_UTF8_TRAILING[] = {
 };
 #define TRAILING_MASK 0x7
 
-i32_t
+int32_t
 StrHelp_overlap(const char *a, const char *b, size_t a_len,  size_t b_len)
 {
     size_t i;
@@ -46,8 +46,8 @@ StrHelp_overlap(const char *a, const cha
 
 static const char base36_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
 
-u32_t
-StrHelp_to_base36(u64_t num, void *buffer) 
+uint32_t
+StrHelp_to_base36(uint64_t num, void *buffer) 
 {
     char  my_buf[StrHelp_MAX_BASE36_BYTES];
     char *buf = my_buf + StrHelp_MAX_BASE36_BYTES - 1;
@@ -63,7 +63,7 @@ StrHelp_to_base36(u64_t num, void *buffe
     } while (num > 0);
 
     {
-        u32_t size = end - buf;
+        uint32_t size = end - buf;
         memcpy(buffer, buf, size + 1);
         return size;
     }
@@ -120,40 +120,40 @@ StrHelp_utf8_valid(const char *ptr, size
     return trailing == 0 ? true : false;
 }
 
-u32_t
-StrHelp_encode_utf8_char(u32_t code_point, void *buffer)
+uint32_t
+StrHelp_encode_utf8_char(uint32_t code_point, void *buffer)
 {
-    u8_t *buf = (u8_t*)buffer;
+    uint8_t *buf = (uint8_t*)buffer;
     if (code_point <= 0x7F) { // ASCII 
-        buf[0] = (u8_t)code_point;
+        buf[0] = (uint8_t)code_point;
         return 1;
     }
     else if (code_point <= 0x07FF) { // 2 byte range 
-        buf[0] = (u8_t)(0xC0 | (code_point >> 6));
-        buf[1] = (u8_t)(0x80 | (code_point & 0x3f));
+        buf[0] = (uint8_t)(0xC0 | (code_point >> 6));
+        buf[1] = (uint8_t)(0x80 | (code_point & 0x3f));
         return 2;
     }
     else if (code_point <= 0xFFFF) { // 3 byte range 
-        buf[0] = (u8_t)(0xE0 | ( code_point >> 12       ));
-        buf[1] = (u8_t)(0x80 | ((code_point >> 6) & 0x3F));
-        buf[2] = (u8_t)(0x80 | ( code_point       & 0x3f));
+        buf[0] = (uint8_t)(0xE0 | ( code_point >> 12       ));
+        buf[1] = (uint8_t)(0x80 | ((code_point >> 6) & 0x3F));
+        buf[2] = (uint8_t)(0x80 | ( code_point       & 0x3f));
         return 3;
     }
     else if (code_point <= 0x10FFFF) { // 4 byte range 
-        buf[0] = (u8_t)(0xF0 | ( code_point >> 18        ));
-        buf[1] = (u8_t)(0x80 | ((code_point >> 12) & 0x3F));
-        buf[2] = (u8_t)(0x80 | ((code_point >> 6 ) & 0x3F));
-        buf[3] = (u8_t)(0x80 | ( code_point        & 0x3f));
+        buf[0] = (uint8_t)(0xF0 | ( code_point >> 18        ));
+        buf[1] = (uint8_t)(0x80 | ((code_point >> 12) & 0x3F));
+        buf[2] = (uint8_t)(0x80 | ((code_point >> 6 ) & 0x3F));
+        buf[3] = (uint8_t)(0x80 | ( code_point        & 0x3f));
         return 4;
     }
     else {
         THROW(ERR, "Illegal Unicode code point: %u32", code_point);
-        UNREACHABLE_RETURN(u32_t);
+        UNREACHABLE_RETURN(uint32_t);
     }
 }
 
 bool_t
-StrHelp_is_whitespace(u32_t code_point)
+StrHelp_is_whitespace(uint32_t code_point)
 {
     switch (code_point) {
                  // <control-0009>..<control-000D> 
@@ -179,11 +179,11 @@ StrHelp_is_whitespace(u32_t code_point)
     }
 }
 
-u32_t
+uint32_t
 StrHelp_decode_utf8_char(const char *ptr)
 {
-    const u8_t *const string = (const u8_t*)ptr;
-    u32_t retval = *string;
+    const uint8_t *const string = (const uint8_t*)ptr;
+    uint32_t retval = *string;
     int trailing = StrHelp_UTF8_TRAILING[retval];
 
     switch (trailing & TRAILING_MASK) {



Mime
View raw message