提交 830a2f54 编写于 作者: T theraysmith

Removed some compiler warnings on operator precedence

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@131 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 6b5e0c40
......@@ -187,11 +187,12 @@ void CHAR_SAMPLES::add_sample(CHAR_SAMPLE *sample) {
sample_it.add_to_end (sample);
if (tessedit_mm_use_prototypes && type == IMAGE_CLUSTER)
if (tessedit_mm_use_prototypes && type == IMAGE_CLUSTER) {
if (samples.length () == tessedit_mm_prototype_min_size)
this->build_prototype ();
else if (samples.length () > tessedit_mm_prototype_min_size)
this->add_sample_to_prototype (sample);
else if (samples.length () > tessedit_mm_prototype_min_size)
this->add_sample_to_prototype (sample);
}
}
......
......@@ -700,11 +700,12 @@ void improve_estimate(WERD_RES *word_res,
check_blob_occ (temp_char,
blob_ht_above_baseline,
est_x_ht, est_caps_ht, confirmed_char);
if (strcmp(confirmed_char, "") != 0)
if (strcmp(confirmed_char, "") != 0) {
if (STRING (chs_x_ht).contains (*confirmed_char))
x_ht.add (blob_ht_above_baseline, 1);
else
caps_ht.add (blob_ht_above_baseline, 1);
else
caps_ht.add (blob_ht_above_baseline, 1);
}
}
}
new_val = estimate_from_stats (x_ht);
......
......@@ -811,9 +811,9 @@ void write_shm_text( //write output
blob_box = blob->bounding_box ();
enhancement = 0;
if (word->italic > 0 || word->italic == 0 && row->italic > 0)
if (word->italic > 0 || (word->italic == 0 && row->italic > 0))
enhancement |= EUC_ITALIC;
if (word->bold > 0 || word->bold == 0 && row->bold > 0)
if (word->bold > 0 || (word->bold == 0 && row->bold > 0))
enhancement |= EUC_BOLD;
if (tessedit_write_ratings)
rating = (UINT32) (-word->best_choice->certainty () / 0.035);
......
......@@ -149,8 +149,8 @@ void find_blob_limits( //get y limits
pos.rotate (rotation);
vec = polypt->vec;
vec.rotate (rotation);
if (pos.x () < leftx && pos.x () + vec.x () > leftx
|| pos.x () > leftx && pos.x () + vec.x () < leftx) {
if ((pos.x () < leftx && pos.x () + vec.x () > leftx)
|| (pos.x () > leftx && pos.x () + vec.x () < leftx)) {
testy = pos.y () + vec.y () * (leftx - pos.x ()) / vec.x ();
//intercept of boundary
if (testy < ymin)
......@@ -164,8 +164,8 @@ void find_blob_limits( //get y limits
if (pos.y () < ymin)
ymin = pos.y ();
}
if (pos.x () > rightx && pos.x () + vec.x () < rightx
|| pos.x () < rightx && pos.x () + vec.x () > rightx) {
if ((pos.x () > rightx && pos.x () + vec.x () < rightx)
|| (pos.x () < rightx && pos.x () + vec.x () > rightx)) {
testy = pos.y () + vec.y () * (rightx - pos.x ()) / vec.x ();
//intercept of boundary
if (testy < ymin)
......@@ -416,7 +416,7 @@ BOX box_next( //get bounding box
result += blob->bounding_box ();
}
//until next real blob
while (blob->blob () == NULL && blob->cblob () == NULL || blob->joined_to_prev ());
while ((blob->blob () == NULL && blob->cblob () == NULL) || blob->joined_to_prev ());
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册