redefine many vars as "static"

See patch #10156
This commit is contained in:
Florian La Roche 2021-12-07 02:57:02 +01:00 committed by Simon Goldschmidt
parent 5ab46f82f9
commit 62ac0faad8
7 changed files with 28 additions and 28 deletions

View File

@ -160,7 +160,7 @@ static struct stats_proto* shell_stat_proto_stats[] = {
&lwip_stats.tcp, &lwip_stats.tcp,
#endif #endif
}; };
const size_t num_protostats = sizeof(shell_stat_proto_stats)/sizeof(struct stats_proto*); static const size_t num_protostats = sizeof(shell_stat_proto_stats)/sizeof(struct stats_proto*);
static const char *stat_msgs_proto[] = { static const char *stat_msgs_proto[] = {
" * transmitted ", " * transmitted ",

View File

@ -31,7 +31,7 @@
#define SOCKET_EXAMPLES_RUN_PARALLEL 0 #define SOCKET_EXAMPLES_RUN_PARALLEL 0
#endif #endif
const u8_t cmpbuf[8] = {0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab}; static const u8_t cmpbuf[8] = {0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab};
/* a helper struct to ensure memory before/after fd_set is not touched */ /* a helper struct to ensure memory before/after fd_set is not touched */
typedef struct _xx typedef struct _xx

View File

@ -93,7 +93,7 @@ static void netconn_drain(struct netconn *conn);
#endif /* LWIP_TCPIP_CORE_LOCKING */ #endif /* LWIP_TCPIP_CORE_LOCKING */
#if LWIP_NETCONN_FULLDUPLEX #if LWIP_NETCONN_FULLDUPLEX
const u8_t netconn_deleted = 0; static const u8_t netconn_deleted = 0;
int int
lwip_netconn_is_deallocated_msg(void *msg) lwip_netconn_is_deallocated_msg(void *msg)
@ -106,9 +106,9 @@ lwip_netconn_is_deallocated_msg(void *msg)
#endif /* LWIP_NETCONN_FULLDUPLEX */ #endif /* LWIP_NETCONN_FULLDUPLEX */
#if LWIP_TCP #if LWIP_TCP
const u8_t netconn_aborted = 0; static const u8_t netconn_aborted = 0;
const u8_t netconn_reset = 0; static const u8_t netconn_reset = 0;
const u8_t netconn_closed = 0; static const u8_t netconn_closed = 0;
/** Translate an error to a unique void* passed via an mbox */ /** Translate an error to a unique void* passed via an mbox */
static void * static void *

View File

@ -108,8 +108,8 @@ static int deflate_level; /* default compression level, can be changed via comma
#include "../core/def.c" #include "../core/def.c"
/** (Your server name here) */ /** (Your server name here) */
const char *serverID = "Server: "HTTPD_SERVER_AGENT"\r\n"; static const char *serverID = "Server: "HTTPD_SERVER_AGENT"\r\n";
char serverIDBuffer[1024]; static char serverIDBuffer[1024];
/* change this to suit your MEM_ALIGNMENT */ /* change this to suit your MEM_ALIGNMENT */
#define PAYLOAD_ALIGNMENT 4 #define PAYLOAD_ALIGNMENT 4
@ -144,26 +144,26 @@ static int file_can_be_compressed(const char* filename);
/* 5 bytes per char + 3 bytes per line */ /* 5 bytes per char + 3 bytes per line */
static char file_buffer_c[COPY_BUFSIZE * 5 + ((COPY_BUFSIZE / HEX_BYTES_PER_LINE) * 3)]; static char file_buffer_c[COPY_BUFSIZE * 5 + ((COPY_BUFSIZE / HEX_BYTES_PER_LINE) * 3)];
char curSubdir[MAX_PATH_LEN-3]; static char curSubdir[MAX_PATH_LEN-3];
char lastFileVar[MAX_PATH_LEN]; static char lastFileVar[MAX_PATH_LEN];
char hdr_buf[4096]; static char hdr_buf[4096];
unsigned char processSubs = 1; static unsigned char processSubs = 1;
unsigned char includeHttpHeader = 1; static unsigned char includeHttpHeader = 1;
unsigned char useHttp11 = 0; static unsigned char useHttp11 = 0;
unsigned char supportSsi = 1; static unsigned char supportSsi = 1;
unsigned char precalcChksum = 0; static unsigned char precalcChksum = 0;
unsigned char includeLastModified = 0; static unsigned char includeLastModified = 0;
#if MAKEFS_SUPPORT_DEFLATE #if MAKEFS_SUPPORT_DEFLATE
unsigned char deflateNonSsiFiles = 0; static unsigned char deflateNonSsiFiles = 0;
size_t deflatedBytesReduced = 0; static size_t deflatedBytesReduced = 0;
size_t overallDataBytes = 0; static size_t overallDataBytes = 0;
#endif #endif
const char *exclude_list = NULL; static const char *exclude_list = NULL;
const char *ncompress_list = NULL; static const char *ncompress_list = NULL;
struct file_entry *first_file = NULL; static struct file_entry *first_file = NULL;
struct file_entry *last_file = NULL; static struct file_entry *last_file = NULL;
static char *ssi_file_buffer; static char *ssi_file_buffer;
static char **ssi_file_lines; static char **ssi_file_lines;

View File

@ -160,11 +160,11 @@ enum dhcp_option_idx {
/** Holds the decoded option values, only valid while in dhcp_recv. /** Holds the decoded option values, only valid while in dhcp_recv.
@todo: move this into struct dhcp? */ @todo: move this into struct dhcp? */
u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX]; static u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX];
/** Holds a flag which option was received and is contained in dhcp_rx_options_val, /** Holds a flag which option was received and is contained in dhcp_rx_options_val,
only valid while in dhcp_recv. only valid while in dhcp_recv.
@todo: move this into struct dhcp? */ @todo: move this into struct dhcp? */
u8_t dhcp_rx_options_given[DHCP_OPTION_IDX_MAX]; static u8_t dhcp_rx_options_given[DHCP_OPTION_IDX_MAX];
static u8_t dhcp_discover_request_options[] = { static u8_t dhcp_discover_request_options[] = {
DHCP_OPTION_SUBNET_MASK, DHCP_OPTION_SUBNET_MASK,

View File

@ -96,7 +96,7 @@ u32_t reachable_time = LWIP_ND6_REACHABLE_TIME;
u32_t retrans_timer = LWIP_ND6_RETRANS_TIMER; /* @todo implement this value in timer */ u32_t retrans_timer = LWIP_ND6_RETRANS_TIMER; /* @todo implement this value in timer */
#if LWIP_ND6_QUEUEING #if LWIP_ND6_QUEUEING
u8_t nd6_queue_size = 0; static u8_t nd6_queue_size = 0;
#endif #endif
/* Index for cache entries. */ /* Index for cache entries. */

View File

@ -120,7 +120,7 @@ typedef struct bridgeif_private_s {
} bridgeif_private_t; } bridgeif_private_t;
/* netif data index to get the bridge on input */ /* netif data index to get the bridge on input */
u8_t bridgeif_netif_client_id = 0xff; static u8_t bridgeif_netif_client_id = 0xff;
/** /**
* @ingroup bridgeif * @ingroup bridgeif