UBC-ECE-Sasha / PIM-Embedding-Lookup

6 stars 5 forks source link

Unnecessary malloc casts #7

Open johnramsden opened 3 years ago

johnramsden commented 3 years ago

malloc (and realloc) return void pointers and do not require casts.

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L61

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L68

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L81

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L84

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L97

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L163

nzarif commented 3 years ago

Are they unnecessary? I think I was getting type errors (not sure) and that was why I added these.

johnramsden commented 3 years ago

Yes, they should be unnecessary.

nzarif commented 3 years ago

Ok, I will remove them and see what happens.