ole32: Get rid of casts in 64-bit int serialization helper.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-12-12 13:43:23 +03:00 committed by Alexandre Julliard
parent 31c41d9855
commit d34ec97ad5
3 changed files with 6 additions and 9 deletions

View File

@ -1981,9 +1981,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{ {
FILETIME temp; FILETIME temp;
StorageUtl_WriteULargeInteger((BYTE *)&temp, 0, StorageUtl_WriteULargeInteger(&temp, 0, (const ULARGE_INTEGER *)&var->u.filetime);
(const ULARGE_INTEGER *)&var->u.filetime); hr = IStream_Write(This->stm, &temp, sizeof(temp), &count);
hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count);
bytesWritten = count; bytesWritten = count;
break; break;
} }

View File

@ -6982,17 +6982,16 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
#endif #endif
} }
void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value)
const ULARGE_INTEGER *value)
{ {
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
ULARGE_INTEGER tmp; ULARGE_INTEGER tmp;
tmp.u.LowPart = htole32(value->u.HighPart); tmp.u.LowPart = htole32(value->u.HighPart);
tmp.u.HighPart = htole32(value->u.LowPart); tmp.u.HighPart = htole32(value->u.LowPart);
memcpy(buffer + offset, &tmp, sizeof(ULARGE_INTEGER)); memcpy((BYTE *)buffer + offset, &tmp, sizeof(ULARGE_INTEGER));
#else #else
memcpy(buffer + offset, value, sizeof(ULARGE_INTEGER)); memcpy((BYTE *)buffer + offset, value, sizeof(ULARGE_INTEGER));
#endif #endif
} }

View File

@ -561,8 +561,7 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSP
void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
ULARGE_INTEGER* value) DECLSPEC_HIDDEN; ULARGE_INTEGER* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN;
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination, void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,