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 <String.h>
|
||||||
|
|
||||||
#include <AppMisc.h>
|
#include <AppMisc.h>
|
||||||
#include <DataBuffer.h>
|
|
||||||
#include <KMessage.h>
|
#include <KMessage.h>
|
||||||
#include <MessageBody.h>
|
|
||||||
#include <MessageUtils.h>
|
#include <MessageUtils.h>
|
||||||
#include <TokenSpace.h>
|
#include <TokenSpace.h>
|
||||||
|
|
||||||
|
#include "MessageBody.h"
|
||||||
|
|
||||||
#include "dano_message.h"
|
#include "dano_message.h"
|
||||||
|
|
||||||
static const uint32 kMessageMagic = 'FOB1';
|
static const uint32 kMessageMagic = 'FOB1';
|
||||||
@@ -958,10 +958,8 @@ BMessage::Unflatten(BDataIO* stream)
|
|||||||
uint32 magic;
|
uint32 magic;
|
||||||
reader(magic);
|
reader(magic);
|
||||||
|
|
||||||
printf("read magic\n");
|
|
||||||
status = header.SetMagic(magic);
|
status = header.SetMagic(magic);
|
||||||
if (status < B_OK) {
|
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
|
// we support reading Dano messages from disk as well
|
||||||
if (magic == kMessageMagicDano)
|
if (magic == kMessageMagicDano)
|
||||||
return BPrivate::unflatten_dano_message(magic, *stream, *this);
|
return BPrivate::unflatten_dano_message(magic, *stream, *this);
|
||||||
@@ -969,7 +967,6 @@ printf("read magic\n");
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("here\n");
|
|
||||||
status = header.ReadFrom(*stream);
|
status = header.ReadFrom(*stream);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
printf("BMessage::Unflatten(): Reading the header failed: %lx\n", status);
|
printf("BMessage::Unflatten(): Reading the header failed: %lx\n", status);
|
||||||
@@ -987,7 +984,6 @@ printf("here\n");
|
|||||||
|
|
||||||
int8 flags;
|
int8 flags;
|
||||||
reader(flags);
|
reader(flags);
|
||||||
printf("flags: %x\n", flags);
|
|
||||||
while (flags != MSG_LAST_ENTRY) {
|
while (flags != MSG_LAST_ENTRY) {
|
||||||
type_code type;
|
type_code type;
|
||||||
reader(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)
|
// Get the name length (1 byte)
|
||||||
reader(nameLen);
|
reader(nameLen);
|
||||||
// Get the name (name length bytes)
|
// Get the name (name length bytes)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
#include <TypeConstants.h>
|
#include <TypeConstants.h>
|
||||||
#include <MessageBody.h>
|
#include "MessageBody2.h"
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
@@ -252,7 +252,6 @@ BMessageBody::Flatten(BDataIO *stream) const
|
|||||||
|
|
||||||
// overall data size
|
// overall data size
|
||||||
size_t size = field->TotalSize();
|
size_t size = field->TotalSize();
|
||||||
printf("totalsize: %ld\n", size);
|
|
||||||
if (!isFixed) {
|
if (!isFixed) {
|
||||||
// add bytes for holding each items size
|
// add bytes for holding each items size
|
||||||
size += count * sizeof(size_t);
|
size += count * sizeof(size_t);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
#include <TypeConstants.h>
|
#include <TypeConstants.h>
|
||||||
#include "MessageField.h"
|
#include "MessageField2.h"
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user