mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 05:34:58 +00:00
Big, possibly complete sweep of naming changes.
This commit is contained in:
parent
27fa09aee4
commit
ffab6897aa
93 changed files with 830 additions and 885 deletions
|
@ -6,40 +6,40 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
MappedFile::MappedFile(String&& fileName)
|
||||
: m_fileName(std::move(fileName))
|
||||
MappedFile::MappedFile(String&& file_name)
|
||||
: m_file_name(std::move(file_name))
|
||||
{
|
||||
m_fileLength = 1024;
|
||||
m_fd = open(m_fileName.characters(), O_RDONLY);
|
||||
m_file_length = 1024;
|
||||
m_fd = open(m_file_name.characters(), O_RDONLY);
|
||||
|
||||
if (m_fd != -1) {
|
||||
struct stat st;
|
||||
fstat(m_fd, &st);
|
||||
m_fileLength = st.st_size;
|
||||
m_map = mmap(nullptr, m_fileLength, PROT_READ, MAP_SHARED, m_fd, 0);
|
||||
m_file_length = st.st_size;
|
||||
m_map = mmap(nullptr, m_file_length, PROT_READ, MAP_SHARED, m_fd, 0);
|
||||
|
||||
if (m_map == MAP_FAILED)
|
||||
perror("");
|
||||
}
|
||||
|
||||
printf("MappedFile{%s} := { m_fd=%d, m_fileLength=%zu, m_map=%p }\n", m_fileName.characters(), m_fd, m_fileLength, m_map);
|
||||
printf("MappedFile{%s} := { m_fd=%d, m_file_length=%zu, m_map=%p }\n", m_file_name.characters(), m_fd, m_file_length, m_map);
|
||||
}
|
||||
|
||||
MappedFile::~MappedFile()
|
||||
{
|
||||
if (m_map != (void*)-1) {
|
||||
ASSERT(m_fd != -1);
|
||||
munmap(m_map, m_fileLength);
|
||||
munmap(m_map, m_file_length);
|
||||
}
|
||||
}
|
||||
|
||||
MappedFile::MappedFile(MappedFile&& other)
|
||||
: m_fileName(std::move(other.m_fileName))
|
||||
, m_fileLength(other.m_fileLength)
|
||||
: m_file_name(std::move(other.m_file_name))
|
||||
, m_file_length(other.m_file_length)
|
||||
, m_fd(other.m_fd)
|
||||
, m_map(other.m_map)
|
||||
{
|
||||
other.m_fileLength = 0;
|
||||
other.m_file_length = 0;
|
||||
other.m_fd = -1;
|
||||
other.m_map = (void*)-1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue