-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++17 introduction and minor clean-ups #453
base: master
Are you sure you want to change the base?
Changes from all commits
c0a46c3
09d98b9
be5d0d9
fc6b52b
5a69070
09b2776
22e9d03
8df5a40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ static map<string, shared_ptr<FileBuffer>> g_filebuffer_map; | |
static mutex g_mutex_map; | ||
static bool g_small_memory = true; | ||
|
||
#define MAGIC_PATH '>' | ||
static constexpr char MAGIC_PATH = '>'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To my knowledge |
||
|
||
string g_current_dir = ">"; | ||
|
||
|
@@ -139,7 +139,7 @@ class FSBasic | |
|
||
virtual int Decompress(const string& /*backfifle*/, shared_ptr<FileBuffer> /*outp*/) { return 0; }; | ||
virtual bool seekable(const string& /*backfile*/) { return false; } | ||
virtual std::shared_ptr<FragmentBlock> ScanCompressblock(const string& /*backfile*/, size_t& /*input_offset*/, size_t& /*output_offset*/) { return NULL; }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few |
||
virtual std::shared_ptr<FragmentBlock> ScanCompressblock(const string& /*backfile*/, size_t& /*input_offset*/, size_t& /*output_offset*/) { return nullptr; }; | ||
virtual int PreloadWorkThread(shared_ptr<FileBuffer>outp); | ||
|
||
virtual int split(const string &filename, string *outbackfile, string *outfilename, bool dir=false) | ||
|
@@ -969,13 +969,13 @@ shared_ptr<FragmentBlock> FSBz2::ScanCompressblock(const string& backfile, size_ | |
|
||
pbz = get_file_buffer(backfile, true); | ||
if (pbz == nullptr) { | ||
return NULL; | ||
return nullptr; | ||
} | ||
|
||
size_t request_size = 1 * 1000 * 1000; | ||
shared_ptr<DataBuffer> pd = pbz->request_data(input_offset, request_size); | ||
if (!pd) | ||
return NULL; | ||
return nullptr; | ||
|
||
uint8_t* p1 = pd->data(); | ||
|
||
|
@@ -1011,7 +1011,7 @@ shared_ptr<FragmentBlock> FSBz2::ScanCompressblock(const string& backfile, size_ | |
} | ||
} | ||
|
||
return NULL; | ||
return nullptr; | ||
} | ||
|
||
bool FSBz2::seekable(const string& backfile) | ||
|
@@ -1658,7 +1658,7 @@ std::shared_ptr<FragmentBlock> FileBuffer::request_new_blk() | |
while (offset > m_last_request_offset + m_total_buffer_size) | ||
{ | ||
if (m_reset_stream) | ||
return NULL; | ||
return nullptr; | ||
std::unique_lock<std::mutex> lck(m_pool_load_cv_mutex); | ||
m_pool_load_cv.wait(lck); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much to see here (and in
bmap.h
), just some missing license headers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is okay to add BSD license headers, just remove copy write line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped the
Copyright ...
lines.