diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-12-04 19:16:43 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-12-04 19:38:30 +0900 |
commit | fdcd72088371b3d8dfd31f2a5159861ce0be5535 (patch) | |
tree | 06c160cc34157344f62b6c19af297858a0e57157 /debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c | |
parent | a5d7db3b2c6171ea9e76b84155d2dfb66c243e5a (diff) | |
download | extra-dependencies-fdcd72088371b3d8dfd31f2a5159861ce0be5535.tar.gz extra-dependencies-fdcd72088371b3d8dfd31f2a5159861ce0be5535.zip |
uncrustify-trinity: updated based on upstream version 0.76.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c b/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c new file mode 100644 index 00000000..4f85044a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/tests/input/c/bugs-3.c @@ -0,0 +1,48 @@ + +#ifdef CRUD +#define JUNK a +#endif + +#ifdef __QNX__ +/** + * Does all that QNX trickery to get the MAC address of the interface + * + * @param if_name The interface name: ie "en0" or "eth0" + * @param mac Pointer to a 6-byte array + * @return SUCCESS or FAILURE + */ +static INT32 socket_get_mac_qnx(const CHAR *if_name, UINT8 *mac) +{ + CHAR ionet_name[50]; + INT32 en_fd; +#if QNX_RELEASE >= 630 + nic_config_t nic; + INT32 dcmd = DCMD_IO_NET_GET_CONFIG; +#else + Nic_t nic; + INT32 dcmd = DCMD_IO_NET_NICINFO; +#endif + INT32 ret_val = FAILURE; + + memset(mac, 0, 6); + + /* Build the full name */ + snprintf(ionet_name, sizeof(ionet_name), "/dev/io-net/%s", if_name); + + /* Open the device */ + en_fd = open(ionet_name, O_RDWR); + if (en_fd >= 0) + { + /* Get the interface info */ + if (devctl(en_fd, dcmd, &nic, sizeof(nic), NULL) == EOK) + { + memcpy(mac, nic.current_address, 6); + ret_val = SUCCESS; + } + + close(en_fd); + } + return(ret_val); +} +#endif + |