From: Uwe Hermann Date: Wed, 25 Mar 2015 22:38:04 +0000 (+0100) Subject: Make std_baudrates[] static (only used in one file). X-Git-Tag: libserialport-0.1.1~77 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6c6aebe78c91e92895c425decf1f4f5e3ce0ec53;p=libserialport.git Make std_baudrates[] static (only used in one file). --- diff --git a/libserialport_internal.h b/libserialport_internal.h index d5ce008..5510824 100644 --- a/libserialport_internal.h +++ b/libserialport_internal.h @@ -160,10 +160,7 @@ struct std_baudrate { int value; }; -extern const struct std_baudrate std_baudrates[]; - #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) -#define NUM_STD_BAUDRATES ARRAY_SIZE(std_baudrates) extern void (*sp_debug_handler)(const char *format, ...); diff --git a/serialport.c b/serialport.c index cf384c1..ae108ae 100644 --- a/serialport.c +++ b/serialport.c @@ -24,7 +24,7 @@ #include "libserialport.h" #include "libserialport_internal.h" -const struct std_baudrate std_baudrates[] = { +static const struct std_baudrate std_baudrates[] = { #ifdef _WIN32 /* * The baudrates 50/75/134/150/200/1800/230400/460800 do not seem to @@ -44,6 +44,8 @@ const struct std_baudrate std_baudrates[] = { #endif }; +#define NUM_STD_BAUDRATES ARRAY_SIZE(std_baudrates) + void (*sp_debug_handler)(const char *format, ...) = sp_default_debug_handler; static enum sp_return get_config(struct sp_port *port, struct port_data *data,