Вопрос

In this function: omapi_wait_for_completion

omapi_object_t *inner;

if (object) {
       waiter = (omapi_waiter_object_t *)0;
       ....

0 is being cated to an omapi_waiter_object_t pointer. What is the purpose?

I know a similar question exists: Casting NULL to a struct pointer in C?, but the answer is about validity using macro. In my case, no macro involves. I want to know why it is cast that way.

Это было полезно?

Решение

Sometimes, people just write useless code.

There is no sense in actually writing the cast here.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top