MessagingService: use BytePointer

Change-Id: If7890e215180206010a374b8afa9f4cd47325afc
Reviewed-on: https://review.haiku-os.org/c/1099
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
PulkoMandy
2019-03-09 17:09:11 +00:00
committed by waddlesplash
parent 5bf19df235
commit 995aabb04e
@@ -10,6 +10,7 @@
#include <new>
#include <AutoDeleter.h>
#include <BytePointer.h>
#include <KernelExport.h>
#include <KMessage.h>
#include <messaging.h>
@@ -199,8 +200,7 @@ MessagingArea::AllocateCommand(uint32 commandWhat, int32 dataSize,
}
// init the command
messaging_command *command
= (messaging_command*)((char*)fHeader + commandOffset);
BytePointer<messaging_command> command((char*)fHeader + commandOffset);
command->next_command = 0;
command->command = commandWhat;
command->size = size;
@@ -243,7 +243,7 @@ MessagingArea::_CheckCommand(int32 offset, int32 &size)
}
// get and check size
messaging_command *command = (messaging_command*)((char*)fHeader + offset);
BytePointer<messaging_command> command((char*)fHeader + offset);
size = command->size;
if (size < (int32)sizeof(messaging_command))
return NULL;
@@ -251,7 +251,7 @@ MessagingArea::_CheckCommand(int32 offset, int32 &size)
if (offset + size > fSize)
return NULL;
return command;
return &command;
}