All Questions
8 questions
3
votes
2
answers
78
views
Simplify 2D point angle comparator
I have a comparison function for comparing two points in 2 (or more) dimensions based on the angle of each point in standard polar coordinates. In other words, a point ...
6
votes
2
answers
656
views
Error Code Stack Trace and Propagation Library in C
I've been programming in Go and I enjoy how easy it is to create descriptive errors and propagate them up the call stack. I wanted that sort of ease and consistency in C so I created a small error ...
2
votes
1
answer
445
views
Supplying parameterless callback to function expecting void * param
I have to register different callback functions to a scheduler. The callback signature defines a void * parameter. Some callbacks don't use a parameter. This works, ...
4
votes
1
answer
2k
views
3
votes
1
answer
2k
views
Callback C++ Class method from C
I am trying to callback C++ class methods from C. Now I have got something working, but am not sure if this is the best solution.
I am looking for feedback, as to if there is something wrong with this ...
5
votes
1
answer
101
views
Function to foreach over an array
I made a very simple generic function to foreach over an array in C using a callback function:
...
11
votes
1
answer
2k
views
Callback in Linux kernel driver in order to hide device's low-level protocol
I'm am writing a Linux kernel driver for HD44780 LCDs connected via I2C bus. In my last change I tried to decouple low-level code (which talks to the device via I2C) from device's logic (printing ...
3
votes
1
answer
3k
views
Basic socket library in C
I am trying to learn C and have written a very basic socket library. I would be interested in any general design and coding comments.
Note that at this stage I am not bothered about implementing the ...