From ab0f4e2c38213a8da7dbbd51212cd8014d2bea58 Mon Sep 17 00:00:00 2001 From: Ray Smith Date: Fri, 12 Jun 2015 10:53:21 -0700 Subject: [PATCH] Clang fixes to earlier changes and build compatability with Google environment --- api/pdfrenderer.cpp | 5 ++--- ccmain/paragraphs.cpp | 6 ++---- training/fileio.h | 5 ----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/api/pdfrenderer.cpp b/api/pdfrenderer.cpp index 4d20bb3ae..13189158d 100644 --- a/api/pdfrenderer.cpp +++ b/api/pdfrenderer.cpp @@ -615,7 +615,7 @@ bool TessPDFRenderer::BeginDocumentHandler() { if (n >= sizeof(buf)) return false; FILE *fp = fopen(buf, "rb"); if (!fp) { - fprintf(stderr, "Can not open file \"%s\"!\n", buf); + tprintf("Can not open file \"%s\"!\n", buf); return false; } fseek(fp, 0, SEEK_END); @@ -636,8 +636,7 @@ bool TessPDFRenderer::BeginDocumentHandler() { " /Length1 %ld\n" ">>\n" "stream\n", size, size); - if (n >= sizeof(buf)) - { + if (n >= sizeof(buf)) { delete[] buffer; return false; } diff --git a/ccmain/paragraphs.cpp b/ccmain/paragraphs.cpp index a36364c34..b46f9f3e6 100644 --- a/ccmain/paragraphs.cpp +++ b/ccmain/paragraphs.cpp @@ -2401,10 +2401,8 @@ void InitializeTextAndBoxesPreRecognition(const MutableIterator &it, word_res = page_res_it.forward(); } while (page_res_it.row() == this_row); - if(lword) - info->lword_box = lword->word->bounding_box(); - if(rword) - info->rword_box = rword->word->bounding_box(); + if (lword) info->lword_box = lword->word->bounding_box(); + if (rword) info->rword_box = rword->word->bounding_box(); } diff --git a/training/fileio.h b/training/fileio.h index a8ed917a0..b39b4e743 100644 --- a/training/fileio.h +++ b/training/fileio.h @@ -63,11 +63,6 @@ class InputBuffer { ~InputBuffer(); - // Read data until end-of-file or a \n is read. - // The data is stored in '*out', excluding the \n if present. - // Return false if an error occurs or at end-of-file, true otherwise. - bool ReadLine(string* out); - // Read data until end-of-file. // The data is stored in '*out'. // Return false if an error occurs, true otherwise.