From c7e9ec8f41ae67d7e0484f0d8c7cf3a0b73aa0d8 Mon Sep 17 00:00:00 2001 From: theraysmith Date: Wed, 16 May 2007 01:44:53 +0000 Subject: [PATCH] Misc improvements git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@55 d0cd1f9f-072b-0410-8dd7-cf729c803f20 --- dict/choices.cpp | 20 ++++++++++---------- dict/choices.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dict/choices.cpp b/dict/choices.cpp index 7440d5d41e..1bf342df06 100644 --- a/dict/choices.cpp +++ b/dict/choices.cpp @@ -67,17 +67,17 @@ CHOICES append_choice(CHOICES ratings, * Copy a list of choices. This means that there will be two copies * in memory. **********************************************************************/ -CHOICES copy_choices(CHOICES choices) { +CHOICES copy_choices(CHOICES choices) { CHOICES l; CHOICES result = NIL; - iterate_list(l, choices) { + iterate_list(l, choices) { result = push (result, - (LIST) new_choice (class_string (first (l)), - class_probability (first (l)), - class_certainty (first (l)), - class_config (first (l)), - class_permuter (first (l)))); + (LIST) new_choice (class_string (first_node (l)), + class_probability (first_node (l)), + class_certainty (first_node (l)), + class_config (first_node (l)), + class_permuter (first_node (l)))); } return (reverse_d (result)); } @@ -96,7 +96,7 @@ void free_choice(void *arg) { //LIST choice) if (this_choice) { if (this_choice->string) strfree (this_choice->string); - oldchoice(this_choice); + oldchoice(this_choice); } } @@ -139,12 +139,12 @@ void print_choices( /* List of (A_CHOICE*) */ if (rating == NIL) cprintf (" No rating "); - iterate(rating) { + iterate(rating) { if (first_one && show_bold) { cprintf ("|"); len = sprintf (str, " %s ", best_string (rating)); - print_bold(str); + print_bold(str); while (len++ < 8) cprintf (" "); } diff --git a/dict/choices.h b/dict/choices.h index 7e7b588888..4edf36a396 100644 --- a/dict/choices.h +++ b/dict/choices.h @@ -79,7 +79,7 @@ typedef struct choicestruct * Return the string corresponding to the best choice. **********************************************************************/ #define best_string(choices) \ -(first (choices) ? ((A_CHOICE*) (first (choices)))->string : NULL) +(first_node (choices) ? ((A_CHOICE*) (first_node (choices)))->string : NULL) /********************************************************************** * best_probability @@ -87,7 +87,7 @@ typedef struct choicestruct * Return the probability of the best choice. **********************************************************************/ #define best_probability(choices) \ -(((A_CHOICE*) (first (choices)))->rating) +(((A_CHOICE*) (first_node (choices)))->rating) /********************************************************************** * best_certainty @@ -95,7 +95,7 @@ typedef struct choicestruct * Return the certainty of the best choice. **********************************************************************/ #define best_certainty(choices) \ -(((A_CHOICE*) (first (choices)))->certainty) +(((A_CHOICE*) (first_node (choices)))->certainty) /********************************************************************** * class_probability @@ -177,7 +177,7 @@ CHOICES append_choice(CHOICES ratings, float certainty, INT8 config); -CHOICES copy_choices(CHOICES choices); +CHOICES copy_choices(CHOICES choices); void free_choice(void *arg); //LIST choice); @@ -187,5 +187,5 @@ A_CHOICE *new_choice(const char *string, INT8 config, char permuter); -void print_choices(const char *label, CHOICES rating); +void print_choices(const char *label, CHOICES rating); #endif