Commit 7c7037db authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Guid: rename fields to better match Microsoft usage

parent 7e08d2af
......@@ -33,10 +33,10 @@
void GenerateGuid ( guid_t *p_guid )
{
p_guid->v1 = 0xbabac001;
vlc_rand_bytes(&p_guid->v2, sizeof(p_guid->v2));
vlc_rand_bytes(&p_guid->v3, sizeof(p_guid->v3));
vlc_rand_bytes(p_guid->v4, sizeof(p_guid->v4));
p_guid->Data1 = 0xbabac001;
vlc_rand_bytes(&p_guid->Data2, sizeof(p_guid->Data2));
vlc_rand_bytes(&p_guid->Data3, sizeof(p_guid->Data3));
vlc_rand_bytes(p_guid->Data4, sizeof(p_guid->Data4));
}
void asf_HeaderParse ( asf_header_t *hdr,
......
......@@ -213,12 +213,12 @@ void var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid )
{
int i;
p_guid->v1 = var_buffer_get32( p_buf );
p_guid->v2 = var_buffer_get16( p_buf );
p_guid->v3 = var_buffer_get16( p_buf );
p_guid->Data1 = var_buffer_get32( p_buf );
p_guid->Data2 = var_buffer_get16( p_buf );
p_guid->Data3 = var_buffer_get16( p_buf );
for( i = 0; i < 8; i++ )
{
p_guid->v4[i] = var_buffer_get8( p_buf );
p_guid->Data4[i] = var_buffer_get8( p_buf );
}
}
......@@ -28,19 +28,19 @@
*****************************************************************************/
typedef struct guid_s
{
uint32_t v1; /* le */
uint16_t v2; /* le */
uint16_t v3; /* le */
uint8_t v4[8];
uint32_t Data1; /* le */
uint16_t Data2; /* le */
uint16_t Data3; /* le */
uint8_t Data4[8];
} guid_t;
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).v1, \
(guid).v2, \
(guid).v3, \
(guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3], \
(guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
(guid).Data1, \
(guid).Data2, \
(guid).Data3, \
(guid).Data4[0],(guid).Data4[1],(guid).Data4[2],(guid).Data4[3], \
(guid).Data4[4],(guid).Data4[5],(guid).Data4[6],(guid).Data4[7]
enum
{
......@@ -226,18 +226,18 @@ static const guid_t asf_guid_audio_conceal_spread =
****************************************************************************/
static inline void ASF_GetGUID( guid_t *p_guid, const uint8_t *p_data )
{
p_guid->v1 = GetDWLE( p_data );
p_guid->v2 = GetWLE( p_data + 4);
p_guid->v3 = GetWLE( p_data + 6);
memcpy( p_guid->v4, p_data + 8, 8 );
p_guid->Data1 = GetDWLE( p_data );
p_guid->Data2 = GetWLE( p_data + 4);
p_guid->Data3 = GetWLE( p_data + 6);
memcpy( p_guid->Data4, p_data + 8, 8 );
}
static inline bool CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 )
{
if( (p_guid1->v1 != p_guid2->v1 )||
(p_guid1->v2 != p_guid2->v2 )||
(p_guid1->v3 != p_guid2->v3 )||
( memcmp( p_guid1->v4, p_guid2->v4, 8 )) )
if( (p_guid1->Data1 != p_guid2->Data1 )||
(p_guid1->Data2 != p_guid2->Data2 )||
(p_guid1->Data3 != p_guid2->Data3 )||
( memcmp( p_guid1->Data4, p_guid2->Data4, 8 )) )
{
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment