Skip to content

Commit

Permalink
clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Feb 22, 2016
1 parent 2c0be5b commit b56a0a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lm/interpolate/normalize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ class BackoffManager {
// Indexed by order then just all the matching models.
util::FixedArray<util::FixedArray<BackoffQueueEntry*> > entered_;

std::size_t order_;

BackoffMatrix matrix_;

std::vector<util::stream::Stream*> skip_write_;
Expand Down
2 changes: 1 addition & 1 deletion lm/interpolate/tune_weights.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <vector>

namespace lm { namespace interpolate {
class InstancesConfig;
struct InstancesConfig;

// Run a tuning loop, producing weights as output.
void TuneWeights(int tune_file, const std::vector<StringPiece> &model_names, const InstancesConfig &config, std::vector<float> &weights);
Expand Down
15 changes: 12 additions & 3 deletions lm/trie_sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class PartialViewProxy {
const void *Data() const { return inner_.Data(); }
void *Data() { return inner_.Data(); }

friend void swap(PartialViewProxy first, PartialViewProxy second) {
std::swap_ranges(reinterpret_cast<char*>(first.Data()), reinterpret_cast<char*>(first.Data()) + first.attention_size_, reinterpret_cast<char*>(second.Data()));
}
friend void swap(PartialViewProxy first, PartialViewProxy second);

private:
friend class util::ProxyIterator<PartialViewProxy>;
Expand All @@ -71,6 +69,17 @@ class PartialViewProxy {
util::FreePool *pool_;
};

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
void swap(PartialViewProxy first, PartialViewProxy second) {
std::swap_ranges(reinterpret_cast<char*>(first.Data()), reinterpret_cast<char*>(first.Data()) + first.attention_size_, reinterpret_cast<char*>(second.Data()));
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif

typedef util::ProxyIterator<PartialViewProxy> PartialIter;

FILE *DiskFlush(const void *mem_begin, const void *mem_end, const std::string &temp_prefix) {
Expand Down

0 comments on commit b56a0a1

Please sign in to comment.