From 8007a392cf1512972cb9e92ba64923c58e60d12b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 8 Nov 2014 22:23:11 +0100 Subject: [PATCH] BMessage: add AddFlat taking a const BFlattenable It seems the const was forgotten in the BeOS version. But there is no reason not to have it. --- headers/os/app/Message.h | 2 ++ src/kits/app/Message.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/headers/os/app/Message.h b/headers/os/app/Message.h index 05488c2c63..7d68c671d6 100644 --- a/headers/os/app/Message.h +++ b/headers/os/app/Message.h @@ -163,6 +163,8 @@ public: const BMessage* message); status_t AddFlat(const char* name, BFlattenable* object, int32 count = 1); + status_t AddFlat(const char* name, + const BFlattenable* object, int32 count = 1); status_t AddData(const char* name, type_code type, const void* data, ssize_t numBytes, bool isFixedSize = true, int32 count = 1); diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index 7f21ca9c00..f4ca55b9fd 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -2730,6 +2730,13 @@ BMessage::AddMessage(const char* name, const BMessage* message) status_t BMessage::AddFlat(const char* name, BFlattenable* object, int32 count) +{ + return AddFlat(name, (const BFlattenable*)object, count); +} + + +status_t +BMessage::AddFlat(const char* name, const BFlattenable* object, int32 count) { if (object == NULL) return B_BAD_VALUE;