tidy-up: delete, comment or scope C macros reported unused

To reduce the number `-Wunused-macro` compiler warnings:
- delete unused macros.
- comment out unused macro that are part of a set.
- move macros into the scope they are used.

This may be useful to enable by default, but there are tricky cases that
I didn't manage to fix and paused the effort. E.g. internal features
checks in `openssl.c`. There is more, once those are fixed.

Closes #16279
This commit is contained in:
Viktor Szakats 2025-02-09 18:12:14 +01:00
parent edd013326d
commit 784a8ec2c1
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
36 changed files with 86 additions and 131 deletions

View file

@ -65,12 +65,6 @@
#ifdef USE_WINSOCK
#undef EINTR
#define EINTR 4 /* errno.h value */
#undef EAGAIN
#define EAGAIN 11 /* errno.h value */
#undef ENOMEM
#define ENOMEM 12 /* errno.h value */
#undef EINVAL
#define EINVAL 22 /* errno.h value */
#endif
#define DEFAULT_PORT 1883 /* MQTT default port */
@ -86,15 +80,11 @@
#define MQTT_MSG_CONNECT 0x10
#define MQTT_MSG_CONNACK 0x20
#define MQTT_MSG_PUBLISH 0x30
#define MQTT_MSG_PUBACK 0x40
/* #define MQTT_MSG_PUBACK 0x40 */
#define MQTT_MSG_SUBSCRIBE 0x82
#define MQTT_MSG_SUBACK 0x90
#define MQTT_MSG_DISCONNECT 0xe0
#define MQTT_CONNACK_LEN 4
#define MQTT_SUBACK_LEN 5
#define MQTT_CLIENTID_LEN 12 /* "curl0123abcd" */
struct configurable {
unsigned char version; /* initial version byte in the request must match
this */

View file

@ -68,7 +68,6 @@ static const char *ipv_inuse = "IPv4";
static int serverlogslocked = 0;
#define REQBUFSIZ 150000
#define REQBUFSIZ_TXT "149999"
static long prevtestno = -1; /* previous test number we served */
static long prevpartno = -1; /* previous part number we served */

View file

@ -86,12 +86,6 @@
#ifdef USE_WINSOCK
#undef EINTR
#define EINTR 4 /* errno.h value */
#undef EAGAIN
#define EAGAIN 11 /* errno.h value */
#undef ENOMEM
#define ENOMEM 12 /* errno.h value */
#undef EINVAL
#define EINVAL 22 /* errno.h value */
#endif
#define DEFAULT_PORT 8905