fixed spelling and changed casting from C-style to new C++ style

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1570 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2002-10-18 03:26:49 +00:00
parent e9651c05a1
commit c48048d386

View File

@ -1,8 +1,8 @@
/*****************************************************************************/ /*****************************************************************************/
// File: TranslationUtils.h // File: TranslationUtils.h
// Class: BTranslationUtils // Class: BTranslationUtils
// Reimplimented by: Michael Wilber, Translation Kit Team // Reimplemented by: Michael Wilber, Translation Kit Team
// Reimplimentation: 2002-04 // Reimplementation: 2002-04
// //
// Description: Utility functions for the Translation Kit // Description: Utility functions for the Translation Kit
// //
@ -363,7 +363,7 @@ BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView,
// copy the stream header from the mallio buffer // copy the stream header from the mallio buffer
TranslatorStyledTextStreamHeader stm_header = TranslatorStyledTextStreamHeader stm_header =
*((TranslatorStyledTextStreamHeader *) mallio.Buffer()); *(reinterpret_cast<const TranslatorStyledTextStreamHeader *> (mallio.Buffer()));
// convert the stm_header.header struct to the host format // convert the stm_header.header struct to the host format
const size_t kRecordHeaderSize = sizeof(TranslatorStyledTextRecordHeader); const size_t kRecordHeaderSize = sizeof(TranslatorStyledTextRecordHeader);
@ -384,8 +384,8 @@ BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView,
return B_ERROR; return B_ERROR;
TranslatorStyledTextTextHeader txt_header = TranslatorStyledTextTextHeader txt_header =
*((TranslatorStyledTextTextHeader *) ((char *) mallio.Buffer() + *(reinterpret_cast<const TranslatorStyledTextTextHeader *>
offset)); (reinterpret_cast<const char *> (mallio.Buffer()) + offset));
// convert the stm_header.header struct to the host format // convert the stm_header.header struct to the host format
if (swap_data(B_UINT32_TYPE, &txt_header.header, kRecordHeaderSize, if (swap_data(B_UINT32_TYPE, &txt_header.header, kRecordHeaderSize,
@ -403,7 +403,8 @@ BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView,
if (mallio.BufferLength() < offset + txt_header.header.data_size) if (mallio.BufferLength() < offset + txt_header.header.data_size)
return B_ERROR; return B_ERROR;
const char *pTextData = ((const char *) mallio.Buffer()) + offset; const char *pTextData =
(reinterpret_cast<const char *> (mallio.Buffer())) + offset;
// point text pointer at the actual character data // point text pointer at the actual character data
if (mallio.BufferLength() > offset + txt_header.header.data_size) { if (mallio.BufferLength() > offset + txt_header.header.data_size) {
@ -417,8 +418,8 @@ BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView,
return B_ERROR; return B_ERROR;
TranslatorStyledTextStyleHeader stl_header = TranslatorStyledTextStyleHeader stl_header =
*((TranslatorStyledTextStyleHeader *) *(reinterpret_cast<const TranslatorStyledTextStyleHeader *>
((char *) mallio.Buffer() + offset)); (reinterpret_cast<const char *> (mallio.Buffer()) + offset));
if (swap_data(B_UINT32_TYPE, &stl_header.header, kRecordHeaderSize, if (swap_data(B_UINT32_TYPE, &stl_header.header, kRecordHeaderSize,
B_SWAP_BENDIAN_TO_HOST) != B_OK) B_SWAP_BENDIAN_TO_HOST) != B_OK)
return B_ERROR; return B_ERROR;
@ -436,8 +437,8 @@ BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView,
return B_ERROR; return B_ERROR;
// set pRawData to the flattened run array data // set pRawData to the flattened run array data
const void *kpRawData = (const void *) ((char *) mallio.Buffer() + const void *kpRawData = reinterpret_cast<const void *>
offset); (reinterpret_cast<const char *> (mallio.Buffer()) + offset);
text_run_array *pRunArray = BTextView::UnflattenRunArray(kpRawData); text_run_array *pRunArray = BTextView::UnflattenRunArray(kpRawData);
if (pRunArray) { if (pRunArray) {