@@ -66,18 +66,18 @@ using namespace Replication;
6666
6767namespace
6868{
69- const unsigned FLUSH_WAIT_INTERVAL = 1 ; // milliseconds
69+ inline constexpr unsigned FLUSH_WAIT_INTERVAL = 1 ; // milliseconds
7070
71- const unsigned NO_SPACE_TIMEOUT = 10 ; // seconds
72- const unsigned NO_SPACE_RETRIES = 6 ; // up to one minute
71+ inline constexpr unsigned NO_SPACE_TIMEOUT = 10 ; // seconds
72+ inline constexpr unsigned NO_SPACE_RETRIES = 6 ; // up to one minute
7373
74- const unsigned COPY_BLOCK_SIZE = 64 * 1024 ; // 64 KB
74+ inline constexpr unsigned COPY_BLOCK_SIZE = 64 * 1024 ; // 64 KB
7575
76- const char * FILENAME_PATTERN = " %s.journal-%09" UQUADFORMAT;
76+ inline constexpr const char * FILENAME_PATTERN = " %s.journal-%09" UQUADFORMAT;
7777
78- const char * FILENAME_WILDCARD = " $(filename)" ;
79- const char * PATHNAME_WILDCARD = " $(pathname)" ;
80- const char * ARCHPATHNAME_WILDCARD = " $(archivepathname)" ;
78+ inline constexpr const char * FILENAME_WILDCARD = " $(filename)" ;
79+ inline constexpr const char * PATHNAME_WILDCARD = " $(pathname)" ;
80+ inline constexpr const char * ARCHPATHNAME_WILDCARD = " $(archivepathname)" ;
8181
8282 static THREAD_ENTRY_DECLARE archiver_thread (THREAD_ENTRY_PARAM arg)
8383 {
@@ -300,7 +300,7 @@ void ChangeLog::Segment::mapHeader()
300300 m_mapping = CreateFileMapping ((HANDLE) _get_osfhandle (m_handle), NULL , PAGE_READWRITE,
301301 0 , sizeof (SegmentHeader), NULL );
302302
303- if (m_mapping == INVALID_HANDLE_VALUE )
303+ if (! m_mapping)
304304 raiseError (" Journal file %s mapping failed (error %d)" , m_filename.c_str (), ERRNO);
305305
306306 auto address = MapViewOfFile (m_mapping, FILE_MAP_READ | FILE_MAP_WRITE,
@@ -323,7 +323,7 @@ void ChangeLog::Segment::unmapHeader()
323323#ifdef WIN_NT
324324 UnmapViewOfFile (m_header);
325325 CloseHandle (m_mapping);
326- m_mapping = INVALID_HANDLE_VALUE ;
326+ m_mapping = 0 ;
327327#else
328328 munmap (m_header, sizeof (SegmentHeader));
329329#endif
@@ -683,13 +683,13 @@ bool ChangeLog::archiveExecute(Segment* segment)
683683 size_t pos;
684684
685685 while ( (pos = archiveCommand.find (FILENAME_WILDCARD)) != string::npos)
686- archiveCommand.replace (pos, strlen (FILENAME_WILDCARD), filename);
686+ archiveCommand.replace (pos, fb_strlen (FILENAME_WILDCARD), filename);
687687
688688 while ( (pos = archiveCommand.find (PATHNAME_WILDCARD)) != string::npos)
689- archiveCommand.replace (pos, strlen (PATHNAME_WILDCARD), pathname);
689+ archiveCommand.replace (pos, fb_strlen (PATHNAME_WILDCARD), pathname);
690690
691691 while ( (pos = archiveCommand.find (ARCHPATHNAME_WILDCARD)) != string::npos)
692- archiveCommand.replace (pos, strlen (ARCHPATHNAME_WILDCARD), archpathname);
692+ archiveCommand.replace (pos, fb_strlen (ARCHPATHNAME_WILDCARD), archpathname);
693693
694694 LockCheckout checkout (this );
695695
@@ -944,7 +944,7 @@ ChangeLog::Segment* ChangeLog::createSegment()
944944
945945 const auto fd = os_utils::openCreateSharedFile (filename.c_str (), O_EXCL | O_BINARY);
946946
947- SegmentHeader dummyHeader = {0 };
947+ const SegmentHeader dummyHeader = {0 };
948948 if (::write (fd, &dummyHeader, sizeof (SegmentHeader)) != sizeof (SegmentHeader))
949949 {
950950 ::close (fd);
0 commit comments