Clang fixes to earlier changes and build compatability with Google environment

This commit is contained in:
Ray Smith 2015-06-12 10:53:21 -07:00
parent 3ba1f83eb1
commit ab0f4e2c38
3 changed files with 4 additions and 12 deletions

View File

@ -615,7 +615,7 @@ bool TessPDFRenderer::BeginDocumentHandler() {
if (n >= sizeof(buf)) return false; if (n >= sizeof(buf)) return false;
FILE *fp = fopen(buf, "rb"); FILE *fp = fopen(buf, "rb");
if (!fp) { if (!fp) {
fprintf(stderr, "Can not open file \"%s\"!\n", buf); tprintf("Can not open file \"%s\"!\n", buf);
return false; return false;
} }
fseek(fp, 0, SEEK_END); fseek(fp, 0, SEEK_END);
@ -636,8 +636,7 @@ bool TessPDFRenderer::BeginDocumentHandler() {
" /Length1 %ld\n" " /Length1 %ld\n"
">>\n" ">>\n"
"stream\n", size, size); "stream\n", size, size);
if (n >= sizeof(buf)) if (n >= sizeof(buf)) {
{
delete[] buffer; delete[] buffer;
return false; return false;
} }

View File

@ -2401,10 +2401,8 @@ void InitializeTextAndBoxesPreRecognition(const MutableIterator &it,
word_res = page_res_it.forward(); word_res = page_res_it.forward();
} while (page_res_it.row() == this_row); } while (page_res_it.row() == this_row);
if(lword) if (lword) info->lword_box = lword->word->bounding_box();
info->lword_box = lword->word->bounding_box(); if (rword) info->rword_box = rword->word->bounding_box();
if(rword)
info->rword_box = rword->word->bounding_box();
} }

View File

@ -63,11 +63,6 @@ class InputBuffer {
~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. // Read data until end-of-file.
// The data is stored in '*out'. // The data is stored in '*out'.
// Return false if an error occurs, true otherwise. // Return false if an error occurs, true otherwise.