diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-06-13 10:57:26 +0000 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2023-06-18 15:08:16 +0300 |
commit | d0e346773a03ccedf93ca8c87f13e7240c04772a (patch) | |
tree | 0b1441bd0a23c0f4c6aed331ada5147dc90866a5 /sys-block/cec/files | |
parent | app-forensics/yara: add missing pkgconfig bdep (diff) | |
download | gentoo-d0e346773a03ccedf93ca8c87f13e7240c04772a.tar.gz gentoo-d0e346773a03ccedf93ca8c87f13e7240c04772a.tar.bz2 gentoo-d0e346773a03ccedf93ca8c87f13e7240c04772a.zip |
sys-block/cec: Fix type specifier missing, defaults to int
And some other misc. fixes
Closes: https://bugs.gentoo.org/898560
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31411
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'sys-block/cec/files')
-rw-r--r-- | sys-block/cec/files/cec-14-including-select.h-and-time.h.patch | 107 | ||||
-rw-r--r-- | sys-block/cec/files/cec-14-using-unsigned-int-instead-of-uint.patch | 33 |
2 files changed, 140 insertions, 0 deletions
diff --git a/sys-block/cec/files/cec-14-including-select.h-and-time.h.patch b/sys-block/cec/files/cec-14-including-select.h-and-time.h.patch new file mode 100644 index 000000000000..818579610eff --- /dev/null +++ b/sys-block/cec/files/cec-14-including-select.h-and-time.h.patch @@ -0,0 +1,107 @@ +From b8e4f29db4b46614e7f21515ba439eab3c0698b1 Mon Sep 17 00:00:00 2001 +From: Brahmajit Das <brahmajit.xyz@gmail.com> +Date: Tue, 13 Jun 2023 10:43:46 +0000 +Subject: [PATCH 2/2] cec.c: Including select.h and time.h + +According to POSIX.1-2001 sys/select.h should be included for usage of +identifier fd_set + +For using structure timeval sys/time.h is needed. + +Without the aforementioned includes, I'm getting the following error: +cec.c:311:3: warning: switch condition has boolean value [-Wswitch-bool] + switch (sh == tab) { + ^ ~~~~~~~~~ +cec.c:515:2: error: use of undeclared identifier 'fd_set' + fd_set rfds; + ^ +cec.c:521:23: error: variable has incomplete type 'struct timeval' + struct timeval *tvp, timout; + ^ +cec.c:521:9: note: forward declaration of 'struct timeval' + struct timeval *tvp, timout; + ^ +cec.c:527:3: error: call to undeclared function 'FD_ZERO'; ISO C99 and later do not + support implicit function declarations [-Wimplicit-function-declaration] + FD_ZERO(&rfds); + ^ +cec.c:527:12: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + FD_ZERO(&rfds); + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here +int ffs (int); + ^ +cec.c:528:3: error: call to undeclared function 'FD_SET'; ISO C99 and later do not + support implicit function declarations [-Wimplicit-function-declaration] + FD_SET(fd, &rfds); + ^ +cec.c:528:15: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + FD_SET(fd, &rfds); + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here +int ffs (int); + ^ +cec.c:530:15: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + FD_SET(0, &rfds); + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here +int ffs (int); + ^ +cec.c:533:7: error: incomplete definition of type 'struct timeval' + tvp->tv_sec = 1; + ~~~^ +cec.c:521:9: note: forward declaration of 'struct timeval' + struct timeval *tvp, timout; + ^ +cec.c:534:7: error: incomplete definition of type 'struct timeval' + tvp->tv_usec = 0; + ~~~^ +cec.c:521:9: note: forward declaration of 'struct timeval' + struct timeval *tvp, timout; + ^ +cec.c:537:7: error: call to undeclared function 'select'; ISO C99 and later do not + support implicit function declarations [-Wimplicit-function-declaration] + n = select(fd+1, &rfds, nil, nil, tvp); + ^ +cec.c:537:21: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + n = select(fd+1, &rfds, nil, nil, tvp); + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here +int ffs (int); + ^ +cec.c:550:7: error: call to undeclared function 'FD_ISSET'; ISO C99 and later do not + support implicit function declarations [-Wimplicit-function-declaration] + if (FD_ISSET(0, &rfds)) { + ^ +cec.c:550:20: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + if (FD_ISSET(0, &rfds)) { + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here +int ffs (int); + ^ +cec.c:576:28: error: use of undeclared identifier 'rfds'; did you mean 'ffs'? + } else if (FD_ISSET(fd, &rfds)) { + ^~~~ + ffs +/usr/include/strings.h:25:5: note: 'ffs' declared here + +Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> +--- a/cec.c ++++ b/cec.c +@@ -9,6 +9,8 @@ + #include <string.h> + #include <signal.h> + #include <sys/errno.h> ++#include <sys/select.h> ++#include <sys/time.h> + #include <arpa/inet.h> + #include <ctype.h> + #include "cec.h" +-- +2.41.0 + diff --git a/sys-block/cec/files/cec-14-using-unsigned-int-instead-of-uint.patch b/sys-block/cec/files/cec-14-using-unsigned-int-instead-of-uint.patch new file mode 100644 index 000000000000..1bc417a2dcbe --- /dev/null +++ b/sys-block/cec/files/cec-14-using-unsigned-int-instead-of-uint.patch @@ -0,0 +1,33 @@ +From 53cba8765ece2fddaea58405649d00df8041823b Mon Sep 17 00:00:00 2001 +From: Brahmajit Das <brahmajit.xyz@gmail.com> +Date: Tue, 13 Jun 2023 10:39:04 +0000 +Subject: [PATCH 1/2] cec.h utils.c: using unsigned int instead of uint + +Since uint ins't a standard type, using unsigned int in its place. + +Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> +--- a/cec.h ++++ b/cec.h +@@ -22,7 +22,7 @@ void exits(char *); + + enum { FQUOTE = (1<<0), FEMPTY = (1<<1) }; + int getfields(char *, char **, int, char *, int); +-char *htoa(char *, char *, uint); ++char *htoa(char *, char *, unsigned int); + int parseether(char *, char *); + + #define tokenize(A, B, C) getfields((A), (B), (C), " \t\r\n", FQUOTE) +--- a/utils.c ++++ b/utils.c +@@ -57,7 +57,7 @@ dump(char *ap, int len) + } + + char * +-htoa(char *to, char *frm, uint len) ++htoa(char *to, char *frm, unsigned int len) + { + char *cp = to; + uchar ch; +-- +2.41.0 + |