Hacker News new | ask | show | jobs
by asveikau 3969 days ago

    StreamState stream[4];
    // many lines follow
    memset(stream, 0, 4 * sizeof(StreamState));
It bugs the hell out of me to see array bounds and type names repeated like this. Why not this?

    memset(&stream, 0, sizeof(stream));
Some other nitpicks:

* typedefs ending in _t are reserved by POSIX, though a lot of people ignore this.

* Have you thought of breaking into multiple source files? One benefit is when linking statically you won't pull in the whole thing for just one function. Might read better too, there is a lot going on in that one source file.

1 comments

And many C Standard types have a _t suffix. It really shouldn't be used.

There are multiple source files.

> There are multiple source files

Ah you are right, I guess I was looking only at public api wrappers and missed the "internal" dir. I might add that as further commentary that people might gloss over a dir called "internal" and miss the bulk of the library. :P