libv4l2cpp
libv4l2cpp copied to clipboard
don't use memset() for initialization in C++
more details https://stackoverflow.com/questions/1998752/memset-or-value-initialization-to-zero-out-a-struct
Hi,
The buffer structure is a POD, there is no virtual.
Best Regards, Michel.
Hi,
The buffer structure is a POD, there is no virtual.
Best Regards, Michel.
- POD means Plain old data? Yes, I agree. But why you use memset ()? You can. But it is bad C++ style. Isn't it? ={} is universal must have for data initiation in C++.
- What about caps?
@mpromonet please approve commit!
Hi @AndreiCherniaev Thanks, but your modifications doesnot bring improvement. Best Regards Michel
my commit brings C++ style to avoid potential bugs with memory. Don't use memset() if you can make another way... memset() in top of the most dangerous functions...