Fixed includes and removed some debug output. You could now switch Message.cpp, MessageBody.cpp and MessageField.cpp in src/kits/app/app.src to Message2.cpp, MessageBody2.cpp and MessageField2.cpp to test the new implementation. Fixed the wrong commit message by the way (via svn propset).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13778 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -33,12 +33,12 @@
|
||||
#include <String.h>
|
||||
|
||||
#include <AppMisc.h>
|
||||
#include <DataBuffer.h>
|
||||
#include <KMessage.h>
|
||||
#include <MessageBody.h>
|
||||
#include <MessageUtils.h>
|
||||
#include <TokenSpace.h>
|
||||
|
||||
#include "MessageBody.h"
|
||||
|
||||
#include "dano_message.h"
|
||||
|
||||
static const uint32 kMessageMagic = 'FOB1';
|
||||
@@ -958,10 +958,8 @@ BMessage::Unflatten(BDataIO* stream)
|
||||
uint32 magic;
|
||||
reader(magic);
|
||||
|
||||
printf("read magic\n");
|
||||
status = header.SetMagic(magic);
|
||||
if (status < B_OK) {
|
||||
printf("magic failed: %x (kMessageMagic: %x; kMessageMagicDano: %x;)\n", magic, kMessageMagic, kMessageMagicDano);
|
||||
// we support reading Dano messages from disk as well
|
||||
if (magic == kMessageMagicDano)
|
||||
return BPrivate::unflatten_dano_message(magic, *stream, *this);
|
||||
@@ -969,7 +967,6 @@ printf("read magic\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
printf("here\n");
|
||||
status = header.ReadFrom(*stream);
|
||||
if (status < B_OK) {
|
||||
printf("BMessage::Unflatten(): Reading the header failed: %lx\n", status);
|
||||
@@ -987,7 +984,6 @@ printf("here\n");
|
||||
|
||||
int8 flags;
|
||||
reader(flags);
|
||||
printf("flags: %x\n", flags);
|
||||
while (flags != MSG_LAST_ENTRY) {
|
||||
type_code type;
|
||||
reader(type);
|
||||
@@ -1022,7 +1018,6 @@ printf("flags: %x\n", flags);
|
||||
}
|
||||
}
|
||||
|
||||
printf("count: %ld; dataLen: %ld\n", count, dataLen);
|
||||
// Get the name length (1 byte)
|
||||
reader(nameLen);
|
||||
// Get the name (name length bytes)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <stdio.h>
|
||||
#include <DataIO.h>
|
||||
#include <TypeConstants.h>
|
||||
#include <MessageBody.h>
|
||||
#include "MessageBody2.h"
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
@@ -252,7 +252,6 @@ BMessageBody::Flatten(BDataIO *stream) const
|
||||
|
||||
// overall data size
|
||||
size_t size = field->TotalSize();
|
||||
printf("totalsize: %ld\n", size);
|
||||
if (!isFixed) {
|
||||
// add bytes for holding each items size
|
||||
size += count * sizeof(size_t);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <TypeConstants.h>
|
||||
#include "MessageField.h"
|
||||
#include "MessageField2.h"
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user