From 6c6aebe78c91e92895c425decf1f4f5e3ce0ec53 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 25 Mar 2015 23:38:04 +0100 Subject: [PATCH] Make std_baudrates[] static (only used in one file). --- libserialport_internal.h | 3 --- serialport.c | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) 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,