Hi All,
I have the application which will be support 32 bits and 64 bits
and below are the statement to handle 32bits/64bits data
and new_node->data
is void * new_node->data
for ( index = 0 ; index < items ;index++ ) {
if (data_size == SIZE_32 ) {
* ( ((int32_t*)(new_node->data)) + index) = (int32_t) index*2 ;
* ( ((int32_t*)(new_node-> data)) + index) = (int32_t) index*3
}
else {
* ( ((int64_t*)(new_node-> data)) + index) = (int64_t) index*4;
* ( ((int64_t*)(new_node-> data)) + index) = (int64_t) index*5;
}
}
Is there any better to handle this without the if/else statement (if ((data_size == SIZE_32 ) {
Thanks
J