Formatting changes from clang_tidy on latest pull

# Conflicts:
#	ccutil/host.h
This commit is contained in:
Zdenko Podobný 2016-12-07 16:58:25 +01:00
parent b169ef5d34
commit 82529e31dd
8 changed files with 21 additions and 24 deletions

View File

@ -50,9 +50,7 @@ class PDBLK {
void set_sides(ICOORDELT_LIST *left, ICOORDELT_LIST *right);
/// destructor
~PDBLK() {
delete hand_poly;
}
~PDBLK() { delete hand_poly; }
POLY_BLOCK *poly_block() const { return hand_poly; }
/// set the poly block

View File

@ -59,8 +59,7 @@ class UnicharIdArrayUtils {
// less than length of array2, if any array1[i] is less than array2[i].
// Returns 0 if the arrays are equal, 1 otherwise.
// The function assumes that the arrays are terminated by INVALID_UNICHAR_ID.
static inline int compare(const UNICHAR_ID *ptr1,
const UNICHAR_ID *ptr2) {
static inline int compare(const UNICHAR_ID *ptr1, const UNICHAR_ID *ptr2) {
for (;;) {
const UNICHAR_ID val1 = *ptr1++;
const UNICHAR_ID val2 = *ptr2++;

View File

@ -209,7 +209,7 @@ void TrainingSample::ExtractCharDesc(int int_feature_type,
int geo_type,
CHAR_DESC_STRUCT* char_desc) {
// Extract the INT features.
delete [] features_;
delete[] features_;
FEATURE_SET_STRUCT* char_features = char_desc->FeatureSets[int_feature_type];
if (char_features == NULL) {
tprintf("Error: no features to train on of type %s\n",
@ -230,7 +230,7 @@ void TrainingSample::ExtractCharDesc(int int_feature_type,
}
}
// Extract the Micro features.
delete [] micro_features_;
delete[] micro_features_;
char_features = char_desc->FeatureSets[micro_type];
if (char_features == NULL) {
tprintf("Error: no features to train on of type %s\n",

View File

@ -381,11 +381,11 @@ class Dict {
double def_probability_in_context(
const char* lang, const char* context, int context_bytes,
const char* character, int character_bytes) {
(void) lang;
(void) context;
(void) context_bytes;
(void) character;
(void) character_bytes;
(void)lang;
(void)context;
(void)context_bytes;
(void)character;
(void)character_bytes;
return 0.0;
}
double ngram_probability_in_context(const char* lang,

View File

@ -1209,6 +1209,6 @@ KERNEL(
; // close char*
#endif // USE_EXTERNAL_KERNEL
#endif //_OCL_KERNEL_H_
#endif // USE_EXTERNAL_KERNEL
#endif //_OCL_KERNEL_H_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -538,11 +538,11 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c
// Release all resouces and memory
for ( i = 0; i < numDevices; i++ )
{
free(binaries[i]);
binaries[i] = NULL;
free(binaries[i]);
binaries[i] = NULL;
}
free( binaries );
free(binaries);
binaries = NULL;
free(binarySizes);
@ -550,7 +550,7 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c
free(mpArryDevsID);
mpArryDevsID = NULL;
return 1;
}
@ -1142,7 +1142,7 @@ OpenclDevice::pixReadMemTiffCl(const l_uint8 *data,size_t size,l_int32 n)
}
if (pagefound == FALSE) {
L_WARNING("tiff page %d not found", procName, i);
L_WARNING("tiff page %d not found\n", procName, i);
TIFFCleanup(tif);
return NULL;
}

View File

@ -524,8 +524,8 @@ CLUSTERER *SetUpForClustering(const FEATURE_DEFS_STRUCT &FeatureDefs,
}
CharID++;
}
free( Sample );
return( Clusterer );
free(Sample);
return Clusterer;
} /* SetUpForClustering */

View File

@ -37,9 +37,9 @@
#include "scrollview.h"
#ifdef _MSC_VER
#pragma warning(disable:4786) // Don't give irrelevant warnings for stl
#pragma warning(disable:4018) // signed/unsigned warnings
#pragma warning(disable:4530) // exception warnings
#pragma warning(disable : 4786) // Don't give irrelevant warnings for stl
#pragma warning(disable : 4018) // signed/unsigned warnings
#pragma warning(disable : 4530) // exception warnings
#endif
const int kSvPort = 8461;