Skip to content

Commit f29c12a

Browse files
stweilzdenop
authored andcommitted
classify: Fix warnings from Doxygen (#1439)
* classify/adaptive: Fix warnings from Doxygen Signed-off-by: Stefan Weil <[email protected]> * classify/clusttool: Fix warnings from Doxygen and remove wrong API function Remove the function ReadProtoStyle because it did not match the documentation. It was only used locally. Signed-off-by: Stefan Weil <[email protected]> * classify/cutoffs: Fix warnings from Doxygen Signed-off-by: Stefan Weil <[email protected]> * classify/intproto: Fix warnings from Doxygen Signed-off-by: Stefan Weil <[email protected]> * classify/normmatch: Fix warnings from Doxygen Signed-off-by: Stefan Weil <[email protected]>
1 parent 2cc46fa commit f29c12a

File tree

6 files changed

+31
-47
lines changed

6 files changed

+31
-47
lines changed

classify/adaptive.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ void Classify::PrintAdaptedTemplates(FILE *File, ADAPT_TEMPLATES Templates) {
293293

294294
/*---------------------------------------------------------------------------*/
295295
/**
296-
* Read an adapted class description from File and return
296+
* Read an adapted class description from file and return
297297
* a ptr to the adapted class.
298298
*
299-
* @param File open file to read adapted class from
299+
* @param fp open file to read adapted class from
300300
* @return Ptr to new adapted class.
301301
*
302302
* @note Globals: none
@@ -346,11 +346,11 @@ ADAPT_CLASS ReadAdaptedClass(TFile *fp) {
346346
/*---------------------------------------------------------------------------*/
347347
namespace tesseract {
348348
/**
349-
* Read a set of adapted templates from File and return
349+
* Read a set of adapted templates from file and return
350350
* a ptr to the templates.
351351
*
352-
* @param File open text file to read adapted templates from
353-
* @return Ptr to adapted templates read from File.
352+
* @param fp open text file to read adapted templates from
353+
* @return Ptr to adapted templates read from file.
354354
*
355355
* @note Globals: none
356356
* @note Exceptions: none
@@ -379,10 +379,10 @@ ADAPT_TEMPLATES Classify::ReadAdaptedTemplates(TFile *fp) {
379379

380380
/*---------------------------------------------------------------------------*/
381381
/**
382-
* Read a permanent configuration description from File
382+
* Read a permanent configuration description from file
383383
* and return a ptr to it.
384384
*
385-
* @param File open file to read permanent config from
385+
* @param fp open file to read permanent config from
386386
* @return Ptr to new permanent configuration description.
387387
*
388388
* @note Globals: none
@@ -405,10 +405,10 @@ PERM_CONFIG ReadPermConfig(TFile *fp) {
405405

406406
/*---------------------------------------------------------------------------*/
407407
/**
408-
* Read a temporary configuration description from File
408+
* Read a temporary configuration description from file
409409
* and return a ptr to it.
410410
*
411-
* @param File open file to read temporary config from
411+
* @param fp open file to read temporary config from
412412
* @return Ptr to new temporary configuration description.
413413
*
414414
* @note Globals: none

classify/clusttool.cpp

+18-29
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using tesseract::TFile;
3838
* This routine reads a single integer from the specified
3939
* file and checks to ensure that it is between 0 and
4040
* MAXSAMPLESIZE.
41-
* @param File open text file to read sample size from
41+
* @param fp open text file to read sample size from
4242
* @return Sample size
4343
* @note Globals: None
4444
* @note Exceptions: ILLEGALSAMPLESIZE illegal format or range
@@ -64,7 +64,7 @@ uint16_t ReadSampleSize(TFile *fp) {
6464
* - ILLEGALCIRCULARSPEC
6565
* - ILLEGALESSENTIALSPEC
6666
* - ILLEGALMINMAXSPEC
67-
* @param File open text file to read N parameter descriptions from
67+
* @param fp open text file to read N parameter descriptions from
6868
* @param N number of parameter descriptions to read
6969
* @return Pointer to an array of parameter descriptors.
7070
* @note Globals: None
@@ -109,7 +109,7 @@ PARAM_DESC *ReadParamDesc(TFile *fp, uint16_t N) {
109109
* - ILLEGALMEANSPEC
110110
* - ILLEGALVARIANCESPEC
111111
* - ILLEGALDISTRIBUTION
112-
* @param File open text file to read prototype from
112+
* @param fp open text file to read prototype from
113113
* @param N number of dimensions used in prototype
114114
* @return List of prototypes
115115
* @note Globals: None
@@ -136,7 +136,20 @@ PROTOTYPE *ReadPrototype(TFile *fp, uint16_t N) {
136136
else
137137
Proto->Significant = FALSE;
138138

139-
Proto->Style = ReadProtoStyle(shape_token);
139+
switch (shape_token[0]) {
140+
case 's':
141+
Proto->Style = spherical;
142+
break;
143+
case 'e':
144+
Proto->Style = elliptical;
145+
break;
146+
case 'a':
147+
Proto->Style = automatic;
148+
break;
149+
default:
150+
tprintf("Invalid prototype style specification:%s\n", shape_token);
151+
Proto->Style = elliptical;
152+
}
140153

141154
if (SampleCount < 0) DoError(ILLEGALSAMPLECOUNT, "Illegal sample count");
142155
Proto->NumSamples = SampleCount;
@@ -179,37 +192,13 @@ PROTOTYPE *ReadPrototype(TFile *fp, uint16_t N) {
179192
return Proto;
180193
}
181194

182-
/**
183-
* This routine reads an single token from the specified
184-
* text file and interprets it as a prototype specification.
185-
* @param File open text file to read prototype style from
186-
* @return Prototype style read from text file
187-
* @note Globals: None
188-
* @note Exceptions: ILLEGALSTYLESPEC illegal prototype style specification
189-
* @note History: 6/8/89, DSJ, Created.
190-
*/
191-
PROTOSTYLE ReadProtoStyle(const char *shape) {
192-
switch (shape[0]) {
193-
case 's':
194-
return spherical;
195-
case 'e':
196-
return elliptical;
197-
case 'a':
198-
return automatic;
199-
default:
200-
break;
201-
}
202-
tprintf("Invalid prototype style specification:%s\n", shape);
203-
return elliptical;
204-
}
205-
206195
/**
207196
* This routine reads N floats from the specified text file
208197
* and places them into Buffer. If Buffer is NULL, a buffer
209198
* is created and passed back to the caller. If EOF is
210199
* encountered before any floats can be read, NULL is
211200
* returned.
212-
* @param File open text file to read floats from
201+
* @param fp open text file to read floats from
213202
* @param N number of floats to read
214203
* @param Buffer pointer to buffer to place floats into
215204
* @return Pointer to buffer holding floats or NULL if EOF

classify/clusttool.h

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ PARAM_DESC *ReadParamDesc(tesseract::TFile *fp, uint16_t N);
3434

3535
PROTOTYPE *ReadPrototype(tesseract::TFile *fp, uint16_t N);
3636

37-
PROTOSTYLE ReadProtoStyle(const char *style);
38-
3937
FLOAT32 *ReadNFloats(tesseract::TFile *fp, uint16_t N, FLOAT32 Buffer[]);
4038

4139
void WriteParamDesc(FILE *File, uint16_t N, const PARAM_DESC ParamDesc[]);

classify/cutoffs.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@
3636

3737
namespace tesseract {
3838
/**
39-
* Open Filename, read in all of the class-id/cutoff pairs
39+
* Open file, read in all of the class-id/cutoff pairs
4040
* and insert them into the Cutoffs array. Cutoffs are
4141
* indexed in the array by class id. Unused entries in the
4242
* array are set to an arbitrarily high cutoff value.
43-
* @param CutoffFile name of file containing cutoff definitions
43+
* @param fp file containing cutoff definitions
4444
* @param Cutoffs array to put cutoffs into
45-
* @param swap
46-
* @param end_offset
4745
* @return none
4846
* @note Globals: none
4947
* @note Exceptions: none

classify/intproto.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ namespace tesseract {
752752
* This routine reads a set of integer templates from
753753
* File. File must already be open and must be in the
754754
* correct binary format.
755-
* @param File open file to read templates from
755+
* @param fp open file to read templates from
756756
* @return Pointer to integer templates read from File.
757757
* @note Globals: none
758758
* @note Exceptions: none

classify/normmatch.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ namespace tesseract {
235235
* This routine allocates a new data structure to hold
236236
* a set of character normalization protos. It then fills in
237237
* the data structure by reading from the specified File.
238-
* @param File open text file to read normalization protos from
239-
* @param end_offset
238+
* @param fp open text file to read normalization protos from
240239
* Globals: none
241240
* @return Character normalization protos.
242241
* @note Exceptions: none

0 commit comments

Comments
 (0)