Skip to content

Commit 36a1a30

Browse files
committed
Remove some old type casts
Signed-off-by: Stefan Weil <[email protected]>
1 parent 59b90bd commit 36a1a30

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/ccmain/osdetect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int os_detect_blobs(const GenericVector<int>* allowed_scripts,
304304
int number_of_blobs = 0;
305305
for (filtered_it.mark_cycle_pt (); !filtered_it.cycled_list ();
306306
filtered_it.forward ()) {
307-
blobs[number_of_blobs++] = (BLOBNBOX*)filtered_it.data();
307+
blobs[number_of_blobs++] = filtered_it.data();
308308
}
309309
QRSequenceGenerator sequence(number_of_blobs);
310310
int num_blobs_evaluated = 0;

src/ccstruct/blobbox.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: blobbox.h (Formerly blobnbox.h)
33
* Description: Code for the textord blob class.
44
* Author: Ray Smith
5-
* Created: Thu Jul 30 09:08:51 BST 1992
65
*
76
* (C) Copyright 1992, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +20,7 @@
2120
#define BLOBBOX_H
2221

2322
#include <cinttypes> // for PRId32
24-
#include <cmath> // for sqrt
23+
#include <cmath> // for std::sqrt
2524
#include <cstdint> // for int16_t, int32_t
2625
#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK
2726
#include "elst2.h" // for ELIST2_ITERATOR, ELIST2IZEH, ELIST2_LINK
@@ -627,9 +626,8 @@ class TO_ROW: public ELIST2_LINK
627626
float new_error) {
628627
para_c = new_c;
629628
para_error = new_error;
630-
credibility =
631-
(float) (blobs.length () - kErrorWeight * new_error);
632-
y_origin = (float) (new_c / sqrt (1 + gradient * gradient));
629+
credibility = blobs.length() - kErrorWeight * new_error;
630+
y_origin = new_c / std::sqrt(1 + gradient * gradient);
633631
//real intercept
634632
}
635633
void set_limits( //set min,max

src/ccstruct/polyaprx.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ EDGEPT edgepts[] //output is array
167167
edgepts[epindex].flags[FLAGS] = 0;
168168
edgepts[epindex].next = &edgepts[epindex + 1];
169169
prevdir += 64;
170-
epdir = (DIR128) 0 - prevdir;
170+
epdir = DIR128(0) - prevdir;
171171
epdir >>= 4;
172172
epdir &= 7;
173173
edgepts[epindex].flags[DIR] = epdir;
@@ -199,7 +199,7 @@ EDGEPT edgepts[] //output is array
199199
edgepts[epindex].prev = &edgepts[epindex - 1];
200200
edgepts[epindex].next = &edgepts[0];
201201
prevdir += 64;
202-
epdir = (DIR128) 0 - prevdir;
202+
epdir = DIR128(0) - prevdir;
203203
epdir >>= 4;
204204
epdir &= 7;
205205
edgepts[epindex].flags[DIR] = epdir;

0 commit comments

Comments
 (0)