davidgiven / ack

The Amsterdam Compiler Kit
http://tack.sf.net
Other
416 stars 59 forks source link

More warning fixes. #267

Closed davidgiven closed 1 year ago

tkchia commented 1 year ago

Hello @davidgiven,

I think this can be solved more elegantly by simply saying

struct smap;

somewhere before the first prototype, which will make the struct smap type defined at the top level. Thank you!

davidgiven commented 1 year ago

Uh. Yeah. Why didn't I think of that?

The data collection stuff is all terrible, anyway. nothings' type-safe storage macros are a much better alternative and I should rip it all out and replace it. https://github.com/nothings/stb/blob/master/stb_ds.h

davidgiven commented 1 year ago

Ah, no, that doesn't work. The issue is that SMAPOF() defines an anonymous structure which is then implicitly cast into a pointer to struct smap. The reason for changing things to void* was to get implicit casting without warnings. I'm not really sure why I did it like that; it's a terrible idea...