mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Fix -Wcast-qual warnings
This commit is contained in:
@@ -1717,16 +1717,17 @@ class eventlog_handle_closer
|
||||
// requested record in the buffer.
|
||||
template<class CharT>
|
||||
inline bool find_record_in_buffer( const void* pBuffer, unsigned long dwBytesRead, const CharT *provider_name
|
||||
, unsigned int id_to_find, interprocess_eventlogrecord *&pevent_log_record)
|
||||
, unsigned int id_to_find, const interprocess_eventlogrecord *&pevent_log_record)
|
||||
{
|
||||
const unsigned char * pRecord = static_cast<const unsigned char*>(pBuffer);
|
||||
const unsigned char * pEndOfRecords = pRecord + dwBytesRead;
|
||||
|
||||
while (pRecord < pEndOfRecords){
|
||||
interprocess_eventlogrecord *pTypedRecord = (interprocess_eventlogrecord*)(void*)pRecord;
|
||||
const interprocess_eventlogrecord *pTypedRecord = (const interprocess_eventlogrecord*)(const void*)pRecord;
|
||||
// Check provider, written at the end of the fixed-part of the record
|
||||
|
||||
if (0 == winapi_traits<CharT>::cmp(provider_name, (CharT*)(void*)(pRecord + sizeof(interprocess_eventlogrecord))))
|
||||
const CharT *const pName = static_cast<const CharT*>(static_cast<const void*>(pRecord + sizeof(interprocess_eventlogrecord)));
|
||||
if (0 == winapi_traits<CharT>::cmp(provider_name, pName))
|
||||
{
|
||||
// Check event id
|
||||
if(id_to_find == (pTypedRecord->EventID & 0xFFFF)){
|
||||
@@ -1794,7 +1795,7 @@ inline bool get_last_bootup_time(std::string &stamp)
|
||||
}
|
||||
else
|
||||
{
|
||||
interprocess_eventlogrecord *pTypedRecord;
|
||||
const interprocess_eventlogrecord *pTypedRecord;
|
||||
// Print the contents of each record in the buffer.
|
||||
if(find_record_in_buffer(heap_deleter.get(), dwBytesRead, provider_name, event_id, pTypedRecord)){
|
||||
char stamp_str[sizeof(unsigned long)*3+1];
|
||||
@@ -1860,7 +1861,7 @@ inline bool get_last_bootup_time(std::wstring &stamp)
|
||||
}
|
||||
else
|
||||
{
|
||||
interprocess_eventlogrecord *pTypedRecord;
|
||||
const interprocess_eventlogrecord *pTypedRecord;
|
||||
// Print the contents of each record in the buffer.
|
||||
if(find_record_in_buffer(heap_deleter.get(), dwBytesRead, provider_name, event_id, pTypedRecord)){
|
||||
wchar_t stamp_str[sizeof(unsigned long)*3+1];
|
||||
|
||||
@@ -532,7 +532,9 @@ bool test_clear_free_memory(Allocator &a)
|
||||
for(std::size_t j = 0; j < memsize; ++j){
|
||||
if(static_cast<char*>((char*)ptr)[j]){
|
||||
std::cout << "Zero memory test failed. in buffer " << i
|
||||
<< " byte " << j << " first address " << (void*) first_addr << " offset " << ((char*)ptr+j) - (char*)first_addr << " memsize: " << memsize << std::endl;
|
||||
<< " byte " << j << " first address " << (const void*) first_addr
|
||||
<< " offset " << ((const char*)ptr+j) - (const char*)first_addr
|
||||
<< " memsize: " << memsize << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user