Skip to content

Commit

Permalink
Fixed type of bit vector
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@234 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed Jun 2, 2009
1 parent 636765e commit 74c3f2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cutil/bitvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
#ifndef BITVEC_H
#define BITVEC_H

#include "host.h"

/**----------------------------------------------------------------------------
Include Files and Type Defines
----------------------------------------------------------------------------**/
#define BITSINLONG 32 /*no of bits in a long */
typedef unsigned int *BIT_VECTOR;
typedef uinT32 *BIT_VECTOR;

/**----------------------------------------------------------------------------
Public Function Prototypes
Expand Down Expand Up @@ -67,9 +69,7 @@ BIT_VECTOR ExpandBitVector(BIT_VECTOR Vector, int NewNumBits);

void FreeBitVector(BIT_VECTOR BitVector);

int hamming_distance(register unsigned long *array1,
register unsigned long *array2,
register int length);
int hamming_distance(uinT32* array1, uinT32* array2, int length);

BIT_VECTOR NewBitVector(int NumBits);
/*
Expand Down
8 changes: 5 additions & 3 deletions wordrec/bestfirst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
/*----------------------------------------------------------------------
I n c l u d e s
---------------------------------------------------------------------*/
#include <assert.h>

#include "bestfirst.h"
#include "heuristic.h"
#include "plotseg.h"
Expand Down Expand Up @@ -166,9 +168,9 @@ void delete_search(SEARCH_RECORD *the_search) {
float closeness;

closeness = (the_search->num_joints ?
(hamming_distance ((unsigned long *) the_search->first_state,
(unsigned long *) the_search->best_state,
2) / (float) the_search->num_joints) : 0.0);
(hamming_distance(reinterpret_cast<uinT32*>(the_search->first_state),
reinterpret_cast<uinT32*>(the_search->best_state), 2) /
(float) the_search->num_joints) : 0.0f);

record_search_status (the_search->num_states,
the_search->before_best, closeness);
Expand Down

0 comments on commit 74c3f2d

Please sign in to comment.