Il 28/09/2012 05:00, Wenchao Xia ha scritto:
>>
>>
>> uint64_t qblock_get_virt_size(QBlockFmtInfo *fmt);
>> QBlockProtInfo *qblock_get_backing_loc(QBlockFmtInfo *fmt);
>> bool qblock_get_encrypt(QBlockFmtInfo *fmt);
>>
>> etc. that include the switch statement.
>>
>   I think it is reasonable use generic accessors instead of embbed
> structure, maybe an additional helper function should be added as:
> 
> QBlockStaticInfoAddr *qblock_get_static_info_addr(QBlockStaticInfo
>  *info)
> 
>   In this way only one switch statement is needed in source code,
> and only one new API is added.

No problem for the implementation, but please make this function static.

Paolo

Reply via email to