diff --git a/src/system/kernel/messaging/MessagingService.cpp b/src/system/kernel/messaging/MessagingService.cpp index 4b59f25eec..fe83fd3da0 100644 --- a/src/system/kernel/messaging/MessagingService.cpp +++ b/src/system/kernel/messaging/MessagingService.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -199,8 +200,7 @@ MessagingArea::AllocateCommand(uint32 commandWhat, int32 dataSize, } // init the command - messaging_command *command - = (messaging_command*)((char*)fHeader + commandOffset); + BytePointer 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 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; }