-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uvc libconfig import export support #61
Conversation
The Clang Static Analyzer (version 11) found three additional faults in the code after these commits. Please fix the code and adjust the pull request.
|
1483a4f
to
bfc19b5
Compare
I addressed the open issues and hope this is fine to merged now. Thanks. |
I addressed the open issues and hope this is fine to merged now. Thanks. |
I'm assuming you have tested the code changes on the appropriate
hardware and software combinations. I cannot test it right now, the
unit tests fail on master and there are no UVC unit tests yet, so the
code changes do need manual testing by yourself.
With -Wall -Wextra I am seeing some new GCC 10 warnings. The integer
signedness issues are similar to existing code so they can maybe be
deferred to a different pull request. The other issues probably need at
least looking at if not fixing.
In file included from function/uvc.c:15:
../include/usbg/function/uvc.h: In function ‘usbg_f_uvc_cleanup_attrs’:
../include/usbg/function/uvc.h:121:70: warning: unused parameter ‘attrs’ [-Wunused-parameter]
121 | static inline void usbg_f_uvc_cleanup_attrs(struct usbg_f_uvc_attrs *attrs)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
function/uvc.c: In function ‘init_frames’:
function/uvc.c:172:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
172 | if (ret >= sizeof(fpath)) {
| ^~
function/uvc.c: In function ‘usbg_f_uvc_get_frame_attr_val’:
function/uvc.c:263:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
263 | if (ret >= sizeof(fpath))
| ^~
function/uvc.c: In function ‘usbg_f_uvc_set_frame_attr_val’:
function/uvc.c:279:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
279 | if (ret >= sizeof(fpath))
| ^~
function/uvc.c: In function ‘usbg_f_uvc_get_format_attr_val’:
function/uvc.c:333:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
333 | if (ret >= sizeof(fpath))
| ^~
function/uvc.c: In function ‘usbg_f_uvc_set_format_attr_val’:
function/uvc.c:349:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
349 | if (ret >= sizeof(fpath))
| ^~
function/uvc.c: In function ‘usbg_f_uvc_get_nframes’:
function/uvc.c:505:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
505 | for (frames, i = 0; i < MAX_FRAMES; ++i)
| ^
function/uvc.c:500:40: warning: unused parameter ‘uvcf’ [-Wunused-parameter]
500 | int usbg_f_uvc_get_nframes(usbg_f_uvc *uvcf, const bool *frames)
| ~~~~~~~~~~~~^~~~
function/uvc.c: In function ‘usbg_f_uvc_create_frame’:
function/uvc.c:525:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
525 | if (ret >= sizeof(frame_path))
| ^~
function/uvc.c: In function ‘uvc_libconfig_import’:
function/uvc.c:678:11: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
678 | if (nmb >= sizeof(fp))
| ^~
…--
bye,
pabs
https://bonedaddy.net/pabs3/
--
bye,
pabs
https://bonedaddy.net/pabs3/
|
Yes the code is tested on x86_64 with qemu and on several arm machines. What do you mean with the unit tests fail on master? Did you only refer to the GCC10 warnings ?
I fixed the errors from -Wall and -Wextra, including one extra cleanup patch. |
On Tue, 2021-10-26 at 00:49 -0700, Michael Grzeschik wrote:
What do you mean with the unit tests fail on master?
I meant that on the git master branch after enabling the tests and
running them, there is a failure. Looks like it was caused by some of
the recent commits from another PR before yours. I'll look at it.
…--
bye,
pabs
https://bonedaddy.net/pabs3/
|
I fixed the issue with the tests.
Please rebase and then merge the UVC patchset.
…--
bye,
pabs
https://bonedaddy.net/pabs3/
|
Signed-off-by: Michael Grzeschik <[email protected]>
tested with -Wall, -Wextra Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
- tested with -Wall, -Wextra Signed-off-by: Michael Grzeschik <[email protected]>
bfc19b5
to
53231c7
Compare
Thanks! Done |
FYI, the patch fixing the warnings might be incorrect.
The snprintf function returns an int not unsigned.
…--
bye,
pabs
https://bonedaddy.net/pabs3/
|
No description provided.