Clean usage of assert.h

Remove unneeded include statements, remove conditional statements and
replace the remaining assert.h by their standard C++ variant cassert.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-21 19:28:30 +02:00
parent 629a10b504
commit 112aeb9826
32 changed files with 123 additions and 202 deletions

View File

@ -18,9 +18,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include <ctype.h>
#include <string.h>
#include "tessbox.h"

View File

@ -18,11 +18,8 @@
**********************************************************************/
#include <ctype.h>
#include <string.h>
#ifdef __UNIX__
#include <assert.h>
#include <errno.h>
#endif
#include <string.h>
#include "allheaders.h"
#include "boxread.h"
#include "chopper.h"

View File

@ -27,11 +27,10 @@
#include <string.h>
#include <cmath>
#ifdef __UNIX__
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#endif
#include <ctype.h>
#include <errno.h>
#include "callcpp.h"
#include "control.h"
#include "docqual.h"

View File

@ -17,12 +17,11 @@
*
**********************************************************************/
#include <string.h>
#include <ctype.h>
#ifdef __UNIX__
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef __UNIX__
#include <unistd.h>
#endif
#include "helpers.h"
#include "tessvars.h"

View File

@ -18,12 +18,9 @@
**********************************************************************/
#include "tessvars.h"
#ifdef __UNIX__
#include <assert.h>
#include <errno.h>
#endif
#include "scanutils.h"
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include "genericvector.h"
#include "reject.h"

View File

@ -18,9 +18,6 @@
**********************************************************************/
#include <stdlib.h>
#ifdef __UNIX__
#include <assert.h>
#endif
#include "scanutils.h"
#include "fileerr.h"
#include "blread.h"

View File

@ -19,9 +19,6 @@
#include <algorithm>
#include <string.h>
#ifdef __UNIX__
#include <assert.h>
#endif
#include "coutln.h"

View File

@ -21,10 +21,9 @@
** limitations under the License.
*
**********************************************************************/
#include <stdlib.h>
#ifdef __UNIX__
#include <assert.h>
#endif
#include <cassert>
#include "blamer.h"
#include "pageres.h"
#include "blobs.h"

View File

@ -18,9 +18,6 @@
**********************************************************************/
#include <stdio.h>
#ifdef __UNIX__
#include <assert.h>
#endif
#define FASTEDGELENGTH 256
#include "polyaprx.h"
#include "params.h"

View File

@ -20,7 +20,7 @@
#ifndef RATNGS_H
#define RATNGS_H
#include <assert.h>
#include <cassert>
#include "clst.h"
#include "elst.h"

View File

@ -41,9 +41,6 @@ OF THIS IMPLIED TEMPORAL ORDERING OF THE FLAGS!!!!
#ifndef REJCTMAP_H
#define REJCTMAP_H
#ifdef __UNIX__
#include <assert.h>
#endif
#include <memory>
#include "bits16.h"
#include "errcode.h"

View File

@ -36,10 +36,6 @@
#include <algorithm>
#ifdef __UNIX__
#include <assert.h>
#endif
/*----------------------------------------------------------------------
V a r i a b l e s
----------------------------------------------------------------------*/

View File

@ -19,7 +19,7 @@
#include "strngs.h"
#include <assert.h>
#include <cassert>
#include "errcode.h"
#include "genericvector.h"

View File

@ -55,13 +55,11 @@
#include "werd.h"
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#ifdef __UNIX__
#include <assert.h>
#endif
#define ADAPT_TEMPLATE_SUFFIX ".a"

View File

@ -23,10 +23,7 @@
#endif
#include "errcode.h"
#ifdef __UNIX__
#include <assert.h>
#include <stdarg.h>
#endif
#include <time.h>
#include "memry.h"
#include "scrollview.h"

View File

@ -20,9 +20,6 @@
#ifndef CALLCPP_H
#define CALLCPP_H
#ifndef __UNIX__
#include <assert.h>
#endif
#include "host.h"
#include "params.h"
#include "unichar.h"

View File

@ -22,9 +22,6 @@
#include "danerror.h"
#include "tprintf.h"
#include "globaloc.h"
#ifdef __UNIX__
#include "assert.h"
#endif
#include <cstdio>

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "stderr.h"
#include "blobbox.h"
#include "statistc.h"

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "stderr.h"
#include "blobbox.h"
#include "ccstruct.h"

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include <math.h>
#include "memry.h"
#include "makerow.h"

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include <math.h>
#include "memry.h"
#include "pitsync1.h"

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "stderr.h"
#include "blobbox.h"
#include "statistc.h"

View File

@ -21,9 +21,6 @@
#include "config_auto.h"
#endif
#ifdef __UNIX__
#include <assert.h>
#endif
#include "stderr.h"
#include "globaloc.h"
#include "blread.h"

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "underlin.h"
#define PROJECTION_MARGIN 10 //arbitrary

View File

@ -17,9 +17,6 @@
*
**********************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "stderr.h"
#include "blobbox.h"
#include "statistc.h"

View File

@ -14,7 +14,6 @@
#include "commontraining.h"
#include <algorithm>
#include <assert.h>
#include <cmath>
#include "allheaders.h"

View File

@ -20,7 +20,6 @@
#include "normstrngs.h"
#include <assert.h>
#include <string>
#include <unordered_map>
#include <vector>

View File

@ -19,11 +19,8 @@
///////////////////////////////////////////////////////////////////////
#include <cstdio>
#ifdef __UNIX__
#include <assert.h>
#endif
#include <cmath>
#include <cstdio>
#include "associate.h"
#include "normalis.h"

View File

@ -31,7 +31,6 @@
#include "chopper.h"
#include "assert.h"
#include "associate.h"
#include "blobs.h"
#include "callcpp.h"

View File

@ -31,10 +31,6 @@
#include "outlines.h"
#include "wordrec.h"
#ifdef __UNIX__
#include <assert.h>
#endif
namespace tesseract {
/*----------------------------------------------------------------------
F u n c t i o n s

View File

@ -22,9 +22,6 @@
** limitations under the License.
*
*********************************************************************************/
#ifdef __UNIX__
#include <assert.h>
#endif
#include "plotedges.h"
#include "render.h"

View File

@ -25,9 +25,6 @@
#include "render.h"
#include "blobs.h"
#ifdef __UNIX__
#include <assert.h>
#endif
#include <cmath>
#include "vecfuncs.h"