mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
Added swap
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@938 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
0ea49874ee
commit
cae0b9392e
@ -42,6 +42,14 @@ inline void SkipNewline(FILE *file) {
|
||||
if (fgetc(file) != '\n') fseek(file, -1, SEEK_CUR);
|
||||
}
|
||||
|
||||
// Swaps the two args pointed to by the pointers.
|
||||
// Operator= and copy constructor must work on T.
|
||||
template<typename T> inline void Swap(T* p1, T* p2) {
|
||||
T tmp(*p2);
|
||||
*p2 = *p1;
|
||||
*p1 = tmp;
|
||||
}
|
||||
|
||||
// qsort function to sort 2 floats.
|
||||
inline int sort_floats(const void *arg1, const void *arg2) {
|
||||
float diff = *((float *) arg1) - *((float *) arg2);
|
||||
|
Loading…
Reference in New Issue
Block a user