lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r930588 - in /lucene/lucy/trunk/core/Lucy/Object: BitVector.c ByteBuf.c CharBuf.c Err.bp Err.c Hash.c LockFreeRegistry.c VArray.c VTable.c
Date Sat, 03 Apr 2010 22:35:05 GMT
Author: marvin
Date: Sat Apr  3 22:35:05 2010
New Revision: 930588

URL: http://svn.apache.org/viewvc?rev=930588&view=rev
Log:
Change over core/Lucy/Object to C99-style line comments.

Modified:
    lucene/lucy/trunk/core/Lucy/Object/BitVector.c
    lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c
    lucene/lucy/trunk/core/Lucy/Object/CharBuf.c
    lucene/lucy/trunk/core/Lucy/Object/Err.bp
    lucene/lucy/trunk/core/Lucy/Object/Err.c
    lucene/lucy/trunk/core/Lucy/Object/Hash.c
    lucene/lucy/trunk/core/Lucy/Object/LockFreeRegistry.c
    lucene/lucy/trunk/core/Lucy/Object/VArray.c
    lucene/lucy/trunk/core/Lucy/Object/VTable.c

Modified: lucene/lucy/trunk/core/Lucy/Object/BitVector.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/BitVector.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/BitVector.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/BitVector.c Sat Apr  3 22:35:05 2010
@@ -5,15 +5,13 @@
 
 #include "Lucy/Object/BitVector.h"
 
-/* Shared subroutine for performing both OR and XOR ops.
- */
+// Shared subroutine for performing both OR and XOR ops.
 #define DO_OR 1
 #define DO_XOR 2
 static void
 S_do_or_or_xor(BitVector *self, const BitVector *other, int operation);
 
-/* Number of 1 bits given a u8 value. 
- */
+// Number of 1 bits given a u8 value. 
 static const uint32_t BYTE_COUNTS[256] = {
     0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
     1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
@@ -46,12 +44,12 @@ BitVec_init(BitVector *self, uint32_t ca
 {
     const uint32_t byte_size = (uint32_t)ceil(capacity / 8.0);
 
-    /* Derive. */
+    // Derive. 
     self->bits = capacity 
                ? (uint8_t*)CALLOCATE(byte_size, sizeof(uint8_t)) 
                : NULL;
 
-    /* Assign. */
+    // Assign. 
     self->cap      = byte_size * 8;
 
     return self;
@@ -70,7 +68,7 @@ BitVec_clone(BitVector *self) 
     BitVector *evil_twin = BitVec_new(self->cap);
     uint32_t   byte_size = (uint32_t)ceil(self->cap / 8.0);
 
-    /* Forbid inheritance. */
+    // Forbid inheritance. 
     if (BitVec_Get_VTable(self) != BITVECTOR) {
         THROW(ERR, "Attempt by %o to inherit BitVec_Clone", 
             BitVec_Get_Class_Name(self));
@@ -170,7 +168,7 @@ BitVec_next_set_bit(BitVector *self, uin
         return -1;
     }
     else if (*ptr != 0) {
-        /* Special case the first byte. */
+        // Special case the first byte. 
         const int32_t base = (ptr - self->bits) * 8;
         const int32_t min_sub_tick = tick & 0x7;
         unsigned int byte = *ptr >> min_sub_tick;
@@ -183,7 +181,7 @@ BitVec_next_set_bit(BitVector *self, uin
 
     for (ptr++ ; ptr < limit; ptr++) {
         if (*ptr != 0) {
-            /* There's a non-zero bit in this byte. */
+            // There's a non-zero bit in this byte. 
             const int32_t base = (ptr - self->bits) * 8;
             const int32_t candidate = base + S_first_bit_in_nonzero_byte(*ptr);
             return candidate < (int32_t)self->cap ? candidate : -1;
@@ -204,13 +202,13 @@ BitVec_and(BitVector *self, const BitVec
     const size_t byte_size = (size_t)ceil(min_cap / 8.0);
     uint8_t *const limit = bits_a + byte_size;
 
-    /* Intersection. */
+    // Intersection. 
     while (bits_a < limit) {
         *bits_a &= *bits_b;
         bits_a++, bits_b++;
     }
 
-    /* Set all remaining to zero. */
+    // Set all remaining to zero. 
     if (self->cap > min_cap) {
         const size_t self_byte_size = (size_t)ceil(self->cap / 8.0);
         memset(bits_a, 0, self_byte_size - byte_size);
@@ -237,7 +235,7 @@ S_do_or_or_xor(BitVector *self, const Bi
     uint8_t *limit;
     double byte_size;
 
-    /* Sort out what the minimum and maximum caps are. */
+    // Sort out what the minimum and maximum caps are. 
     if (self->cap < other->cap) {
         max_cap = other->cap;
         min_cap = self->cap;
@@ -247,14 +245,14 @@ S_do_or_or_xor(BitVector *self, const Bi
         min_cap = other->cap;
     }
 
-    /* Grow self if smaller than other, then calc pointers. */
+    // Grow self if smaller than other, then calc pointers. 
     if (max_cap > self->cap) { BitVec_Grow(self, max_cap); }
     bits_a        = self->bits;
     bits_b        = other->bits;
     byte_size     = ceil(min_cap / 8.0);
     limit         = self->bits + (size_t)byte_size;
 
-    /* Perform union of common bits. */
+    // Perform union of common bits. 
     if (operation == DO_OR) {
         while (bits_a < limit) {
             *bits_a |= *bits_b;
@@ -271,7 +269,7 @@ S_do_or_or_xor(BitVector *self, const Bi
         THROW(ERR, "Unrecognized operation: %i32", (int32_t)operation);
     }
 
-    /* Copy remaining bits if other is bigger than self. */
+    // Copy remaining bits if other is bigger than self. 
     if (other->cap > min_cap) {
         const double other_byte_size = ceil(other->cap / 8.0);
         const size_t bytes_to_copy = (size_t)(other_byte_size - byte_size);
@@ -290,7 +288,7 @@ BitVec_and_not(BitVector *self, const Bi
     const size_t byte_size = (size_t)ceil(min_cap / 8.0);
     uint8_t *const limit = bits_a + byte_size;
 
-    /* Clear bits set in other. */
+    // Clear bits set in other. 
     while (bits_a < limit) {
         *bits_a &= ~(*bits_b);
         bits_a++, bits_b++;
@@ -313,12 +311,12 @@ BitVec_flip_block(BitVector *self, uint3
     uint32_t first = offset;
     uint32_t last  = offset + length - 1;
 
-    /* Bail if there's nothing to flip. */
+    // Bail if there's nothing to flip. 
     if (!length) { return; }
 
     if (last >= self->cap) { BitVec_Grow(self, last + 1); }
 
-    /* Flip partial bytes. */
+    // Flip partial bytes. 
     while (last % 8 != 0 && last > first) {
         NumUtil_u1flip(self->bits, last);
         last--;
@@ -328,22 +326,22 @@ BitVec_flip_block(BitVector *self, uint3
         first++;
     }
 
-    /* Are first and last equal? */
+    // Are first and last equal? 
     if (first == last) {
-        /* There's only one bit left to flip. */
+        // There's only one bit left to flip. 
         NumUtil_u1flip(self->bits, last);
     }
-    /* They must be multiples of 8, then. */
+    // They must be multiples of 8, then. 
     else {
         const uint32_t start_tick = first >> 3;
         const uint32_t limit_tick = last  >> 3;
         uint8_t *bits  = self->bits + start_tick;
         uint8_t *limit = self->bits + limit_tick;
 
-        /* Last actually belongs to the following byte (e.g. 8, in byte 2). */
+        // Last actually belongs to the following byte (e.g. 8, in byte 2). 
         NumUtil_u1flip(self->bits, last);
 
-        /* Flip whole bytes. */
+        // Flip whole bytes. 
         for ( ; bits < limit; bits++) {
             *bits = ~(*bits);
         }

Modified: lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c Sat Apr  3 22:35:05 2010
@@ -234,10 +234,10 @@ ViewBB_new(char *buf, size_t size) 
 {
     ViewByteBuf *self = (ViewByteBuf*)VTable_Make_Obj(VIEWBYTEBUF);
 
-    /* Init. */
+    // Init. 
     self->cap = 0;
 
-    /* Assign. */
+    // Assign. 
     self->buf  = buf;
     self->size = size;
     

Modified: lucene/lucy/trunk/core/Lucy/Object/CharBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/CharBuf.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/CharBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/CharBuf.c Sat Apr  3 22:35:05 2010
@@ -18,22 +18,21 @@
 #include "Lucy/Util/Memory.h"
 #include "Lucy/Util/StringHelper.h"
 
-/* The end of the string (address of terminating NULL). */
+// The end of the string (address of terminating NULL). 
 #define CBEND(self) ((self)->ptr + (self)->size)
 
-/* Maximum number of characters in a stringified 64-bit integer, including
- * minus sign if negative.
- */
+// Maximum number of characters in a stringified 64-bit integer, including
+// minus sign if negative.
 #define MAX_I64_CHARS 20
 
-/* Helper function for throwing invalid UTF-8 error. Since THROW uses
- * a CharBuf internally, calling THROW with invalid UTF-8 would create an
- * infinite loop -- so we fwrite some of the bogus text to stderr invoke
- * THROW with a generic message. */
+// Helper function for throwing invalid UTF-8 error. Since THROW uses
+// a CharBuf internally, calling THROW with invalid UTF-8 would create an
+// infinite loop -- so we fwrite some of the bogus text to stderr invoke
+// THROW with a generic message.
 static void
 S_die_invalid_utf8(const char *text, size_t size);
 
-/* Helper function for throwing invalid pattern error. */
+// Helper function for throwing invalid pattern error. 
 static void
 S_die_invalid_pattern(const char *pattern);
 
@@ -49,13 +48,13 @@ CB_new(size_t size) 
 CharBuf*
 CB_init(CharBuf *self, size_t size) 
 {
-    /* Derive. */
+    // Derive. 
     self->ptr = (char*)MALLOCATE(size + 1);
 
-     /* Init. */
-    *self->ptr = '\0'; /* Empty string. */
+     // Init. 
+    *self->ptr = '\0'; // Empty string. 
  
-    /* Assign. */
+    // Assign. 
     self->size   = 0;
     self->cap    = size + 1;
 
@@ -75,16 +74,16 @@ CB_new_from_trusted_utf8(const char *ptr
 {
     CharBuf *self = (CharBuf*)VTable_Make_Obj(CHARBUF);
 
-    /* Derive. */
+    // Derive. 
     self->ptr = (char*)MALLOCATE(size + 1);
 
-    /* Copy. */
+    // Copy. 
     memcpy(self->ptr, ptr, size);
 
-    /* Assign. */
+    // Assign. 
     self->size      = size;
     self->cap       = size + 1; 
-    self->ptr[size] = '\0'; /* Null terminate. */
+    self->ptr[size] = '\0'; // Null terminate. 
     
     return self;
 }
@@ -209,7 +208,7 @@ CB_vcatf(CharBuf *self, const char *patt
     for ( ; pattern < pattern_end; pattern++) {
         const char *slice_end = pattern;
 
-        /* Consume all characters leading up to a '%'. */
+        // Consume all characters leading up to a '%'. 
         while (slice_end < pattern_end && *slice_end != '%') { slice_end++; }
         if (pattern != slice_end) {
             size_t size = slice_end - pattern;
@@ -218,7 +217,7 @@ CB_vcatf(CharBuf *self, const char *patt
         }
 
         if (pattern < pattern_end) {
-            pattern++; /* Move past '%'. */
+            pattern++; // Move past '%'. 
 
             switch (*pattern) {
                 case '%': {
@@ -333,9 +332,9 @@ CB_vcatf(CharBuf *self, const char *patt
                 } 
                 break;
 
-                /* Assume NULL-terminated pattern string, which eliminates the
-                 * need for bounds checking if '%' is the last visible
-                 * character. */
+                // Assume NULL-terminated pattern string, which eliminates the
+                // need for bounds checking if '%' is the last visible
+                // character.
                 default: {
                     S_die_invalid_pattern(pattern_start);
                 }
@@ -400,13 +399,13 @@ CB_basex_to_i64(CharBuf *self, uint32_t 
     int64_t retval = 0;
     bool_t is_negative = false;
 
-    /* Advance past minus sign. */
+    // Advance past minus sign. 
     if (ZCB_Code_Point_At(iterator, 0) == '-') { 
         ZCB_Nip_One(iterator);
         is_negative = true;
     }
 
-    /* Accumulate. */
+    // Accumulate. 
     while (iterator->size) {
         int32_t code_point = ZCB_Nip_One(iterator);
         if (isalnum(code_point)) {
@@ -422,7 +421,7 @@ CB_basex_to_i64(CharBuf *self, uint32_t 
         }
     }
 
-    /* Apply minus sign. */
+    // Apply minus sign. 
     if (is_negative) retval = 0 - retval;
 
     return retval;
@@ -613,7 +612,7 @@ CB_trim_top(CharBuf *self)
     }
 
     if (count) {
-        /* Copy string backwards. */
+        // Copy string backwards. 
         self->size = CBEND(self) - ptr;
         memmove(self->ptr, ptr, self->size);
     }
@@ -808,8 +807,8 @@ ViewCB_init(ViewCharBuf *self, const cha
 void
 ViewCB_destroy(ViewCharBuf *self)
 {
-    /* Note that we do not free self->ptr, and that we invoke the
-     * SUPER_DESTROY with CHARBUF instead of VIEWCHARBUF. */
+    // Note that we do not free self->ptr, and that we invoke the
+    // SUPER_DESTROY with CHARBUF instead of VIEWCHARBUF.
     SUPER_DESTROY(self, CHARBUF);
 }
 

Modified: lucene/lucy/trunk/core/Lucy/Object/Err.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Err.bp?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Err.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Err.bp Sat Apr  3 22:35:05 2010
@@ -153,7 +153,7 @@ __C__
     lucy_Err_rethrow((lucy_Err*)_error, __FILE__, __LINE__, \
         LUCY_ERR_FUNC_MACRO)
 
-/* Macro version of lucy_Err_throw_at which inserts contextual information
+/** Macro version of lucy_Err_throw_at which inserts contextual information
  * automatically, provided that the compiler supports the necessary features.
  */
 #ifdef CHY_HAS_VARIADIC_MACROS

Modified: lucene/lucy/trunk/core/Lucy/Object/Err.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Err.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Err.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Err.c Sat Apr  3 22:35:05 2010
@@ -53,7 +53,7 @@ Err_cat_mess(Err *self, const CharBuf *m
     CB_Cat(self->mess, mess);
 }
 
-/* Fallbacks in case variadic macros aren't available. */
+// Fallbacks in case variadic macros aren't available. 
 #ifndef CHY_HAS_VARIADIC_MACROS
 void
 THROW(VTable *vtable, char *pattern, ...)
@@ -177,7 +177,7 @@ lucy_Err_throw_at(VTable *vtable, const 
     Err_do_throw(err);
 }
 
-/* Inlined, slightly optimized version of Obj_is_a. */
+// Inlined, slightly optimized version of Obj_is_a. 
 static INLINE bool_t
 SI_obj_is_a(Obj *obj, VTable *target_vtable)
 {
@@ -228,12 +228,12 @@ Err_win_error()
     size_t buf_size = 256;
     char *buf = (char*)MALLOCATE(buf_size);
     size_t message_len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 
-        NULL,       /* message source table */
+        NULL,       // message source table 
         GetLastError(),
-        0,          /* language id */
+        0,          // language id 
         buf,
         buf_size,
-        NULL        /* empty va_list */
+        NULL        // empty va_list 
     );
     if (message_len == 0) {
         char unknown[] = "Unknown error";
@@ -241,7 +241,7 @@ Err_win_error()
         strncpy(buf, unknown, len);
     }
     else if (message_len > 1) {
-        /* Kill stupid newline. */
+        // Kill stupid newline. 
         buf[message_len - 2] = '\0';
     }
     return buf;
@@ -252,10 +252,10 @@ Err_win_error()
 char*
 Err_win_error()
 {
-    return NULL; /* Never called. */
+    return NULL; // Never called. 
 }
 
-#endif /* CHY_HAS_WINDOWS_H */
+#endif // CHY_HAS_WINDOWS_H 
 
 /* Copyright 2009 The Apache Software Foundation
  *

Modified: lucene/lucy/trunk/core/Lucy/Object/Hash.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Hash.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Hash.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Hash.c Sat Apr  3 22:35:05 2010
@@ -25,13 +25,11 @@ typedef struct lucy_HashEntry {
     int32_t  hash_code;
 } lucy_HashEntry;
 
-/* Reset the iterator.  Hash_iter_init must be called to restart iteration.
- */
+// Reset the iterator.  Hash_iter_init must be called to restart iteration.
 static INLINE void
 SI_kill_iter(Hash *self);
 
-/* Return the entry associated with the key, if any.
- */
+// Return the entry associated with the key, if any.
 static INLINE HashEntry*
 SI_fetch_entry(Hash *self, const Obj *key, int32_t hash_code);
 
@@ -54,8 +52,8 @@ Hash_new(uint32_t capacity)
 Hash*
 Hash_init(Hash *self, uint32_t capacity)
 {
-    /* Allocate enough space to hold the requested number of elements without
-     * triggering a rebuild. */
+    // Allocate enough space to hold the requested number of elements without
+    // triggering a rebuild.
     uint32_t requested_capacity = capacity < I32_MAX ? capacity : I32_MAX;
     uint32_t threshold;
     capacity = 16;
@@ -65,11 +63,11 @@ Hash_init(Hash *self, uint32_t capacity)
         capacity *= 2;
     }
 
-    /* Init. */
+    // Init. 
     self->size         = 0;
     self->iter_tick    = -1;
 
-    /* Derive. */
+    // Derive. 
     self->capacity     = capacity;
     self->entries      = (HashEntry*)CALLOCATE(capacity, sizeof(HashEntry));
     self->threshold    = threshold;
@@ -96,8 +94,8 @@ Hash_dump(Hash *self)
 
     Hash_Iter_Init(self);
     while (Hash_Iter_Next(self, &key, &value)) {
-        /* Since JSON only supports text hash keys, Dump() can only support
-         * text hash keys. */
+        // Since JSON only supports text hash keys, Dump() can only support
+        // text hash keys.
         CERTIFY(key, CHARBUF);
         Hash_Store(dump, key, Obj_Dump(value));
     }
@@ -112,8 +110,8 @@ Hash_load(Hash *self, Obj *dump)
     CharBuf *class_name = (CharBuf*)Hash_Fetch_Str(source, "_class", 6);
     UNUSED_VAR(self);
 
-    /* Assume that the presence of the "_class" key paired with a valid class
-     * name indicates the output of a Dump rather than an ordinary Hash. */
+    // Assume that the presence of the "_class" key paired with a valid class
+    // name indicates the output of a Dump rather than an ordinary Hash. */
     if (class_name && CB_Is_A(class_name, CHARBUF)) {
         VTable *vtable = VTable_fetch_vtable(class_name);
 
@@ -125,26 +123,26 @@ Hash_load(Hash *self, Obj *dump)
                 DECREF(parent_class);
             }
             else {
-                /* TODO: Fix Hash_Load() so that it works with ordinary hash
-                 * keys named "_class". */
+                // TODO: Fix Hash_Load() so that it works with ordinary hash
+                // keys named "_class".
                 THROW(ERR, "Can't find class '%o'", class_name);
             }
         }
 
-        /* Dispatch to an alternate Load() method. */
+        // Dispatch to an alternate Load() method. 
         if (vtable) {
             Obj_load_t load = (Obj_load_t)METHOD(vtable, Obj, Load);
             if (load == Obj_load) {
                 THROW(ERR, "Abstract method Load() not defined for %o", 
                     VTable_Get_Name(vtable));
             }
-            else if (load != (Obj_load_t)Hash_load) { /* stop inf loop */
+            else if (load != (Obj_load_t)Hash_load) { // stop inf loop 
                 return load(NULL, dump);
             }
         }
     }
 
-    /* It's an ordinary Hash. */
+    // It's an ordinary Hash. 
     {
         Hash *loaded = Hash_new(source->size);
         Obj *key;
@@ -167,9 +165,9 @@ Hash_serialize(Hash *self, OutStream *ou
     uint32_t charbuf_count = 0;
     OutStream_Write_C32(outstream, self->size);
 
-    /* Write CharBuf keys first.  CharBuf keys are the common case; grouping
-     * them together is a form of run-length-encoding and saves space, since
-     * we omit the per-key class name. */
+    // Write CharBuf keys first.  CharBuf keys are the common case; grouping
+    // them together is a form of run-length-encoding and saves space, since
+    // we omit the per-key class name.
     Hash_Iter_Init(self);
     while (Hash_Iter_Next(self, &key, &val)) {
         if (Obj_Is_A(key, CHARBUF)) { charbuf_count++; }
@@ -183,7 +181,7 @@ Hash_serialize(Hash *self, OutStream *ou
         }
     }
 
-    /* Punt on the classes of the remaining keys. */
+    // Punt on the classes of the remaining keys. 
     Hash_Iter_Init(self);
     while (Hash_Iter_Next(self, &key, &val)) {
         if (!Obj_Is_A(key, CHARBUF)) { 
@@ -204,7 +202,7 @@ Hash_deserialize(Hash *self, InStream *i
     if (self) Hash_init(self, size);
     else self = Hash_new(size);
  
-    /* Read key-value pairs with CharBuf keys. */
+    // Read key-value pairs with CharBuf keys. 
     while (num_charbufs--) {
         uint32_t len = InStream_Read_C32(instream);
         char *key_buf = CB_Grow(key, len);
@@ -215,7 +213,7 @@ Hash_deserialize(Hash *self, InStream *i
     }
     DECREF(key);
     
-    /* Read remaining key/value pairs. */
+    // Read remaining key/value pairs. 
     while (num_other--) {
         Obj *k = THAW(instream);
         Hash_Store(self, k, THAW(instream));
@@ -231,7 +229,7 @@ Hash_clear(Hash *self) 
     HashEntry *entry       = (HashEntry*)self->entries;
     HashEntry *const limit = entry + self->capacity;
 
-    /* Iterate through all entries. */
+    // Iterate through all entries. 
     for ( ; entry < limit; entry++) {
         if (!entry->key) { continue; }
         DECREF(entry->key);
@@ -259,7 +257,7 @@ lucy_Hash_do_store(Hash *self, Obj *key,
         HashEntry *entry = entries + tick;
         if (entry->key == (Obj*)UNDEF || !entry->key) {
             if (entry->key == (Obj*)UNDEF) { 
-                /* Take note of diminished tombstone clutter. */
+                // Take note of diminished tombstone clutter. 
                 self->threshold++; 
             }
             entry->key       = use_this_key 
@@ -277,7 +275,7 @@ lucy_Hash_do_store(Hash *self, Obj *key,
             entry->value = value;
             break;
         }
-        tick++; /* linear scan */
+        tick++; // linear scan 
     }
 }
 
@@ -321,7 +319,7 @@ SI_fetch_entry(Hash *self, const Obj *ke
         tick &= self->capacity - 1;
         entry = entries + tick;
         if (!entry->key) { 
-            /* Failed to find the key, so return NULL. */
+            // Failed to find the key, so return NULL. 
             return NULL; 
         }
         else if (   entry->hash_code == hash_code
@@ -351,7 +349,7 @@ Hash_delete(Hash *self, const Obj *key) 
         entry->value     = NULL;
         entry->hash_code = 0;
         self->size--;
-        self->threshold--; /* limit number of tombstones */
+        self->threshold--; // limit number of tombstones 
         return value;
     }
     else {
@@ -384,7 +382,7 @@ Hash_iter_next(Hash *self, Obj **key, Ob
 {
     while (1) {
         if (++self->iter_tick >= (int32_t)self->capacity) {
-            /* Bail since we've completed the iteration. */
+            // Bail since we've completed the iteration. 
             --self->iter_tick;
             *key   = NULL;
             *value = NULL;
@@ -394,7 +392,7 @@ Hash_iter_next(Hash *self, Obj **key, Ob
             HashEntry *const entry 
                 = (HashEntry*)self->entries + self->iter_tick;
             if (entry->key && entry->key != (Obj*)UNDEF) {
-                /* Success! */
+                // Success! 
                 *key   = entry->key;
                 *value = entry->value;
                 return true;

Modified: lucene/lucy/trunk/core/Lucy/Object/LockFreeRegistry.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/LockFreeRegistry.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/LockFreeRegistry.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/LockFreeRegistry.c Sat Apr  3 22:35:05 2010
@@ -41,8 +41,8 @@ LFReg_register(LockFreeRegistry *self, O
     LFRegEntry  *volatile *entries = (LFRegEntry*volatile*)self->entries;
     LFRegEntry  *volatile *slot    = &(entries[bucket]);
 
-    /* Proceed through the linked list.  Bail out if the key has already been
-     * registered. */
+    // Proceed through the linked list.  Bail out if the key has already been
+    // registered.
     FIND_END_OF_LINKED_LIST:
     while (*slot) {
         LFRegEntry *entry = *slot;
@@ -54,7 +54,7 @@ LFReg_register(LockFreeRegistry *self, O
         slot = &(entry->next);
     }
 
-    /* We've found an empty slot. Create the new entry. */ 
+    // We've found an empty slot. Create the new entry.  
     if (!new_entry) {
         new_entry = (LFRegEntry*)MALLOCATE(sizeof(LFRegEntry));
         new_entry->hash_code = hash_code;

Modified: lucene/lucy/trunk/core/Lucy/Object/VArray.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/VArray.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/VArray.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/VArray.c Sat Apr  3 22:35:05 2010
@@ -25,13 +25,13 @@ VA_new(uint32_t capacity) 
 VArray*
 VA_init(VArray *self, uint32_t capacity)
 {
-    /* Init. */
+    // Init. 
     self->size = 0;
 
-    /* Assign. */
+    // Assign. 
     self->cap = capacity;
 
-    /* Derive. */
+    // Derive. 
     self->elems = (Obj**)CALLOCATE(capacity, sizeof(Obj*));
 
     return self;
@@ -95,7 +95,7 @@ VA_serialize(VArray *self, OutStream *ou
             last_valid_tick = i;
         }
     }
-    /* Terminate. */
+    // Terminate. 
     OutStream_Write_C32(outstream, self->size - last_valid_tick);
 }
 
@@ -127,7 +127,7 @@ VA_clone(VArray *self)
     uint32_t i;
     VArray *evil_twin = VA_new(self->size);
 
-    /* Clone each element. */
+    // Clone each element. 
     for (i = 0; i < self->size; i++) {
         Obj *elem = self->elems[i];
         if (elem) {
@@ -135,7 +135,7 @@ VA_clone(VArray *self)
         }
     }
 
-    /* Ensure that size is the same if NULL elems at end. */
+    // Ensure that size is the same if NULL elems at end. 
     evil_twin->size = self->size;
 
     return evil_twin;
@@ -148,7 +148,7 @@ VA_shallow_copy(VArray *self)
     VArray *evil_twin;
     Obj **elems;
 
-    /* Dupe, then increment refcounts. */
+    // Dupe, then increment refcounts. 
     evil_twin = VA_new(self->size);
     elems = evil_twin->elems;
     memcpy(elems, self->elems, self->size * sizeof(Obj*));
@@ -318,8 +318,8 @@ S_default_compare(void *context, const v
     UNUSED_VAR(context);
     if      (a != NULL && b != NULL) { return Obj_Compare_To(a, b); }
     else if (a == NULL && b == NULL) { return 0;  }
-    else if (a == NULL)              { return 1;  } /* NULL to the back */
-    else  /* b == NULL */            { return -1; } /* NULL to the back */
+    else if (a == NULL)              { return 1;  } // NULL to the back 
+    else  /* b == NULL */            { return -1; } // NULL to the back 
 }
 
 void

Modified: lucene/lucy/trunk/core/Lucy/Object/VTable.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/VTable.c?rev=930588&r1=930587&r2=930588&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/VTable.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/VTable.c Sat Apr  3 22:35:05 2010
@@ -18,7 +18,7 @@
 
 size_t lucy_VTable_offset_of_parent = offsetof(lucy_VTable, parent);
 
-/* Remove spaces and underscores, convert to lower case. */
+// Remove spaces and underscores, convert to lower case. 
 static void
 S_scrunch_charbuf(CharBuf *source, CharBuf *target);
 
@@ -126,15 +126,15 @@ VTable_singleton(const CharBuf *subclass
             }
         }
 
-        /* Copy source vtable. */
+        // Copy source vtable. 
         singleton = VTable_Clone(parent);
 
-        /* Turn clone into child. */
+        // Turn clone into child. 
         singleton->parent = parent; 
         DECREF(singleton->name);
         singleton->name = CB_Clone(subclass_name);
         
-        /* Allow host methods to override. */
+        // Allow host methods to override. 
         novel_host_methods = VTable_novel_host_methods(subclass_name);
         num_novel = VA_Get_Size(novel_host_methods);
         if (num_novel) {
@@ -162,9 +162,9 @@ VTable_singleton(const CharBuf *subclass
         }
         DECREF(novel_host_methods);
 
-        /* Register the new class, both locally and with host. */
+        // Register the new class, both locally and with host. 
         if (VTable_add_to_registry(singleton)) {
-            /* Doing this after registering is racy, but hard to fix. :( */
+            // Doing this after registering is racy, but hard to fix. :( 
             VTable_register_with_host(singleton, parent);
         }
         else {



Mime
View raw message