@@ -34,38 +34,38 @@ int main(int argc, char **argv) {
3434 ParseArguments (&argc, &argv);
3535 if (FLAGS_model.empty ()) {
3636 tprintf (" Must provide a --model!\n " );
37- return 1 ;
37+ return EXIT_FAILURE ;
3838 }
3939 if (FLAGS_eval_listfile.empty ()) {
4040 tprintf (" Must provide a --eval_listfile!\n " );
41- return 1 ;
41+ return EXIT_FAILURE ;
4242 }
4343 tesseract::TessdataManager mgr;
4444 if (!mgr.Init (FLAGS_model.c_str ())) {
4545 if (FLAGS_traineddata.empty ()) {
4646 tprintf (" Must supply --traineddata to eval a training checkpoint!\n " );
47- return 1 ;
47+ return EXIT_FAILURE ;
4848 }
4949 tprintf (" %s is not a recognition model, trying training checkpoint...\n " , FLAGS_model.c_str ());
5050 if (!mgr.Init (FLAGS_traineddata.c_str ())) {
5151 tprintf (" Failed to load language model from %s!\n " , FLAGS_traineddata.c_str ());
52- return 1 ;
52+ return EXIT_FAILURE ;
5353 }
5454 std::vector<char > model_data;
5555 if (!tesseract::LoadDataFromFile (FLAGS_model.c_str (), &model_data)) {
5656 tprintf (" Failed to load model from: %s\n " , FLAGS_model.c_str ());
57- return 1 ;
57+ return EXIT_FAILURE ;
5858 }
5959 mgr.OverwriteEntry (tesseract::TESSDATA_LSTM, &model_data[0 ], model_data.size ());
6060 }
6161 tesseract::LSTMTester tester (static_cast <int64_t >(FLAGS_max_image_MB) * 1048576 );
6262 if (!tester.LoadAllEvalData (FLAGS_eval_listfile.c_str ())) {
6363 tprintf (" Failed to load eval data from: %s\n " , FLAGS_eval_listfile.c_str ());
64- return 1 ;
64+ return EXIT_FAILURE ;
6565 }
6666 double errs = 0.0 ;
6767 std::string result = tester.RunEvalSync (0 , &errs, mgr,
6868 /* training_stage (irrelevant)*/ 0 , FLAGS_verbosity);
6969 tprintf (" %s\n " , result.c_str ());
70- return 0 ;
70+ return EXIT_SUCCESS ;
7171} /* main */
0 commit comments