From f3e8a6bc6b57c15e47de6cc8640764e439594cbd Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Tue, 12 May 2020 13:20:54 +0200 Subject: [PATCH] metadata: Make JACK_METADATA_* constant to ensure that it is not modified by any client. const have internal linkage unless marked by extern Change-Id: Ife1def2feb43aead32164f479e39ee3fd71b2ba0 Signed-off-by: Adam Miartus Signed-off-by: Timo Wischer --- common/JackEngine.cpp | 4 ++-- common/JackMetadata.cpp | 20 ++++++++++---------- common/jack/metadata.h | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 6bbccb81..7de36261 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -34,8 +34,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackChannel.h" #include "JackError.h" -extern const char* JACK_METADATA_HARDWARE; -extern const char* JACK_METADATA_PRETTY_NAME; +extern const char JACK_METADATA_HARDWARE[]; +extern const char JACK_METADATA_PRETTY_NAME[]; namespace Jack { diff --git a/common/JackMetadata.cpp b/common/JackMetadata.cpp index d4cff50a..4b485d1b 100644 --- a/common/JackMetadata.cpp +++ b/common/JackMetadata.cpp @@ -28,16 +28,16 @@ #define JACK_METADATA_PREFIX "http://jackaudio.org/metadata/" -LIB_EXPORT const char* JACK_METADATA_CONNECTED = JACK_METADATA_PREFIX "connected"; -LIB_EXPORT const char* JACK_METADATA_EVENT_TYPES = JACK_METADATA_PREFIX "event-types"; -LIB_EXPORT const char* JACK_METADATA_HARDWARE = JACK_METADATA_PREFIX "hardware"; -LIB_EXPORT const char* JACK_METADATA_ICON_LARGE = JACK_METADATA_PREFIX "icon-large"; -LIB_EXPORT const char* JACK_METADATA_ICON_NAME = JACK_METADATA_PREFIX "icon-name"; -LIB_EXPORT const char* JACK_METADATA_ICON_SMALL = JACK_METADATA_PREFIX "icon-small"; -LIB_EXPORT const char* JACK_METADATA_ORDER = JACK_METADATA_PREFIX "order"; -LIB_EXPORT const char* JACK_METADATA_PORT_GROUP = JACK_METADATA_PREFIX "port-group"; -LIB_EXPORT const char* JACK_METADATA_PRETTY_NAME = JACK_METADATA_PREFIX "pretty-name"; -LIB_EXPORT const char* JACK_METADATA_SIGNAL_TYPE = JACK_METADATA_PREFIX "signal-type"; +LIB_EXPORT extern const char JACK_METADATA_CONNECTED[] = JACK_METADATA_PREFIX "connected"; +LIB_EXPORT extern const char JACK_METADATA_EVENT_TYPES[] = JACK_METADATA_PREFIX "event-types"; +LIB_EXPORT extern const char JACK_METADATA_HARDWARE[] = JACK_METADATA_PREFIX "hardware"; +LIB_EXPORT extern const char JACK_METADATA_ICON_LARGE[] = JACK_METADATA_PREFIX "icon-large"; +LIB_EXPORT extern const char JACK_METADATA_ICON_NAME[] = JACK_METADATA_PREFIX "icon-name"; +LIB_EXPORT extern const char JACK_METADATA_ICON_SMALL[] = JACK_METADATA_PREFIX "icon-small"; +LIB_EXPORT extern const char JACK_METADATA_ORDER[] = JACK_METADATA_PREFIX "order"; +LIB_EXPORT extern const char JACK_METADATA_PORT_GROUP[] = JACK_METADATA_PREFIX "port-group"; +LIB_EXPORT extern const char JACK_METADATA_PRETTY_NAME[] = JACK_METADATA_PREFIX "pretty-name"; +LIB_EXPORT extern const char JACK_METADATA_SIGNAL_TYPE[] = JACK_METADATA_PREFIX "signal-type"; #undef JACK_METADATA_PREFIX namespace Jack diff --git a/common/jack/metadata.h b/common/jack/metadata.h index 891dbd62..7f18c38e 100644 --- a/common/jack/metadata.h +++ b/common/jack/metadata.h @@ -229,7 +229,7 @@ int jack_set_property_change_callback (jack_client_t* client, * A value that identifies what the hardware port is connected to (an external * device of some kind). Possible values might be "E-Piano" or "Master 2 Track". */ -extern const char* JACK_METADATA_CONNECTED; +extern const char JACK_METADATA_CONNECTED[]; /** * The supported event types of an event port. @@ -242,21 +242,21 @@ extern const char* JACK_METADATA_CONNECTED; * status byte will gracefully ignore OSC messages if the user makes an * inappropriate connection. */ -extern const char* JACK_METADATA_EVENT_TYPES; +extern const char JACK_METADATA_EVENT_TYPES[]; /** * A value that should be shown when attempting to identify the * specific hardware outputs of a client. Typical values might be * "ADAT1", "S/PDIF L" or "MADI 43". */ -extern const char* JACK_METADATA_HARDWARE; +extern const char JACK_METADATA_HARDWARE[]; /** * A value with a MIME type of "image/png;base64" that is an encoding of an * NxN (with 32 < N <= 128) image to be used when displaying a visual * representation of that client or port. */ -extern const char* JACK_METADATA_ICON_LARGE; +extern const char JACK_METADATA_ICON_LARGE[]; /** * The name of the icon for the subject (typically client). @@ -267,14 +267,14 @@ extern const char* JACK_METADATA_ICON_LARGE; * Theme Specification: * https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html */ -extern const char* JACK_METADATA_ICON_NAME; +extern const char JACK_METADATA_ICON_NAME[]; /** * A value with a MIME type of "image/png;base64" that is an encoding of an * NxN (with N <=32) image to be used when displaying a visual representation * of that client or port. */ -extern const char* JACK_METADATA_ICON_SMALL; +extern const char JACK_METADATA_ICON_SMALL[]; /** * Order for a port. @@ -287,18 +287,18 @@ extern const char* JACK_METADATA_ICON_SMALL; * * It is encouraged to use http://www.w3.org/2001/XMLSchema#int as the type. */ -extern const char* JACK_METADATA_ORDER; +extern const char JACK_METADATA_ORDER[]; /** * A value that should be shown to the user when displaying a port to the user, * unless the user has explicitly overridden that a request to show the port * name, or some other key value. */ -extern const char* JACK_METADATA_PRETTY_NAME; +extern const char JACK_METADATA_PRETTY_NAME[]; /** */ -extern const char* JACK_METADATA_PORT_GROUP; +extern const char JACK_METADATA_PORT_GROUP[]; /** * The type of an audio signal. @@ -309,7 +309,7 @@ extern const char* JACK_METADATA_PORT_GROUP; * their output directly to speakers. In particular, CV ports are not * necessarily periodic at all and may have very high DC. */ -extern const char* JACK_METADATA_SIGNAL_TYPE; +extern const char JACK_METADATA_SIGNAL_TYPE[]; /** * @}