Skip to content

Commit

Permalink
Formatting changes from clang_tidy on latest pull
Browse files Browse the repository at this point in the history
  • Loading branch information
theraysmith committed Nov 30, 2016
1 parent 23e420a commit 53003f9
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 25 deletions.
4 changes: 1 addition & 3 deletions ccstruct/pdblock.h
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions ccutil/ambigs.h
Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion ccutil/host.h
Expand Up @@ -68,7 +68,7 @@
#undef max
#endif

#include <stdint.h> // int32_t, ...
#include <stdint.h> // int32_t, ...

/********************************************************/
/* __MAC__ */
Expand Down
4 changes: 2 additions & 2 deletions classify/trainingsample.cpp
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions dict/dict.h
Expand Up @@ -383,11 +383,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,
Expand Down
4 changes: 2 additions & 2 deletions opencl/oclkernels.h
Expand Up @@ -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: */
10 changes: 5 additions & 5 deletions opencl/openclwrapper.cpp
Expand Up @@ -538,19 +538,19 @@ 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);
binarySizes = NULL;

free(mpArryDevsID);
mpArryDevsID = NULL;

return 1;
}

Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions training/commontraining.cpp
Expand Up @@ -524,8 +524,8 @@ CLUSTERER *SetUpForClustering(const FEATURE_DEFS_STRUCT &FeatureDefs,
}
CharID++;
}
free( Sample );
return( Clusterer );
free(Sample);
return Clusterer;

} /* SetUpForClustering */

Expand Down
6 changes: 3 additions & 3 deletions viewer/scrollview.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 53003f9

Please sign in to comment.