Skip to content

Commit

Permalink
some casts to get rid of persistent warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@435 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
joregan committed Jul 21, 2010
1 parent cd96d8e commit 7e8bd73
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
**********************************************************************/

#include "mfcpch.h"
//#define USE_VLD //Uncomment for Visual Leak Detector.
#if (defined _MSC_VER && defined USE_VLD)
#include <vld.h>
#endif
#include <ctype.h>
#include "applybox.h"
#include "control.h"
Expand Down
2 changes: 1 addition & 1 deletion ccmain/charcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*
**********************************************************************/

#include "mfcpch.h"
// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif

#include "mfcpch.h"
#include "charcut.h"
#include "imgs.h"
#include "svshowim.h"
Expand Down
4 changes: 4 additions & 0 deletions ccmain/pgedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
*
**********************************************************************/

#ifdef _MSC_VER
#pragma warning(disable:4244) // Conversion warnings
#endif

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
Expand Down
4 changes: 2 additions & 2 deletions ccmain/tfacepp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ Tesseract::split_and_recog_word( //recog one owrd

first_word = word->poly_copy (denorm->row ()->x_height ());
blob_it.set_to_list (first_word->blob_list ());
bestgap = -MAX_INT32;
bestgap = (float) -MAX_INT32;
while (!blob_it.at_last ()) {
blob = blob_it.data ();
//gap to next
gap = blob_it.data_relative(1)->bounding_box().left() -
gap = (float) blob_it.data_relative(1)->bounding_box().left() -
blob->bounding_box().right();
blob_it.forward ();
if (gap > bestgap) {
Expand Down
8 changes: 4 additions & 4 deletions dict/trie.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Trie : public Dawg {
// Fills the given NodeChildVector with all the unichar ids (and the
// corresponding EDGE_REFs) for which there is an edge out of this node.
void unichar_ids_of(NODE_REF node, NodeChildVector *vec) const {
const EDGE_VECTOR &forward_edges = nodes_[node]->forward_edges;
const EDGE_VECTOR &forward_edges = nodes_[(int)node]->forward_edges;
for (int i = 0; i < forward_edges.size(); ++i) {
vec->push_back(NodeChild(unichar_id_from_edge_rec(forward_edges[i]),
make_edge_ref(node, i)));
Expand Down Expand Up @@ -148,8 +148,8 @@ class Trie : public Dawg {
uinT64 edge_index = (edge_ref & letter_mask_) >> LETTER_START_BIT;
uinT64 node_index =
(edge_ref & deref_node_index_mask_) >> flag_start_bit_;
TRIE_NODE_RECORD *node_rec = nodes_[node_index];
return &(node_rec->forward_edges[edge_index]);
TRIE_NODE_RECORD *node_rec = nodes_[(int)node_index];
return &(node_rec->forward_edges[(int)edge_index]);
}
// Constructs EDGE_REF from the given node_index and edge_index.
inline EDGE_REF make_edge_ref(NODE_REF node_index,
Expand Down Expand Up @@ -179,7 +179,7 @@ class Trie : public Dawg {
inline bool can_be_eliminated(const EDGE_RECORD &edge_rec) {
NODE_REF node_ref = next_node_from_edge_rec(edge_rec);
return (node_ref != NO_EDGE &&
nodes_[node_ref]->forward_edges.size() == 1);
nodes_[(int)node_ref]->forward_edges.size() == 1);
}

// Prints the contents of the Trie.
Expand Down

0 comments on commit 7e8bd73

Please sign in to comment.