You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/05/02 02:15:22 UTC
[lucy-commits] svn commit: r1098448 - in /incubator/lucy/trunk:
charmonizer/src/Charmonizer/Probe/ core/Lucy/Analysis/ core/Lucy/Highlight/
core/Lucy/Index/ core/Lucy/Object/ core/Lucy/Plan/ core/Lucy/Search/
core/Lucy/Store/ core/Lucy/Test/Util/ core/Lucy/Util/ core...
Author: marvin
Date: Mon May 2 00:15:20 2011
New Revision: 1098448
URL: http://svn.apache.org/viewvc?rev=1098448&view=rev
Log:
LUCY-141 brackets.patch
Add brackets to single-line statements. Adapt whitespace as appropriate.
Modified:
incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c
incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c
incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c
incubator/lucy/trunk/core/Lucy/Highlight/HeatMap.c
incubator/lucy/trunk/core/Lucy/Highlight/Highlighter.c
incubator/lucy/trunk/core/Lucy/Index/DocVector.c
incubator/lucy/trunk/core/Lucy/Index/PolyLexicon.c
incubator/lucy/trunk/core/Lucy/Index/PolyReader.c
incubator/lucy/trunk/core/Lucy/Index/PostingListReader.c
incubator/lucy/trunk/core/Lucy/Index/SegWriter.c
incubator/lucy/trunk/core/Lucy/Index/Similarity.c
incubator/lucy/trunk/core/Lucy/Index/TermVector.c
incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c
incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
incubator/lucy/trunk/core/Lucy/Object/Hash.c
incubator/lucy/trunk/core/Lucy/Object/VArray.c
incubator/lucy/trunk/core/Lucy/Plan/Architecture.c
incubator/lucy/trunk/core/Lucy/Plan/BlobType.c
incubator/lucy/trunk/core/Lucy/Plan/FieldType.c
incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c
incubator/lucy/trunk/core/Lucy/Plan/Schema.c
incubator/lucy/trunk/core/Lucy/Plan/StringType.c
incubator/lucy/trunk/core/Lucy/Search/ANDMatcher.c
incubator/lucy/trunk/core/Lucy/Search/ANDQuery.c
incubator/lucy/trunk/core/Lucy/Search/Compiler.c
incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c
incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c
incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c
incubator/lucy/trunk/core/Lucy/Search/ORQuery.c
incubator/lucy/trunk/core/Lucy/Search/PhraseMatcher.c
incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c
incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c
incubator/lucy/trunk/core/Lucy/Search/QueryParser.c
incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c
incubator/lucy/trunk/core/Lucy/Search/TermQuery.c
incubator/lucy/trunk/core/Lucy/Store/FSDirHandle.c
incubator/lucy/trunk/core/Lucy/Store/FSFolder.c
incubator/lucy/trunk/core/Lucy/Test/Util/BBSortEx.c
incubator/lucy/trunk/core/Lucy/Util/Debug.c
incubator/lucy/trunk/core/Lucy/Util/IndexFileNames.c
incubator/lucy/trunk/core/Lucy/Util/PriorityQueue.c
incubator/lucy/trunk/core/LucyX/Search/ProximityMatcher.c
incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c
incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c
incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c Mon May 2 00:15:20 2011
@@ -359,8 +359,9 @@ S_test_sparse_file(long offset, Stat *st
/* Make sure the file's not there, then open. */
Util_remove_and_verify("_charm_sparse");
- if ((sparse_fh = fopen("_charm_sparse", "w+")) == NULL)
+ if ((sparse_fh = fopen("_charm_sparse", "w+")) == NULL) {
Util_die("Couldn't open file '_charm_sparse'");
+ }
/* Seek fh to [offset], write a byte, close file. */
if ((fseek(sparse_fh, offset, SEEK_SET)) == -1) {
Modified: incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c Mon May 2 00:15:20 2011
@@ -43,9 +43,9 @@ CaseFolder_destroy(CaseFolder *self) {
bool_t
CaseFolder_equals(CaseFolder *self, Obj *other) {
CaseFolder *const twin = (CaseFolder*)other;
- if (twin == self) return true;
+ if (twin == self) { return true; }
UNUSED_VAR(self);
- if (!Obj_Is_A(other, CASEFOLDER)) return false;
+ if (!Obj_Is_A(other, CASEFOLDER)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c Mon May 2 00:15:20 2011
@@ -110,9 +110,9 @@ PolyAnalyzer_transform_text(PolyAnalyzer
bool_t
PolyAnalyzer_equals(PolyAnalyzer *self, Obj *other) {
PolyAnalyzer *const twin = (PolyAnalyzer*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, POLYANALYZER)) return false;
- if (!VA_Equals(twin->analyzers, (Obj*)self->analyzers)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, POLYANALYZER)) { return false; }
+ if (!VA_Equals(twin->analyzers, (Obj*)self->analyzers)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c Mon May 2 00:15:20 2011
@@ -72,9 +72,9 @@ RegexTokenizer_load(RegexTokenizer *self
bool_t
RegexTokenizer_equals(RegexTokenizer *self, Obj *other) {
RegexTokenizer *const twin = (RegexTokenizer*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, REGEXTOKENIZER)) return false;
- if (!CB_Equals(twin->pattern, (Obj*)self->pattern)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, REGEXTOKENIZER)) { return false; }
+ if (!CB_Equals(twin->pattern, (Obj*)self->pattern)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c Mon May 2 00:15:20 2011
@@ -102,9 +102,9 @@ SnowStemmer_load(SnowballStemmer *self,
bool_t
SnowStemmer_equals(SnowballStemmer *self, Obj *other) {
SnowballStemmer *const twin = (SnowballStemmer*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, SNOWBALLSTEMMER)) return false;
- if (!CB_Equals(twin->language, (Obj*)self->language)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, SNOWBALLSTEMMER)) { return false; }
+ if (!CB_Equals(twin->language, (Obj*)self->language)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c Mon May 2 00:15:20 2011
@@ -75,8 +75,8 @@ SnowStop_transform(SnowballStopFilter *s
bool_t
SnowStop_equals(SnowballStopFilter *self, Obj *other) {
SnowballStopFilter *const twin = (SnowballStopFilter*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, SNOWBALLSTOPFILTER)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, SNOWBALLSTOPFILTER)) { return false; }
if (!Hash_Equals(twin->stoplist, (Obj*)self->stoplist)) {
return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Highlight/HeatMap.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Highlight/HeatMap.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Highlight/HeatMap.c (original)
+++ incubator/lucy/trunk/core/Lucy/Highlight/HeatMap.c Mon May 2 00:15:20 2011
@@ -160,7 +160,7 @@ HeatMap_calc_proximity_boost(HeatMap *se
int32_t distance = upper->offset - lower_end_offset;
// If spans overlap, set distance to 0.
- if (distance < 0) distance = 0;
+ if (distance < 0) { distance = 0; }
if (distance > (int32_t)self->window) {
return 0.0f;
Modified: incubator/lucy/trunk/core/Lucy/Highlight/Highlighter.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Highlight/Highlighter.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Highlight/Highlighter.c (original)
+++ incubator/lucy/trunk/core/Lucy/Highlight/Highlighter.c Mon May 2 00:15:20 2011
@@ -356,7 +356,7 @@ Highlighter_raw_excerpt(Highlighter *sel
int32_t this_excerpt_len = found_ending_edge
? end - start
: (int32_t)self->excerpt_length;
- if (!this_excerpt_len) return start;
+ if (!this_excerpt_len) { return start; }
if (found_starting_edge) {
ZombieCharBuf *temp = ZCB_WRAP((CharBuf*)field_val);
@@ -557,7 +557,7 @@ Highlighter_find_sentences(Highlighter *
if (!code_point) {
// End of fragment. If we have a sentence open, close it,
// then bail.
- if (sentence) S_close_sentence(sentences, &sentence, pos);
+ if (sentence) { S_close_sentence(sentences, &sentence, pos); }
break;
}
else if (code_point == '.') {
@@ -566,13 +566,13 @@ Highlighter_find_sentences(Highlighter *
if (pos == stop && ZCB_Get_Size(fragment) == 0) {
// Period ending the field string.
- if (sentence) S_close_sentence(sentences, &sentence, pos);
+ if (sentence) { S_close_sentence(sentences, &sentence, pos); }
break;
}
else if (0 != (whitespace_count = ZCB_Trim_Top(fragment))) {
// We've found a period followed by whitespace. Close out the
// existing sentence, if there is one. */
- if (sentence) S_close_sentence(sentences, &sentence, pos);
+ if (sentence) { S_close_sentence(sentences, &sentence, pos); }
// Advance past whitespace.
pos += whitespace_count;
@@ -586,7 +586,7 @@ Highlighter_find_sentences(Highlighter *
// We may not have reached the end of the field yet, but it's
// entirely possible that our last sentence overlapped the end of
// the fragment -- in which case, it's time to bail.
- if (pos >= stop) break;
+ if (pos >= stop) { break; }
}
else {
ZCB_Nip(fragment, 1);
@@ -610,7 +610,7 @@ S_do_encode(Highlighter *self, CharBuf *
return Highlighter_Encode(self, text);
}
else {
- if (*encode_buf == NULL) *encode_buf = CB_new(0);
+ if (*encode_buf == NULL) { *encode_buf = CB_new(0); }
(void)S_encode_entities(text, *encode_buf);
return (CharBuf*)INCREF(*encode_buf);
}
Modified: incubator/lucy/trunk/core/Lucy/Index/DocVector.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/DocVector.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/DocVector.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/DocVector.c Mon May 2 00:15:20 2011
@@ -94,7 +94,7 @@ DocVec_term_vector(DocVector *self, cons
= (ByteBuf*)Hash_Fetch(self->field_bufs, (Obj*)field);
// Bail if there's no content or the field isn't highlightable.
- if (field_buf == NULL) return NULL;
+ if (field_buf == NULL) { return NULL; }
field_vector = S_extract_tv_cache(field_buf);
Hash_Store(self->field_vectors, (Obj*)field, (Obj*)field_vector);
Modified: incubator/lucy/trunk/core/Lucy/Index/PolyLexicon.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/PolyLexicon.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/PolyLexicon.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/PolyLexicon.c Mon May 2 00:15:20 2011
@@ -77,7 +77,7 @@ S_refresh_lex_q(SegLexQueue *lex_q, VArr
// Empty out the queue.
while (1) {
SegLexicon *seg_lex = (SegLexicon*)SegLexQ_Pop(lex_q);
- if (seg_lex == NULL) break;
+ if (seg_lex == NULL) { break; }
DECREF(seg_lex);
}
@@ -102,7 +102,7 @@ PolyLex_reset(PolyLexicon *self) {
// Empty out the queue.
while (1) {
SegLexicon *seg_lex = (SegLexicon*)SegLexQ_Pop(lex_q);
- if (seg_lex == NULL) break;
+ if (seg_lex == NULL) { break; }
DECREF(seg_lex);
}
Modified: incubator/lucy/trunk/core/Lucy/Index/PolyReader.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/PolyReader.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/PolyReader.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/PolyReader.c Mon May 2 00:15:20 2011
@@ -281,7 +281,7 @@ PolyReader_do_open(PolyReader *self, Obj
PolyReader_init(self, NULL, folder, snapshot, manager, NULL);
DECREF(folder);
- if (manager) S_obtain_deletion_lock(self);
+ if (manager) { S_obtain_deletion_lock(self); }
while (1) {
CharBuf *target_snap_file;
@@ -340,7 +340,7 @@ PolyReader_do_open(PolyReader *self, Obj
continue;
}
else { // Real error.
- if (manager) S_release_deletion_lock(self);
+ if (manager) { S_release_deletion_lock(self); }
Err_throw_mess(ERR, error);
}
}
@@ -362,7 +362,7 @@ PolyReader_do_open(PolyReader *self, Obj
last_gen = gen;
}
else { // Real error.
- if (manager) S_release_deletion_lock(self);
+ if (manager) { S_release_deletion_lock(self); }
Err_throw_mess(ERR, (CharBuf*)result);
}
}
Modified: incubator/lucy/trunk/core/Lucy/Index/PostingListReader.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/PostingListReader.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/PostingListReader.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/PostingListReader.c Mon May 2 00:15:20 2011
@@ -115,7 +115,7 @@ DefPListReader_posting_list(DefaultPosti
// Only return an object if we've got an indexed field.
if (type != NULL && FType_Indexed(type)) {
SegPostingList *plist = SegPList_new((PostingListReader*)self, field);
- if (target) SegPList_Seek(plist, target);
+ if (target) { SegPList_Seek(plist, target); }
return plist;
}
else {
Modified: incubator/lucy/trunk/core/Lucy/Index/SegWriter.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/SegWriter.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/SegWriter.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/SegWriter.c Mon May 2 00:15:20 2011
@@ -124,7 +124,7 @@ S_adjust_doc_id(SegWriter *self, SegRead
uint32_t doc_count = SegReader_Doc_Max(reader);
uint32_t i, max;
for (i = 1, max = I32Arr_Get_Size(doc_map); i < max; i++) {
- if (I32Arr_Get(doc_map, i) == 0) doc_count--;
+ if (I32Arr_Get(doc_map, i) == 0) { doc_count--; }
}
Seg_Increment_Count(self->segment, doc_count);
}
Modified: incubator/lucy/trunk/core/Lucy/Index/Similarity.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/Similarity.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/Similarity.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/Similarity.c Mon May 2 00:15:20 2011
@@ -120,7 +120,7 @@ Sim_deserialize(Similarity *self, InStre
bool_t
Sim_equals(Similarity *self, Obj *other) {
- if (Sim_Get_VTable(self) != Obj_Get_VTable(other)) return false;
+ if (Sim_Get_VTable(self) != Obj_Get_VTable(other)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Index/TermVector.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/TermVector.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/TermVector.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/TermVector.c Mon May 2 00:15:20 2011
@@ -138,16 +138,16 @@ TV_equals(TermVector *self, Obj *other)
int32_t *const other_starts = twin->start_offsets->ints;
int32_t *const other_ends = twin->start_offsets->ints;
- if (twin == self) return true;
+ if (twin == self) { return true; }
- if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
- if (!CB_Equals(self->text, (Obj*)twin->text)) return false;
- if (self->num_pos != twin->num_pos) return false;
+ if (!CB_Equals(self->field, (Obj*)twin->field)) { return false; }
+ if (!CB_Equals(self->text, (Obj*)twin->text)) { return false; }
+ if (self->num_pos != twin->num_pos) { return false; }
for (i = 0; i < self->num_pos; i++) {
- if (posits[i] != other_posits[i]) return false;
- if (starts[i] != other_starts[i]) return false;
- if (ends[i] != other_ends[i]) return false;
+ if (posits[i] != other_posits[i]) { return false; }
+ if (starts[i] != other_starts[i]) { return false; }
+ if (ends[i] != other_ends[i]) { return false; }
}
return true;
Modified: incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c Mon May 2 00:15:20 2011
@@ -112,8 +112,8 @@ SI_equals_bytes(ByteBuf *self, const voi
bool_t
BB_equals(ByteBuf *self, Obj *other) {
ByteBuf *const twin = (ByteBuf*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, BYTEBUF)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, BYTEBUF)) { return false; }
return SI_equals_bytes(self, twin->buf, twin->size);
}
Modified: incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/CharBuf.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/CharBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/CharBuf.c Mon May 2 00:15:20 2011
@@ -166,7 +166,7 @@ S_die_invalid_utf8(const char *text, siz
const char *func) {
fprintf(stderr, "Invalid UTF-8, aborting: '");
fwrite(text, sizeof(char), size < 200 ? size : 200, stderr);
- if (size > 200) fwrite("[...]", sizeof(char), 5, stderr);
+ if (size > 200) { fwrite("[...]", sizeof(char), 5, stderr); }
fprintf(stderr, "' (length %lu)\n", (unsigned long)size);
Err_throw_at(ERR, file, line, func, "Invalid UTF-8");
}
@@ -400,7 +400,7 @@ CB_basex_to_i64(CharBuf *self, uint32_t
int32_t addend = isdigit(code_point)
? code_point - '0'
: tolower(code_point) - 'a' + 10;
- if (addend > (int32_t)base) break;
+ if (addend > (int32_t)base) { break; }
retval *= base;
retval += addend;
}
@@ -410,7 +410,7 @@ CB_basex_to_i64(CharBuf *self, uint32_t
}
// Apply minus sign.
- if (is_negative) retval = 0 - retval;
+ if (is_negative) { retval = 0 - retval; }
return retval;
}
@@ -544,8 +544,8 @@ CB_starts_with_str(CharBuf *self, const
bool_t
CB_equals(CharBuf *self, Obj *other) {
CharBuf *const twin = (CharBuf*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, CHARBUF)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, CHARBUF)) { return false; }
return CB_equals_str(self, twin->ptr, twin->size);
}
@@ -614,7 +614,7 @@ CB_trim_top(CharBuf *self) {
while (ptr < end) {
uint32_t code_point = StrHelp_decode_utf8_char(ptr);
- if (!StrHelp_is_whitespace(code_point)) break;
+ if (!StrHelp_is_whitespace(code_point)) { break; }
ptr += StrHelp_UTF8_COUNT[*(uint8_t*)ptr];
count++;
}
@@ -637,7 +637,7 @@ CB_trim_tail(CharBuf *self) {
while (NULL != (ptr = StrHelp_back_utf8_char(ptr, top))) {
uint32_t code_point = StrHelp_decode_utf8_char(ptr);
- if (!StrHelp_is_whitespace(code_point)) break;
+ if (!StrHelp_is_whitespace(code_point)) { break; }
new_size = ptr - top;
count++;
}
@@ -681,7 +681,7 @@ CB_chop(CharBuf *self, size_t count) {
const char *ptr = top + self->size;
for (num_chopped = 0; num_chopped < count; num_chopped++) {
const char *end = ptr;
- if (NULL == (ptr = StrHelp_back_utf8_char(ptr, top))) break;
+ if (NULL == (ptr = StrHelp_back_utf8_char(ptr, top))) { break; }
self->size -= (end - ptr);
}
return num_chopped;
@@ -715,7 +715,7 @@ CB_code_point_at(CharBuf *self, size_t t
char *const end = ptr + self->size;
for (; ptr < end; ptr += StrHelp_UTF8_COUNT[*(uint8_t*)ptr]) {
- if (count == tick) return StrHelp_decode_utf8_char(ptr);
+ if (count == tick) { return StrHelp_decode_utf8_char(ptr); }
count++;
}
@@ -729,7 +729,7 @@ CB_code_point_from(CharBuf *self, size_t
const char *ptr = top + self->size;
for (count = 0; count < tick; count++) {
- if (NULL == (ptr = StrHelp_back_utf8_char(ptr, top))) return 0;
+ if (NULL == (ptr = StrHelp_back_utf8_char(ptr, top))) { return 0; }
}
return StrHelp_decode_utf8_char(ptr);
}
@@ -758,7 +758,7 @@ CB_compare(const void *va, const void *v
int32_t code_point_a = ZCB_Nip_One(iterator_a);
int32_t code_point_b = ZCB_Nip_One(iterator_b);
const int32_t comparison = code_point_a - code_point_b;
- if (comparison != 0) return comparison;
+ if (comparison != 0) { return comparison; }
}
if (iterator_a->size != iterator_b->size) {
return iterator_a->size < iterator_b->size ? -1 : 1;
@@ -846,7 +846,7 @@ ViewCB_trim_top(ViewCharBuf *self) {
while (ptr < end) {
uint32_t code_point = StrHelp_decode_utf8_char(ptr);
- if (!StrHelp_is_whitespace(code_point)) break;
+ if (!StrHelp_is_whitespace(code_point)) { break; }
ptr += StrHelp_UTF8_COUNT[*(uint8_t*)ptr];
count++;
}
Modified: incubator/lucy/trunk/core/Lucy/Object/Hash.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/Hash.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/Hash.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/Hash.c Mon May 2 00:15:20 2011
@@ -208,8 +208,8 @@ Hash_deserialize(Hash *self, InStream *i
uint32_t num_other = size - num_charbufs;
CharBuf *key = num_charbufs ? CB_new(0) : NULL;
- if (self) Hash_init(self, size);
- else self = Hash_new(size);
+ if (self) { Hash_init(self, size); }
+ else { self = Hash_new(size); }
// Read key-value pairs with CharBuf keys.
while (num_charbufs--) {
@@ -421,7 +421,7 @@ Hash_values(Hash *self) {
Obj *val;
VArray *values = VA_new(self->size);
Hash_Iterate(self);
- while (Hash_Next(self, &key, &val)) VA_push(values, INCREF(val));
+ while (Hash_Next(self, &key, &val)) { VA_push(values, INCREF(val)); }
return values;
}
@@ -431,14 +431,14 @@ Hash_equals(Hash *self, Obj *other) {
Obj *key;
Obj *val;
- if (twin == self) return true;
- if (!Obj_Is_A(other, HASH)) return false;
- if (self->size != twin->size) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, HASH)) { return false; }
+ if (self->size != twin->size) { return false; }
Hash_Iterate(self);
while (Hash_Next(self, &key, &val)) {
Obj *other_val = Hash_Fetch(twin, key);
- if (!other_val || !Obj_Equals(other_val, val)) return false;
+ if (!other_val || !Obj_Equals(other_val, val)) { return false; }
}
return true;
Modified: incubator/lucy/trunk/core/Lucy/Object/VArray.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/VArray.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/VArray.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/VArray.c Mon May 2 00:15:20 2011
@@ -118,7 +118,7 @@ VA_deserialize(VArray *self, InStream *i
self->cap = size + 1;
self->elems = (Obj**)CALLOCATE(self->cap, sizeof(Obj*));
}
- else self = VA_new(size);
+ else { self = VA_new(size); }
for (tick = InStream_Read_C32(instream);
tick < size;
tick += InStream_Read_C32(instream)
@@ -274,8 +274,8 @@ VA_excise(VArray *self, uint32_t offset,
uint32_t i;
uint32_t num_to_move;
- if (self->size <= offset) return;
- else if (self->size < offset + length) length = self->size - offset;
+ if (self->size <= offset) { return; }
+ else if (self->size < offset + length) { length = self->size - offset; }
for (i = 0; i < length; i++) {
DECREF(self->elems[offset + i]);
@@ -333,8 +333,8 @@ VA_sort(VArray *self, lucy_Sort_compare_
bool_t
VA_equals(VArray *self, Obj *other) {
VArray *twin = (VArray*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, VARRAY)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, VARRAY)) { return false; }
if (twin->size != self->size) {
return false;
}
@@ -343,8 +343,8 @@ VA_equals(VArray *self, Obj *other) {
for (i = 0, max = self->size; i < max; i++) {
Obj *val = self->elems[i];
Obj *other_val = twin->elems[i];
- if ((val && !other_val) || (other_val && !val)) return false;
- if (val && !Obj_Equals(val, other_val)) return false;
+ if ((val && !other_val) || (other_val && !val)) { return false; }
+ if (val && !Obj_Equals(val, other_val)) { return false; }
}
}
return true;
Modified: incubator/lucy/trunk/core/Lucy/Plan/Architecture.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/Architecture.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/Architecture.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/Architecture.c Mon May 2 00:15:20 2011
@@ -53,8 +53,8 @@ Arch_init(Architecture *self) {
bool_t
Arch_equals(Architecture *self, Obj *other) {
Architecture *twin = (Architecture*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, ARCHITECTURE)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, ARCHITECTURE)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/BlobType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/BlobType.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/BlobType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/BlobType.c Mon May 2 00:15:20 2011
@@ -59,8 +59,8 @@ BlobType_primitive_id(BlobType *self) {
bool_t
BlobType_equals(BlobType *self, Obj *other) {
BlobType *twin = (BlobType*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, BLOBTYPE)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, BLOBTYPE)) { return false; }
return FType_equals((FieldType*)self, other);
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/FieldType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/FieldType.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/FieldType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/FieldType.c Mon May 2 00:15:20 2011
@@ -99,13 +99,13 @@ FType_compare_values(FieldType *self, Ob
bool_t
FType_equals(FieldType *self, Obj *other) {
FieldType *twin = (FieldType*)other;
- if (twin == self) return true;
- if (FType_Get_VTable(self) != FType_Get_VTable(twin)) return false;
- if (self->boost != twin->boost) return false;
- if (!!self->indexed != !!twin->indexed) return false;
- if (!!self->stored != !!twin->stored) return false;
- if (!!self->sortable != !!twin->sortable) return false;
- if (!!FType_Binary(self) != !!FType_Binary(twin)) return false;
+ if (twin == self) { return true; }
+ if (FType_Get_VTable(self) != FType_Get_VTable(twin)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!!self->indexed != !!twin->indexed) { return false; }
+ if (!!self->stored != !!twin->stored) { return false; }
+ if (!!self->sortable != !!twin->sortable) { return false; }
+ if (!!FType_Binary(self) != !!FType_Binary(twin)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c Mon May 2 00:15:20 2011
@@ -59,11 +59,11 @@ FullTextType_destroy(FullTextType *self)
bool_t
FullTextType_equals(FullTextType *self, Obj *other) {
FullTextType *twin = (FullTextType*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, FULLTEXTTYPE)) return false;
- if (!FType_equals((FieldType*)self, other)) return false;
- if (!!self->sortable != !!twin->sortable) return false;
- if (!!self->highlightable != !!twin->highlightable) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, FULLTEXTTYPE)) { return false; }
+ if (!FType_equals((FieldType*)self, other)) { return false; }
+ if (!!self->sortable != !!twin->sortable) { return false; }
+ if (!!self->highlightable != !!twin->highlightable) { return false; }
if (!Analyzer_Equals(self->analyzer, (Obj*)twin->analyzer)) {
return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/Schema.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/Schema.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/Schema.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/Schema.c Mon May 2 00:15:20 2011
@@ -96,11 +96,11 @@ S_add_unique(VArray *array, Obj *elem) {
bool_t
Schema_equals(Schema *self, Obj *other) {
Schema *twin = (Schema*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, SCHEMA)) return false;
- if (!Arch_Equals(self->arch, (Obj*)twin->arch)) return false;
- if (!Sim_Equals(self->sim, (Obj*)twin->sim)) return false;
- if (!Hash_Equals(self->types, (Obj*)twin->types)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, SCHEMA)) { return false; }
+ if (!Arch_Equals(self->arch, (Obj*)twin->arch)) { return false; }
+ if (!Sim_Equals(self->sim, (Obj*)twin->sim)) { return false; }
+ if (!Hash_Equals(self->types, (Obj*)twin->types)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/StringType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/StringType.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/StringType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/StringType.c Mon May 2 00:15:20 2011
@@ -46,8 +46,8 @@ StringType_init2(StringType *self, float
bool_t
StringType_equals(StringType *self, Obj *other) {
StringType *twin = (StringType*)other;
- if (twin == self) return true;
- if (!FType_equals((FieldType*)self, other)) return false;
+ if (twin == self) { return true; }
+ if (!FType_equals((FieldType*)self, other)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/ANDMatcher.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/ANDMatcher.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/ANDMatcher.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/ANDMatcher.c Mon May 2 00:15:20 2011
@@ -40,7 +40,7 @@ ANDMatcher_init(ANDMatcher *self, VArray
for (i = 0; i < self->num_kids; i++) {
Matcher *child = (Matcher*)VA_Fetch(children, i);
self->kids[i] = child;
- if (!Matcher_Next(child)) self->more = false;
+ if (!Matcher_Next(child)) { self->more = false; }
}
// Derive.
@@ -75,7 +75,7 @@ ANDMatcher_advance(ANDMatcher *self, int
const uint32_t num_kids = self->num_kids;
int32_t highest = 0;
- if (!self->more) return 0;
+ if (!self->more) { return 0; }
// First step: Advance first child and use its doc as a starting point.
if (self->first_time) {
Modified: incubator/lucy/trunk/core/Lucy/Search/ANDQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/ANDQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/ANDQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/ANDQuery.c Mon May 2 00:15:20 2011
@@ -44,7 +44,7 @@ ANDQuery_init(ANDQuery *self, VArray *ch
CharBuf*
ANDQuery_to_string(ANDQuery *self) {
uint32_t num_kids = VA_Get_Size(self->children);
- if (!num_kids) return CB_new_from_trusted_utf8("()", 2);
+ if (!num_kids) { return CB_new_from_trusted_utf8("()", 2); }
else {
CharBuf *retval = CB_new_from_trusted_utf8("(", 1);
uint32_t i;
@@ -66,7 +66,7 @@ ANDQuery_to_string(ANDQuery *self) {
bool_t
ANDQuery_equals(ANDQuery *self, Obj *other) {
- if ((ANDQuery*)other == self) return true;
+ if ((ANDQuery*)other == self) { return true; }
if (!Obj_Is_A(other, ANDQUERY)) { return false; }
return PolyQuery_equals((PolyQuery*)self, other);
}
Modified: incubator/lucy/trunk/core/Lucy/Search/Compiler.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/Compiler.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/Compiler.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/Compiler.c Mon May 2 00:15:20 2011
@@ -112,11 +112,11 @@ Compiler_to_string(Compiler *self) {
bool_t
Compiler_equals(Compiler *self, Obj *other) {
Compiler *twin = (Compiler*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, COMPILER)) return false;
- if (self->boost != twin->boost) return false;
- if (!Query_Equals(self->parent, (Obj*)twin->parent)) return false;
- if (!Sim_Equals(self->sim, (Obj*)twin->sim)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, COMPILER)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!Query_Equals(self->parent, (Obj*)twin->parent)) { return false; }
+ if (!Sim_Equals(self->sim, (Obj*)twin->sim)) { return false; }
return true;
}
@@ -130,7 +130,7 @@ Compiler_serialize(Compiler *self, OutSt
Compiler*
Compiler_deserialize(Compiler *self, InStream *instream) {
- if (!self) THROW(ERR, "Compiler_Deserialize is abstract");
+ if (!self) { THROW(ERR, "Compiler_Deserialize is abstract"); }
self->boost = InStream_Read_F32(instream);
self->parent = (Query*)THAW(instream);
self->sim = (Similarity*)THAW(instream);
Modified: incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c Mon May 2 00:15:20 2011
@@ -57,14 +57,14 @@ LeafQuery_get_text(LeafQuery *self) {
bool_t
LeafQuery_equals(LeafQuery *self, Obj *other) {
LeafQuery *twin = (LeafQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, LEAFQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (!!self->field ^ !!twin->field) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, LEAFQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!!self->field ^ !!twin->field) { return false; }
if (self->field) {
- if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
+ if (!CB_Equals(self->field, (Obj*)twin->field)) { return false; }
}
- if (!CB_Equals(self->text, (Obj*)twin->text)) return false;
+ if (!CB_Equals(self->text, (Obj*)twin->text)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c Mon May 2 00:15:20 2011
@@ -43,8 +43,8 @@ MatchAllQuery_init(MatchAllQuery *self)
bool_t
MatchAllQuery_equals(MatchAllQuery *self, Obj *other) {
MatchAllQuery *twin = (MatchAllQuery*)other;
- if (!Obj_Is_A(other, MATCHALLQUERY)) return false;
- if (self->boost != twin->boost) return false;
+ if (!Obj_Is_A(other, MATCHALLQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c Mon May 2 00:15:20 2011
@@ -43,9 +43,9 @@ NoMatchQuery_init(NoMatchQuery *self) {
bool_t
NoMatchQuery_equals(NoMatchQuery *self, Obj *other) {
NoMatchQuery *twin = (NoMatchQuery*)other;
- if (!Obj_Is_A(other, NOMATCHQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (!!self->fails_to_match != !!twin->fails_to_match) return false;
+ if (!Obj_Is_A(other, NOMATCHQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!!self->fails_to_match != !!twin->fails_to_match) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/ORQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/ORQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/ORQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/ORQuery.c Mon May 2 00:15:20 2011
@@ -52,7 +52,7 @@ ORQuery_equals(ORQuery *self, Obj *other
CharBuf*
ORQuery_to_string(ORQuery *self) {
uint32_t num_kids = VA_Get_Size(self->children);
- if (!num_kids) return CB_new_from_trusted_utf8("()", 2);
+ if (!num_kids) { return CB_new_from_trusted_utf8("()", 2); }
else {
CharBuf *retval = CB_new_from_trusted_utf8("(", 1);
uint32_t i;
Modified: incubator/lucy/trunk/core/Lucy/Search/PhraseMatcher.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/PhraseMatcher.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/PhraseMatcher.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/PhraseMatcher.c Mon May 2 00:15:20 2011
@@ -216,22 +216,22 @@ SI_winnow_anchors(uint32_t *anchors_star
SPIN_CANDIDATES:
target_candidate = *anchors + offset;
while (*candidates < target_candidate) {
- if (++candidates == candidates_end) goto DONE;
+ if (++candidates == candidates_end) { goto DONE; }
}
- if (*candidates == target_candidate) goto MATCH;
+ if (*candidates == target_candidate) { goto MATCH; }
goto SPIN_ANCHORS;
SPIN_ANCHORS:
target_anchor = *candidates - offset;
while (*anchors < target_anchor) {
- if (++anchors == anchors_end) goto DONE;
+ if (++anchors == anchors_end) { goto DONE; }
};
- if (*anchors == target_anchor) goto MATCH;
+ if (*anchors == target_anchor) { goto MATCH; }
goto SPIN_CANDIDATES;
MATCH:
*anchors_found++ = *anchors;
- if (++anchors == anchors_end) goto DONE;
+ if (++anchors == anchors_end) { goto DONE; }
goto SPIN_CANDIDATES;
DONE:
Modified: incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c Mon May 2 00:15:20 2011
@@ -93,15 +93,15 @@ PhraseQuery_deserialize(PhraseQuery *sel
bool_t
PhraseQuery_equals(PhraseQuery *self, Obj *other) {
PhraseQuery *twin = (PhraseQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, PHRASEQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (self->field && !twin->field) return false;
- if (!self->field && twin->field) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, PHRASEQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (self->field && !twin->field) { return false; }
+ if (!self->field && twin->field) { return false; }
if (self->field && !CB_Equals(self->field, (Obj*)twin->field)) {
return false;
}
- if (!VA_Equals(twin->terms, (Obj*)self->terms)) return false;
+ if (!VA_Equals(twin->terms, (Obj*)self->terms)) { return false; }
return true;
}
@@ -217,12 +217,12 @@ PhraseCompiler_deserialize(PhraseCompile
bool_t
PhraseCompiler_equals(PhraseCompiler *self, Obj *other) {
PhraseCompiler *twin = (PhraseCompiler*)other;
- if (!Obj_Is_A(other, PHRASECOMPILER)) return false;
- if (!Compiler_equals((Compiler*)self, other)) return false;
- if (self->idf != twin->idf) return false;
- if (self->raw_weight != twin->raw_weight) return false;
- if (self->query_norm_factor != twin->query_norm_factor) return false;
- if (self->normalized_weight != twin->normalized_weight) return false;
+ if (!Obj_Is_A(other, PHRASECOMPILER)) { return false; }
+ if (!Compiler_equals((Compiler*)self, other)) { return false; }
+ if (self->idf != twin->idf) { return false; }
+ if (self->raw_weight != twin->raw_weight) { return false; }
+ if (self->query_norm_factor != twin->query_norm_factor) { return false; }
+ if (self->normalized_weight != twin->normalized_weight) { return false; }
return true;
}
@@ -251,7 +251,7 @@ PhraseCompiler_make_matcher(PhraseCompil
uint32_t num_terms = VA_Get_Size(terms);
// Bail if there are no terms.
- if (!num_terms) return NULL;
+ if (!num_terms) { return NULL; }
// Bail unless field is valid and posting type supports positions.
Similarity *sim = PhraseCompiler_Get_Similarity(self);
Modified: incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c Mon May 2 00:15:20 2011
@@ -80,7 +80,7 @@ PolyQuery_deserialize(PolyQuery *self, I
float boost = InStream_Read_F32(instream);
uint32_t num_children = InStream_Read_U32(instream);
- if (!self) THROW(ERR, "Abstract class");
+ if (!self) { THROW(ERR, "Abstract class"); }
PolyQuery_init(self, NULL);
PolyQuery_Set_Boost(self, boost);
@@ -95,10 +95,10 @@ PolyQuery_deserialize(PolyQuery *self, I
bool_t
PolyQuery_equals(PolyQuery *self, Obj *other) {
PolyQuery *twin = (PolyQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, POLYQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (!VA_Equals(twin->children, (Obj*)self->children)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, POLYQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!VA_Equals(twin->children, (Obj*)self->children)) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/QueryParser.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/QueryParser.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/QueryParser.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/QueryParser.c Mon May 2 00:15:20 2011
@@ -322,7 +322,7 @@ S_splice_out_token_type(VArray *elems, u
for (uint32_t i = VA_Get_Size(elems); i--;) {
ParserToken *token = (ParserToken*)VA_Fetch(elems, i);
if (Obj_Is_A((Obj*)token, PARSERTOKEN)) {
- if (token->type & token_type_mask) VA_Excise(elems, i, 1);
+ if (token->type & token_type_mask) { VA_Excise(elems, i, 1); }
}
}
}
@@ -465,10 +465,10 @@ S_do_tree(QueryParser *self, CharBuf *qu
}
for (j = i + 1, jmax = VA_Get_Size(elems); j < jmax; j++) {
ParserClause *clause = (ParserClause*)VA_Fetch(elems, j);
- if (Obj_Is_A((Obj*)clause, PARSERCLAUSE)) break;
- else num_to_zap++;
+ if (Obj_Is_A((Obj*)clause, PARSERCLAUSE)) { break; }
+ else { num_to_zap++; }
}
- if (num_to_zap) VA_Excise(elems, i, num_to_zap);
+ if (num_to_zap) { VA_Excise(elems, i, num_to_zap); }
}
}
@@ -510,7 +510,7 @@ S_do_tree(QueryParser *self, CharBuf *qu
VA_Excise(elems, i + 1, num_to_zap);
// Don't double wrap '(a AND b)'.
- if (VA_Get_Size(elems) == 1) apply_parens = false;
+ if (VA_Get_Size(elems) == 1) { apply_parens = false; }
}
}
@@ -552,7 +552,7 @@ S_do_tree(QueryParser *self, CharBuf *qu
VA_Excise(elems, i + 1, num_to_zap);
// Don't double wrap '(a OR b)'.
- if (VA_Get_Size(elems) == 1) apply_parens = false;
+ if (VA_Get_Size(elems) == 1) { apply_parens = false; }
}
}
@@ -666,14 +666,20 @@ S_do_tree(QueryParser *self, CharBuf *qu
static bool_t
S_has_valid_clauses(Query *query) {
- if (Query_Is_A(query, NOTQUERY)) return false;
- else if (Query_Is_A(query, MATCHALLQUERY)) return false;
+ if (Query_Is_A(query, NOTQUERY)) {
+ return false;
+ }
+ else if (Query_Is_A(query, MATCHALLQUERY)) {
+ return false;
+ }
else if (Query_Is_A(query, ORQUERY) || Query_Is_A(query, ANDQUERY)) {
PolyQuery *polyquery = (PolyQuery*)query;
VArray *children = PolyQuery_Get_Children(polyquery);
for (uint32_t i = 0, max = VA_Get_Size(children); i < max; i++) {
Query *child = (Query*)VA_Fetch(children, i);
- if (S_has_valid_clauses(child)) return true;
+ if (S_has_valid_clauses(child)) {
+ return true;
+ }
}
return false;
}
@@ -779,9 +785,16 @@ S_consume_field(ViewCharBuf *qstring, Vi
// Only alphanumerics and underscores are allowed in field names.
while (1) {
code_point = ViewCB_Code_Point_At(qstring, tick);
- if (isalnum(code_point) || code_point == '_') tick++;
- else if (code_point == ':') { tick++; break; }
- else return false;
+ if (isalnum(code_point) || code_point == '_') {
+ tick++;
+ }
+ else if (code_point == ':') {
+ tick++;
+ break;
+ }
+ else {
+ return false;
+ }
}
// Field name constructs must be followed by something sensible.
@@ -894,9 +907,9 @@ QParser_expand(QueryParser *self, Query
ReqOptQuery_Set_Optional_Query(req_opt_query, opt_query);
retval = (Query*)INCREF(query);
}
- else if (req_query) retval = (Query*)INCREF(req_query);
- else if (opt_query) retval = (Query*)INCREF(opt_query);
- else retval = (Query*)NoMatchQuery_new();
+ else if (req_query) { retval = (Query*)INCREF(req_query); }
+ else if (opt_query) { retval = (Query*)INCREF(opt_query); }
+ else { retval = (Query*)NoMatchQuery_new(); }
DECREF(opt_query);
DECREF(req_query);
@@ -948,8 +961,8 @@ QParser_expand_leaf(QueryParser *self, Q
bool_t ambiguous = false;
// Determine whether we can actually process the input.
- if (!Query_Is_A(query, LEAFQUERY)) return NULL;
- if (!CB_Get_Size(LeafQuery_Get_Text(leaf_query))) return NULL;
+ if (!Query_Is_A(query, LEAFQUERY)) { return NULL; }
+ if (!CB_Get_Size(LeafQuery_Get_Text(leaf_query))) { return NULL; }
ZCB_Assign(source_text, LeafQuery_Get_Text(leaf_query));
// If quoted, always generate PhraseQuery.
Modified: incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c Mon May 2 00:15:20 2011
@@ -76,20 +76,20 @@ RangeQuery_destroy(RangeQuery *self) {
bool_t
RangeQuery_equals(RangeQuery *self, Obj *other) {
RangeQuery *twin = (RangeQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, RANGEQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
- if (self->lower_term && !twin->lower_term) return false;
- if (self->upper_term && !twin->upper_term) return false;
- if (!self->lower_term && twin->lower_term) return false;
- if (!self->upper_term && twin->upper_term) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, RANGEQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!CB_Equals(self->field, (Obj*)twin->field)) { return false; }
+ if (self->lower_term && !twin->lower_term) { return false; }
+ if (self->upper_term && !twin->upper_term) { return false; }
+ if (!self->lower_term && twin->lower_term) { return false; }
+ if (!self->upper_term && twin->upper_term) { return false; }
if (self->lower_term
- && !Obj_Equals(self->lower_term, twin->lower_term)) return false;
+ && !Obj_Equals(self->lower_term, twin->lower_term)) { return false; }
if (self->upper_term
- && !Obj_Equals(self->upper_term, twin->upper_term)) return false;
- if (self->include_lower != twin->include_lower) return false;
- if (self->include_upper != twin->include_upper) return false;
+ && !Obj_Equals(self->upper_term, twin->upper_term)) { return false; }
+ if (self->include_lower != twin->include_lower) { return false; }
+ if (self->include_upper != twin->include_upper) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/TermQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/TermQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/TermQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/TermQuery.c Mon May 2 00:15:20 2011
@@ -84,11 +84,11 @@ TermQuery_get_term(TermQuery *self) {
bool_t
TermQuery_equals(TermQuery *self, Obj *other) {
TermQuery *twin = (TermQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, TERMQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
- if (!Obj_Equals(self->term, twin->term)) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, TERMQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (!CB_Equals(self->field, (Obj*)twin->field)) { return false; }
+ if (!Obj_Equals(self->term, twin->term)) { return false; }
return true;
}
@@ -156,12 +156,12 @@ TermCompiler_init(TermCompiler *self, Qu
bool_t
TermCompiler_equals(TermCompiler *self, Obj *other) {
TermCompiler *twin = (TermCompiler*)other;
- if (!Compiler_equals((Compiler*)self, other)) return false;
- if (!Obj_Is_A(other, TERMCOMPILER)) return false;
- if (self->idf != twin->idf) return false;
- if (self->raw_weight != twin->raw_weight) return false;
- if (self->query_norm_factor != twin->query_norm_factor) return false;
- if (self->normalized_weight != twin->normalized_weight) return false;
+ if (!Compiler_equals((Compiler*)self, other)) { return false; }
+ if (!Obj_Is_A(other, TERMCOMPILER)) { return false; }
+ if (self->idf != twin->idf) { return false; }
+ if (self->raw_weight != twin->raw_weight) { return false; }
+ if (self->query_norm_factor != twin->query_norm_factor) { return false; }
+ if (self->normalized_weight != twin->normalized_weight) { return false; }
return true;
}
@@ -242,11 +242,11 @@ TermCompiler_highlight_spans(TermCompile
uint32_t i, max;
UNUSED_VAR(searcher);
- if (!CB_Equals(parent->field, (Obj*)field)) return spans;
+ if (!CB_Equals(parent->field, (Obj*)field)) { return spans; }
// Add all starts and ends.
term_vector = DocVec_Term_Vector(doc_vec, field, (CharBuf*)parent->term);
- if (!term_vector) return spans;
+ if (!term_vector) { return spans; }
starts = TV_Get_Start_Offsets(term_vector);
ends = TV_Get_End_Offsets(term_vector);
Modified: incubator/lucy/trunk/core/Lucy/Store/FSDirHandle.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Store/FSDirHandle.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Store/FSDirHandle.c (original)
+++ incubator/lucy/trunk/core/Lucy/Store/FSDirHandle.c Mon May 2 00:15:20 2011
@@ -149,7 +149,7 @@ FSDH_entry_is_symlink(FSDirHandle *self)
CB_setf(self->fullpath, "%o%s%o", self->dir, CHY_DIR_SEP,
self->entry);
if (stat((char*)CB_Get_Ptr8(self->fullpath), &stat_buf) != -1) {
- if (stat_buf.st_mode & S_IFLNK) return true;
+ if (stat_buf.st_mode & S_IFLNK) { return true; }
}
return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Store/FSFolder.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Store/FSFolder.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Store/FSFolder.c (original)
+++ incubator/lucy/trunk/core/Lucy/Store/FSFolder.c Mon May 2 00:15:20 2011
@@ -260,7 +260,7 @@ static bool_t
S_dir_ok(const CharBuf *path) {
struct stat stat_buf;
if (stat((char*)CB_Get_Ptr8(path), &stat_buf) != -1) {
- if (stat_buf.st_mode & S_IFDIR) return true;
+ if (stat_buf.st_mode & S_IFDIR) { return true; }
}
return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Test/Util/BBSortEx.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Util/BBSortEx.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Util/BBSortEx.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Util/BBSortEx.c Mon May 2 00:15:20 2011
@@ -79,8 +79,8 @@ BBSortEx_flush(BBSortEx *self) {
BBSortEx *run;
uint32_t i;
- if (!cache_count) return;
- else elems = VA_new(cache_count);
+ if (!cache_count) { return; }
+ else { elems = VA_new(cache_count); }
// Sort, then create a new run.
BBSortEx_Sort_Cache(self);
Modified: incubator/lucy/trunk/core/Lucy/Util/Debug.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/Debug.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/Debug.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/Debug.c Mon May 2 00:15:20 2011
@@ -80,30 +80,30 @@ Debug_debug_should_print(const char *pat
const int funcname_len = func ? strlen(func) : 0;
// Use just file name if given path.
- if (file) file++;
- else file = path;
+ if (file) { file++; }
+ else { file = path; }
// Split criteria on commas. Bail when we run out of critieria.
for (test = env_cache; test != NULL; test = next) {
const char *last_char;
// Skip whitespace.
- while (isspace(*test)) test++;
- if (test >= env_cache_limit) return 0;
+ while (isspace(*test)) { test++; }
+ if (test >= env_cache_limit) { return 0; }
// Find end of criteria or end of string.
next = strchr(test, ',');
last_char = next ? next - 1 : env_cache_limit - 1;
- while (last_char > test && isspace(*last_char)) last_char--;
+ while (last_char > test && isspace(*last_char)) { last_char--; }
if (*last_char == '*') {
const int len = last_char - test;
- if (!strncmp(test, file, len)) return 1;
- if (!strncmp(test, func, len)) return 1;
+ if (!strncmp(test, file, len)) { return 1; }
+ if (!strncmp(test, func, len)) { return 1; }
}
else {
- if (!strncmp(test, file, filename_len)) return 1;
- if (!strncmp(test, func, funcname_len)) return 1;
+ if (!strncmp(test, file, filename_len)) { return 1; }
+ if (!strncmp(test, func, funcname_len)) { return 1; }
}
}
Modified: incubator/lucy/trunk/core/Lucy/Util/IndexFileNames.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/IndexFileNames.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/IndexFileNames.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/IndexFileNames.c Mon May 2 00:15:20 2011
@@ -38,8 +38,8 @@ IxFileNames_latest_snapshot(Folder *fold
uint64_t gen = IxFileNames_extract_gen(entry);
if (gen > latest_gen) {
latest_gen = gen;
- if (!retval) retval = CB_Clone(entry);
- else CB_Mimic(retval, (Obj*)entry);
+ if (!retval) { retval = CB_Clone(entry); }
+ else { CB_Mimic(retval, (Obj*)entry); }
}
}
}
Modified: incubator/lucy/trunk/core/Lucy/Util/PriorityQueue.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/PriorityQueue.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/PriorityQueue.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/PriorityQueue.c Mon May 2 00:15:20 2011
@@ -92,8 +92,8 @@ bool_t
PriQ_insert(PriorityQueue *self, Obj *element) {
Obj *least = PriQ_Jostle(self, element);
DECREF(least);
- if (element == least) return false;
- else return true;
+ if (element == least) { return false; }
+ else { return true; }
}
Obj*
Modified: incubator/lucy/trunk/core/LucyX/Search/ProximityMatcher.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/LucyX/Search/ProximityMatcher.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/LucyX/Search/ProximityMatcher.c (original)
+++ incubator/lucy/trunk/core/LucyX/Search/ProximityMatcher.c Mon May 2 00:15:20 2011
@@ -221,22 +221,22 @@ SI_winnow_anchors(uint32_t *anchors_star
SPIN_CANDIDATES:
target_candidate = *anchors + offset;
while (*candidates < target_candidate) {
- if (++candidates == candidates_end) goto DONE;
+ if (++candidates == candidates_end) { goto DONE; }
}
- if ((*candidates - target_candidate) < within) goto MATCH;
+ if ((*candidates - target_candidate) < within) { goto MATCH; }
goto SPIN_ANCHORS;
SPIN_ANCHORS:
target_anchor = *candidates - offset;
while (*anchors < target_anchor) {
- if (++anchors == anchors_end) goto DONE;
+ if (++anchors == anchors_end) { goto DONE; }
};
- if (*anchors == target_anchor) goto MATCH;
+ if (*anchors == target_anchor) { goto MATCH; }
goto SPIN_CANDIDATES;
MATCH:
*anchors_found++ = *anchors;
- if (++anchors == anchors_end) goto DONE;
+ if (++anchors == anchors_end) { goto DONE; }
goto SPIN_CANDIDATES;
DONE:
Modified: incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c (original)
+++ incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c Mon May 2 00:15:20 2011
@@ -99,16 +99,16 @@ ProximityQuery_deserialize(ProximityQuer
bool_t
ProximityQuery_equals(ProximityQuery *self, Obj *other) {
ProximityQuery *twin = (ProximityQuery*)other;
- if (twin == self) return true;
- if (!Obj_Is_A(other, PROXIMITYQUERY)) return false;
- if (self->boost != twin->boost) return false;
- if (self->field && !twin->field) return false;
- if (!self->field && twin->field) return false;
+ if (twin == self) { return true; }
+ if (!Obj_Is_A(other, PROXIMITYQUERY)) { return false; }
+ if (self->boost != twin->boost) { return false; }
+ if (self->field && !twin->field) { return false; }
+ if (!self->field && twin->field) { return false; }
if (self->field && !CB_Equals(self->field, (Obj*)twin->field)) {
return false;
}
- if (!VA_Equals(twin->terms, (Obj*)self->terms)) return false;
- if (self->within != twin->within) return false;
+ if (!VA_Equals(twin->terms, (Obj*)self->terms)) { return false; }
+ if (self->within != twin->within) { return false; }
return true;
}
@@ -237,13 +237,13 @@ ProximityCompiler_deserialize(ProximityC
bool_t
ProximityCompiler_equals(ProximityCompiler *self, Obj *other) {
ProximityCompiler *twin = (ProximityCompiler*)other;
- if (!Obj_Is_A(other, PROXIMITYCOMPILER)) return false;
- if (!Compiler_equals((Compiler*)self, other)) return false;
- if (self->idf != twin->idf) return false;
- if (self->raw_weight != twin->raw_weight) return false;
- if (self->query_norm_factor != twin->query_norm_factor) return false;
- if (self->normalized_weight != twin->normalized_weight) return false;
- if (self->within != twin->within) return false;
+ if (!Obj_Is_A(other, PROXIMITYCOMPILER)) { return false; }
+ if (!Compiler_equals((Compiler*)self, other)) { return false; }
+ if (self->idf != twin->idf) { return false; }
+ if (self->raw_weight != twin->raw_weight) { return false; }
+ if (self->query_norm_factor != twin->query_norm_factor) { return false; }
+ if (self->normalized_weight != twin->normalized_weight) { return false; }
+ if (self->within != twin->within) { return false; }
return true;
}
@@ -272,7 +272,7 @@ ProximityCompiler_make_matcher(Proximity
uint32_t num_terms = VA_Get_Size(terms);
// Bail if there are no terms.
- if (!num_terms) return NULL;
+ if (!num_terms) { return NULL; }
// Bail unless field is valid and posting type supports positions.
Similarity *sim = ProximityCompiler_Get_Similarity(self);
Modified: incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c (original)
+++ incubator/lucy/trunk/perl/xs/Lucy/Analysis/RegexTokenizer.c Mon May 2 00:15:20 2011
@@ -81,7 +81,7 @@ S_set_token_re_but_not_pattern(lucy_Rege
THROW(LUCY_ERR, "Failed to extract REGEXP from token_re '%s'",
SvPV_nolen((SV*)token_re));
}
- if (self->token_re) ReREFCNT_dec(((REGEXP*)self->token_re));
+ if (self->token_re) { ReREFCNT_dec(((REGEXP*)self->token_re)); }
self->token_re = rx;
(void)ReREFCNT_inc(((REGEXP*)self->token_re));
}
Modified: incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c?rev=1098448&r1=1098447&r2=1098448&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c (original)
+++ incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c Mon May 2 00:15:20 2011
@@ -26,7 +26,7 @@ lucy_Doc*
lucy_Doc_init(lucy_Doc *self, void *fields, int32_t doc_id) {
// Assign.
if (fields) {
- if (SvTYPE((SV*)fields) != SVt_PVHV) THROW(LUCY_ERR, "Not a hash");
+ if (SvTYPE((SV*)fields) != SVt_PVHV) { THROW(LUCY_ERR, "Not a hash"); }
self->fields = SvREFCNT_inc((SV*)fields);
}
else {
@@ -39,7 +39,7 @@ lucy_Doc_init(lucy_Doc *self, void *fiel
void
lucy_Doc_set_fields(lucy_Doc *self, void *fields) {
- if (self->fields) SvREFCNT_dec((SV*)self->fields);
+ if (self->fields) { SvREFCNT_dec((SV*)self->fields); }
self->fields = SvREFCNT_inc((SV*)fields);
}
@@ -184,7 +184,7 @@ lucy_Doc_equals(lucy_Doc *self, lucy_Obj
void
lucy_Doc_destroy(lucy_Doc *self) {
- if (self->fields) SvREFCNT_dec((SV*)self->fields);
+ if (self->fields) { SvREFCNT_dec((SV*)self->fields); }
LUCY_SUPER_DESTROY(self, LUCY_DOC);
}