News for hackers. Stuff that matters.
Re:Getting Past C by lacampbell on Tuesday January 03, 2017 @10:46PM (#13315513)
Yeah 10 minutes is quite a bit off, at least for me. The various issues and bugs that arose all came about when developing the data structures themselves - they didn't crop up in actual usage. Though my approach was to use a separate header and source file for each new data type I parameterised them by. So I had an "int_array.c" and an "int_array.h". And inside the header would just be function declarations generated by the macro. I basically didn't like the idea of dumping in a whole implementation of a data structure and all its operations with a macro every single time I wanted to use it. YMMV but I found it worked well.
Re:Getting Past C by dbaupp on Tuesday January 03, 2017 @11:11PM (#13315622)
That approach of a single invocation was what I would personally assume would be done (or put it in the header that defines the data type, for a custom one), but I'm not sure how that solves spaces?
Re:Getting Past C by civility on Wednesday January 04, 2017 @12:00AM (#13315801)
No more spaces:

    typedef unsigned char uchar;
    DECLARE_AND_IMPLEMENT_ARRAY_API(uchar)