mirror of
https://github.com/curl/curl.git
synced 2026-07-30 16:18:02 +03:00
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:
parent
edd013326d
commit
784a8ec2c1
36 changed files with 86 additions and 131 deletions
|
|
@ -31,13 +31,6 @@
|
|||
|
||||
#include "memdebug.h" /* keep this as LAST include */
|
||||
|
||||
/* OUR_MAX_SEEK_L has 'long' data type, OUR_MAX_SEEK_O has 'curl_off_t,
|
||||
both represent the same value. Maximum offset used here when we lseek
|
||||
using a 'long' data type offset */
|
||||
|
||||
#define OUR_MAX_SEEK_L 2147483647L - 1L
|
||||
#define OUR_MAX_SEEK_O CURL_OFF_T_C(0x7FFFFFFF) - CURL_OFF_T_C(0x1)
|
||||
|
||||
/*
|
||||
** callback for CURLOPT_SEEKFUNCTION
|
||||
**
|
||||
|
|
@ -51,6 +44,13 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
|
|||
|
||||
#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES)
|
||||
|
||||
/* OUR_MAX_SEEK_L has 'long' data type, OUR_MAX_SEEK_O has 'curl_off_t,
|
||||
both represent the same value. Maximum offset used here when we lseek
|
||||
using a 'long' data type offset */
|
||||
|
||||
#define OUR_MAX_SEEK_L 2147483647L - 1L
|
||||
#define OUR_MAX_SEEK_O CURL_OFF_T_C(0x7FFFFFFF) - CURL_OFF_T_C(0x1)
|
||||
|
||||
/* The offset check following here is only interesting if curl_off_t is
|
||||
larger than off_t and we are not using the Win32 large file support
|
||||
macros that provide the support to do 64-bit seeks correctly */
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@
|
|||
#ifdef _WIN32
|
||||
# undef PATH_MAX
|
||||
# define PATH_MAX MAX_PATH
|
||||
|
||||
# define _use_lfn(f) (1) /* long filenames always available */
|
||||
#elif !defined(__DJGPP__) || (__DJGPP__ < 2) /* DJGPP 2.0 has _use_lfn() */
|
||||
# define _use_lfn(f) (0) /* long filenames never available */
|
||||
#elif defined(__DJGPP__)
|
||||
|
|
@ -215,7 +213,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name,
|
|||
return SANITIZE_ERR_OK;
|
||||
}
|
||||
|
||||
#if defined(MSDOS)
|
||||
#ifdef MSDOS
|
||||
/*
|
||||
Test if truncating a path to a file will leave at least a single character in
|
||||
the filename. Filenames suffixed by an alternate data stream cannot be
|
||||
|
|
|
|||
|
|
@ -185,12 +185,12 @@ static const struct NameValue setopt_nv_CURLNONZERODEFAULTS[] = {
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
#define DECL0(s) ADD((&easysrc_decl, s))
|
||||
/* #define DECL0(s) ADD((&easysrc_decl, s)) */
|
||||
#define DECL1(f,a) ADDF((&easysrc_decl, f,a))
|
||||
|
||||
#define DATA0(s) ADD((&easysrc_data, s))
|
||||
/* #define DATA0(s) ADD((&easysrc_data, s)) */
|
||||
#define DATA1(f,a) ADDF((&easysrc_data, f,a))
|
||||
#define DATA2(f,a,b) ADDF((&easysrc_data, f,a,b))
|
||||
/* #define DATA2(f,a,b) ADDF((&easysrc_data, f,a,b)) */
|
||||
#define DATA3(f,a,b,c) ADDF((&easysrc_data, f,a,b,c))
|
||||
|
||||
#define CODE0(s) ADD((&easysrc_code, s))
|
||||
|
|
@ -198,11 +198,11 @@ static const struct NameValue setopt_nv_CURLNONZERODEFAULTS[] = {
|
|||
#define CODE2(f,a,b) ADDF((&easysrc_code, f,a,b))
|
||||
#define CODE3(f,a,b,c) ADDF((&easysrc_code, f,a,b,c))
|
||||
|
||||
#define CLEAN0(s) ADD((&easysrc_clean, s))
|
||||
/* #define CLEAN0(s) ADD((&easysrc_clean, s)) */
|
||||
#define CLEAN1(f,a) ADDF((&easysrc_clean, f,a))
|
||||
|
||||
#define REM0(s) ADD((&easysrc_toohard, s))
|
||||
#define REM1(f,a) ADDF((&easysrc_toohard, f,a))
|
||||
/* #define REM0(s) ADD((&easysrc_toohard, s)) */
|
||||
/* #define REM1(f,a) ADDF((&easysrc_toohard, f,a)) */
|
||||
#define REM3(f,a,b,c) ADDF((&easysrc_toohard, f,a,b,c))
|
||||
|
||||
/* Escape string to C string syntax. Return NULL if out of memory.
|
||||
|
|
@ -715,6 +715,4 @@ nomem:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#else /* CURL_DISABLE_LIBCURL_OPTION */
|
||||
|
||||
#endif /* CURL_DISABLE_LIBCURL_OPTION */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue