Mehul Choube wrote:
> Hi,
> 
> self->d4 = ((GUID_t *)this->sptr)->Data4[0];
> 
> works but
> 
> self->d4 = ((GUID_t *)this->sptr)->Data4;
> 
> doesn't with following error:
> 
> dtrace: failed to compile script nums.d: line 20: operator = may not be 
> applied to operand of type "unsigned char [8]"

Since it's an internal array, you should be able to cast it to "unsigned
char *".  Or, if you really want to keep broken out values instead of a
structure (why?), you could individually address each byte.

It might be helpful to have something like:

        #define DATA4(d4)       (((uint64_t)(d4)[0]<<56) \
                                 ((uint64_t)(d4)[1]<<48) \
                                 ((uint64_t)(d4)[2]<<40) \
                                 ((uint64_t)(d4)[3]<<32) \
                                 ((uint64_t)(d4)[4]<<24) \
                                 ((uint64_t)(d4)[5]<<16) \
                                 ((uint64_t)(d4)[6]<<8) \
                                 ((uint64_t)(d4)[7]))

so you can treat that last one as an integral quantity.

-- 
James Carlson         42.703N 71.076W         <carls...@workingcode.com>
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to