-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
At the moment the ctx parameter in fstReader... and fstWriter... functions has the type void *, which effectively disables all type checking on that parameter. I had at least one instance during the refactoring of GTKWave's loaders where I accidentally mixed up something and the compiler wasn't able to detect the error because of the use of a void pointer.
I would suggest to use opaque pointers instead. fstapi.h would be changed to something like:
typedef struct fstWriterContext fstWriterContext;
typedef struct fstReaderContext fstReaderContext;
void fstWriterClose(fstWriterContext *ctx);
...This allows the compiler to check that a fstWriterContext or fstReaderContext is passed without allowing external access to the fields inside the struct, because the full struct is only defined in fstapi.c.
@tbybell: I would like your feedback on this.
Metadata
Metadata
Assignees
Labels
No labels