[beast: 2/5] ALL: adjust for Aida::EnumValue being passed by value
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 2/5] ALL: adjust for Aida::EnumValue being passed by value
- Date: Fri, 20 Nov 2015 22:07:50 +0000 (UTC)
commit 4ed767866239838114dae06683b4a23bdef5b10d
Author: Tim Janik <timj gnu org>
Date: Fri Nov 13 00:17:23 2015 +0100
ALL: adjust for Aida::EnumValue being passed by value
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstapp.cc | 2 +-
beast-gtk/bstbseutils.cc | 4 ++--
beast-gtk/bstusermessage.cc | 10 +++++-----
bse/bseenums.cc | 4 ++--
bse/bsemidievent.cc | 4 ++--
sfi/sfiparams.cc | 16 ++++++++--------
sfi/sfiparams.hh | 4 ++--
7 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 5d49572..064b744 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -1072,7 +1072,7 @@ app_action_exec (gpointer data,
"are currently looking at a prominent warning or error message, there's
no "
"real merit to it."),
BST_MSG_TEXT3 ("Demo-Dialog-Type: %s",
- Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value
(demo_type)->ident));
+ Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value
(demo_type).ident));
break;
default:
assert_unreached ();
diff --git a/beast-gtk/bstbseutils.cc b/beast-gtk/bstbseutils.cc
index 7beba63..331b578 100644
--- a/beast-gtk/bstbseutils.cc
+++ b/beast-gtk/bstbseutils.cc
@@ -90,8 +90,8 @@ namespace Bse {
const char*
error_blurb (Bse::ErrorType error_value)
{
- const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::ErrorType>().find_value (error_value);
- return ev ? ev->blurb : NULL;
+ const Rapicorn::Aida::EnumValue ev = Rapicorn::Aida::enum_info<Bse::ErrorType>().find_value (error_value);
+ return ev.blurb;
}
} // Bse
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index dedad3c..77ad6b8 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -15,9 +15,9 @@ static GSList *msg_windows = NULL;
const char*
bst_msg_type_ident (BstMsgType bmt)
{
- const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value (bmt);
- if (ev && ev->ident)
- return ev->ident;
+ const Rapicorn::Aida::EnumValue ev = Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value (bmt);
+ if (ev.ident)
+ return ev.ident;
switch (bmt)
{
case BST_MSG_SCRIPT: return "script";
@@ -761,8 +761,8 @@ server_user_message (const Bse::UserMessage &umsg)
msg.details = umsg.text3.c_str();
Bse::String cfg = Bse::string_format (_("Show messages about %s"), umsg.label.c_str());
msg.config_check = cfg.c_str();
- const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value
(umsg.type);
- msg.ident = ev ? ev->ident : NULL;
+ const Rapicorn::Aida::EnumValue ev = Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value
(umsg.type);
+ msg.ident = ev.ident;
msg.label = NULL;
msg.janitor = 0;
msg.process = 0;
diff --git a/bse/bseenums.cc b/bse/bseenums.cc
index 1da9832..0f7bd16 100644
--- a/bse/bseenums.cc
+++ b/bse/bseenums.cc
@@ -41,8 +41,8 @@ bse_type_register_enums (void)
const char*
bse_error_blurb (Bse::ErrorType error_value)
{
- const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::ErrorType>().find_value (error_value);
- return ev ? ev->blurb : NULL;
+ const Rapicorn::Aida::EnumValue ev = Rapicorn::Aida::enum_info<Bse::ErrorType>().find_value (error_value);
+ return ev.blurb;
}
Bse::ErrorType
diff --git a/bse/bsemidievent.cc b/bse/bsemidievent.cc
index ed2ec93..185708d 100644
--- a/bse/bsemidievent.cc
+++ b/bse/bsemidievent.cc
@@ -50,8 +50,8 @@ bse_midi_signal_default (Bse::MidiSignalType type)
const char*
bse_midi_signal_name (Bse::MidiSignalType signal)
{
- const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::MidiSignalType>().find_value (signal);
- return ev ? ev->blurb : NULL;
+ const Rapicorn::Aida::EnumValue ev = Rapicorn::Aida::enum_info<Bse::MidiSignalType>().find_value (signal);
+ return ev.blurb;
}
diff --git a/sfi/sfiparams.cc b/sfi/sfiparams.cc
index e7c0ff1..859ba09 100644
--- a/sfi/sfiparams.cc
+++ b/sfi/sfiparams.cc
@@ -1733,19 +1733,19 @@ namespace Bse { // bsecore
static std::map<String, SfiChoiceValues> aida_enum_choice_map;
SfiChoiceValues
-choice_values_from_enum_values (const String &enumname, size_t n, const ::Rapicorn::Aida::EnumValue *values)
+choice_values_from_enum_values (const String &enumname, const ::Rapicorn::Aida::EnumValueVector &evvec)
{
SfiChoiceValues &cv = aida_enum_choice_map[enumname];
- if (!cv.values && values)
+ if (!cv.values && !evvec.empty())
{
- SfiChoiceValue *vv = new SfiChoiceValue[n];
- for (size_t i = 0; i < n; i++)
+ SfiChoiceValue *vv = new SfiChoiceValue[evvec.size()];
+ for (size_t i = 0; i < evvec.size(); i++)
{
- vv[i].choice_ident = values[i].ident;
- vv[i].choice_label = values[i].label;
- vv[i].choice_blurb = values[i].blurb;
+ vv[i].choice_ident = evvec[i].ident;
+ vv[i].choice_label = evvec[i].label;
+ vv[i].choice_blurb = evvec[i].blurb;
}
- cv.n_values = n;
+ cv.n_values = evvec.size();
cv.values = vv;
}
return cv;
diff --git a/sfi/sfiparams.hh b/sfi/sfiparams.hh
index e946ca8..896acc5 100644
--- a/sfi/sfiparams.hh
+++ b/sfi/sfiparams.hh
@@ -321,12 +321,12 @@ G_END_DECLS
namespace Bse { // bsecore
-SfiChoiceValues choice_values_from_enum_values (const String &enumname, size_t n, const
::Rapicorn::Aida::EnumValue *values);
+SfiChoiceValues choice_values_from_enum_values (const String &enumname, const
::Rapicorn::Aida::EnumValueVector &evvec);
template<class EnumType> SfiChoiceValues
choice_values_from_enum ()
{
::Rapicorn::Aida::EnumInfo einfo = ::Rapicorn::Aida::enum_info<EnumType>();
- return choice_values_from_enum_values (einfo.name(), einfo.n_values(), einfo.values());
+ return choice_values_from_enum_values (einfo.name(), einfo.value_vector());
}
} // Bse
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]