LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wolfgang

redefined callback declarations for safer programming

Status: New

Hello,

 

I am wondering if it would be useful to redefine the CVI callbacks using the const type qualifier to remind users that the parameters are read only, a strategy I use for all of my own function declarations as an extra safety measure.

 

E.g., instead of the current situation

 

int CVICALLBACK PanelResponse (int handle, int event, void *callbackdata, int eventdata1, int eventdata2)

 

have it declared as

 

int CVICALLBACK PanelResponse (const int handle, const int event, const void *callbackdata, const int eventdata1, const int eventdata2)