diff --git a/src/kits/app/Application.cpp b/src/kits/app/Application.cpp index d6f3069b3f..27a780d53b 100644 --- a/src/kits/app/Application.cpp +++ b/src/kits/app/Application.cpp @@ -420,8 +420,8 @@ void BApplication::SetCursor(const BCursor* cursor, bool sync) // TODO: add sync support - working on updating FlushWithReply --DW PortLink *link=new PortLink(fServerTo); link->SetOpCode(AS_SET_CURSOR_BCURSOR); - link->Attach(sync); - link->Attach(cursor->m_serverToken); + link->Attach(sync); + link->Attach(cursor->m_serverToken); link->Flush(); delete link; } @@ -757,8 +757,8 @@ void BApplication::InitData(const char* signature, status_t* error) PortLink *link=new PortLink(fServerFrom); link->SetOpCode(AS_CREATE_APP); - link->Attach((int32)fServerTo); - link->Attach(_get_object_token_(this)); + link->Attach((int32)fServerTo); + link->Attach(_get_object_token_(this)); link->Attach((char*)signature,strlen(signature)+1); status_t replyerr=link->FlushWithReply(&replydata); if(replyerr==B_OK) @@ -801,8 +801,8 @@ void BApplication::BeginRectTracking(BRect r, bool trackWhole) { PortLink *link=new PortLink(fServerTo); link->SetOpCode(AS_BEGIN_RECT_TRACKING); - link->Attach(r); - link->Attach(trackWhole); + link->Attach(r); + link->Attach(trackWhole); link->Flush(); delete link; } diff --git a/src/kits/app/PortLink.cpp b/src/kits/app/PortLink.cpp index cb750e0001..51a867e56c 100644 --- a/src/kits/app/PortLink.cpp +++ b/src/kits/app/PortLink.cpp @@ -43,23 +43,6 @@ #include #endif -/*! - \class PortLinkData PortLink.cpp - \brief Internal data storage class - - PortLinkData objects serve to hold attached data whilst it is waiting to be Flattened() - and then Flushed(). There is no need for this to be used outside the PortLink class. -*/ -class PortLinkData -{ -public: - PortLinkData(void); - ~PortLinkData(void); - status_t Set(const void *data, size_t size); - char *buffer; - size_t buffersize; -}; - /*! \brief Constructor \param port A valid target port_id @@ -536,30 +519,6 @@ printf("\tAttach(): Couldn't assign data to PortLinkData object\n"); return B_OK; } -template status_t PortLink::Attach(Type data) -{ - int32 size=sizeof(Type); - -#ifdef CAPACITY_CHECKING - if(bufferlength+size>capacity) - return B_NO_MEMORY; -#endif - - // create a new storage object and stash the data - PortLinkData *pld=new PortLinkData; - if(pld->Set(&data,size)==B_OK) - { - attachlist->AddItem(pld); - bufferlength+=size; - } - else - { - delete pld; - return B_ERROR; - } - return B_OK; -} - void PortLink::FlattenData(int8 **buffer,int32 *size) { // This function is where all the magic happens, but it is strictly internal. diff --git a/src/kits/app/PortMessage.cpp b/src/kits/app/PortMessage.cpp index 1ab7a91f3d..49d3cd7d52 100644 --- a/src/kits/app/PortMessage.cpp +++ b/src/kits/app/PortMessage.cpp @@ -128,24 +128,6 @@ void PortMessage::SetBuffer(const void *buffer, const ssize_t &size, const bool } } -template status_t PortMessage::Read(Type *data) -{ - int32 size = sizeof(Type); - - if(!data) - return B_BAD_VALUE; - - if( !_buffer || - (_buffersize < size) || - (_index+size > _buffer+_buffersize) ) - return B_NO_MEMORY; - - *data=*((Type*)_index); - _index+=size; - - return B_OK; -} - status_t PortMessage::Read(void *data, ssize_t size) { if(!data || size<1)