Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimandrianov authored and mpimenov committed Mar 1, 2021
1 parent 437f4c7 commit a05dec2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions coding/mmap_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace std;
class MmapReader::MmapData
{
public:
explicit MmapData(string const & fileName, Advise advise)
explicit MmapData(string const & fileName, Advice advice)
{
// @TODO add windows support
#ifndef OMIM_OS_WINDOWS
Expand All @@ -43,11 +43,11 @@ class MmapReader::MmapData
}

int adv = MADV_NORMAL;
switch (advise)
switch (advice)
{
case Advise::Random: adv = MADV_RANDOM; break;
case Advise::Sequential: adv = MADV_SEQUENTIAL; break;
case Advise::Normal: adv = MADV_NORMAL; break;
case Advice::Random: adv = MADV_RANDOM; break;
case Advice::Sequential: adv = MADV_SEQUENTIAL; break;
case Advice::Normal: adv = MADV_NORMAL; break;
}

if (madvise(m_memory, s.st_size, adv) != 0)
Expand All @@ -71,9 +71,9 @@ class MmapReader::MmapData
int m_fd = 0;
};

MmapReader::MmapReader(string const & fileName, Advise advise)
MmapReader::MmapReader(string const & fileName, Advice advice)
: base_type(fileName)
, m_data(std::make_shared<MmapData>(fileName, advise))
, m_data(std::make_shared<MmapData>(fileName, advice))
, m_offset(0)
, m_size(m_data->m_size)
{
Expand Down
4 changes: 2 additions & 2 deletions coding/mmap_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
class MmapReader : public ModelReader
{
public:
enum class Advise
enum class Advice
{
Normal,
Random,
Sequential
};

explicit MmapReader(std::string const & fileName, Advise advise = Advise::Normal);
explicit MmapReader(std::string const & fileName, Advice advice = Advice::Normal);

uint64_t Size() const override;
void Read(uint64_t pos, void * p, size_t size) const override;
Expand Down
2 changes: 1 addition & 1 deletion generator/intermediate_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RawFilePointStorageMmapReader : public PointStorageReaderInterface
{
public:
explicit RawFilePointStorageMmapReader(string const & name)
: m_mmapReader(name, MmapReader::Advise::Random)
: m_mmapReader(name, MmapReader::Advice::Random)
{}

// PointStorageReaderInterface overrides:
Expand Down

0 comments on commit a05dec2

Please sign in to comment.