Skip to content

Commit

Permalink
push 3party warningt psu
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoryes authored and bykoianko committed Feb 22, 2019
1 parent 475663d commit e56537d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
12 changes: 6 additions & 6 deletions coding/simple_dense_coding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "base/assert.hpp"

#include "std/algorithm.hpp"
#include "std/limits.hpp"
#include <algorithm>
#include <limits>

#if defined(__clang__)
#pragma clang diagnostic push
Expand All @@ -20,18 +20,18 @@ namespace coding
{
namespace
{
size_t const kAlphabetSize = static_cast<size_t>(numeric_limits<uint8_t>::max()) + 1;
size_t const kAlphabetSize = static_cast<size_t>(std::numeric_limits<uint8_t>::max()) + 1;

// Calculates frequences for data symbols.
void CalcFrequences(vector<uint8_t> const & data, uint64_t frequency[])
void CalcFrequences(std::vector<uint8_t> const & data, uint64_t frequency[])
{
memset(frequency, 0, sizeof(*frequency) * kAlphabetSize);
for (uint8_t symbol : data)
++frequency[symbol];
}
} // namespace

SimpleDenseCoding::SimpleDenseCoding(vector<uint8_t> const & data)
SimpleDenseCoding::SimpleDenseCoding(std::vector<uint8_t> const & data)
{
// This static initialization isn't thread safe prior to C++11.
uint64_t frequency[kAlphabetSize]; // Maps symbols to frequences.
Expand All @@ -47,7 +47,7 @@ SimpleDenseCoding::SimpleDenseCoding(vector<uint8_t> const & data)
{
return frequency[lsym] > frequency[rsym];
};
sort(symbols, symbols + kAlphabetSize, frequencyCmp);
std::sort(symbols, symbols + kAlphabetSize, frequencyCmp);
for (size_t r = 0; r < kAlphabetSize; ++r)
rank[symbols[r]] = r;

Expand Down
15 changes: 13 additions & 2 deletions coding/simple_dense_coding.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#pragma once

#include "std/vector.hpp"
#include <cstdint>
#include <vector>

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "3party/succinct/elias_fano_compressed_list.hpp"

#if defined(__clang__)
#pragma clang diagnostic pop
#endif


namespace coding
{
Expand Down Expand Up @@ -32,7 +43,7 @@ class SimpleDenseCoding
public:
SimpleDenseCoding() = default;

SimpleDenseCoding(vector<uint8_t> const & data);
SimpleDenseCoding(std::vector<uint8_t> const & data);

SimpleDenseCoding(SimpleDenseCoding && rhs);

Expand Down
10 changes: 10 additions & 0 deletions indexer/succinct_trie_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
#include <utility>
#include <vector>

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "3party/succinct/rs_bit_vector.hpp"

#if defined(__clang__)
#pragma clang diagnostic pop
#endif


namespace trie
{
Expand Down

0 comments on commit e56537d

Please sign in to comment.