Reputation: 413
struct pointsto_val_def
{
unsigned int lhs;
bitmap rhs;
struct pointsto_val_def *next;
};
typedef struct pointsto_val_def *pointsto_val;
typedef pointsto_val *pointsto_val_hash;
Can the last two statements be simply replaced by this one statement?
typedef struct pointsto_val_def *pointsto_val_hash
Thanks in advance. Cheers.
Upvotes: 0
Views: 196
Reputation: 836
I think the answer is no.Because the type of pointsto_val_hash is struct pointsto_val_def**
, that means pointsto_val_hash is a pointer which is pointed to struct pointsto_val_def*
.And your replacement means a pointer which is pointed to struct pointsto_val_def
, they are not the same.
Upvotes: 1
Reputation: 84151
You can replace it with one typedef
if you don't need the _val
type, but with a double-pointer:
typedef struct pointsto_val_def** pointsto_val_hash;
Upvotes: 0