diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-31 21:11:29 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-31 21:11:29 +0000 |
commit | 89a162041f1b335d0dbb286013ccca5716e0a595 (patch) | |
tree | a581735ab54cef074837978dec9599377225b238 | |
parent | f1558e4afd2afe5b23c4ecf9fb4de0415068cc02 (diff) |
valgrind
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@637 ec762483-ff6d-05da-a07a-a48fb63a330f
-rwxr-xr-x | decoder/apply_fsa_models.cc | 4 | ||||
-rw-r--r-- | utils/d_ary_heap.h | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/decoder/apply_fsa_models.cc b/decoder/apply_fsa_models.cc index 4bf4e031..4431643f 100755 --- a/decoder/apply_fsa_models.cc +++ b/decoder/apply_fsa_models.cc @@ -499,8 +499,8 @@ typedef Item *ItemP; #undef INIT_LOCATION #if D_ARY_TRACK_OUT_OF_HEAP # define INIT_LOCATION , location(D_ARY_HEAP_NULL_INDEX) -#elsif !defined(NDEBUG) || SAFE_VALGRIND - // avoid spurious valgrind warning +#elif !defined(NDEBUG) || SAFE_VALGRIND + // avoid spurious valgrind warning - FIXME: still complains??? # define INIT_LOCATION , location() #else # define INIT_LOCATION diff --git a/utils/d_ary_heap.h b/utils/d_ary_heap.h index 606382c2..fea0883b 100644 --- a/utils/d_ary_heap.h +++ b/utils/d_ary_heap.h @@ -1,6 +1,8 @@ #ifndef D_ARY_HEAP_H #define D_ARY_HEAP_H +#include "show.h" +#define DDARY(x) x #define D_ARY_PUSH_GRAEHL 0 // untested #define D_ARY_POP_GRAEHL 0 // untested @@ -213,7 +215,7 @@ #if D_ARY_TRACK_OUT_OF_HEAP using boost::put; for (typename Container::iterator i=data.begin(),e=data.end();i!=e;++i) - put(index_in_heap,*i,D_ARY_HEAP_NULL_INDEX); + put(index_in_heap,*i,(size_type)D_ARY_HEAP_NULL_INDEX); #endif data.clear(); } @@ -244,7 +246,7 @@ void pop() { using boost::put; if(D_ARY_TRACK_OUT_OF_HEAP) - put(index_in_heap, data[0], D_ARY_HEAP_NULL_INDEX); + put(index_in_heap, data[0], (size_type)D_ARY_HEAP_NULL_INDEX); if (data.size() != 1) { if (D_ARY_POP_GRAEHL) { preserve_heap_property_down(data.back(),0,data.size()-1); @@ -287,8 +289,9 @@ // because maybe size_type is signed or unsigned inline bool contains(const Value &v,size_type i) const { if (D_ARY_TRACK_OUT_OF_HEAP) - return i != D_ARY_HEAP_NULL_INDEX; + return i != (size_type)D_ARY_HEAP_NULL_INDEX; size_type sz=data.size(); + SHOWM2(DDARY,"d_ary_heap contains",i,data.size()); return i>=0 && i<sz && equal(v,data[i]); // note: size_type may be signed (don't recommend it, though) - thus i>=0 check to catch uninit. data } #include "warning_pop.h" |