diff --git a/gtk2_ardour/waves_dropdown.cc b/gtk2_ardour/waves_dropdown.cc index 031d460bd8..2702dd9103 100644 --- a/gtk2_ardour/waves_dropdown.cc +++ b/gtk2_ardour/waves_dropdown.cc @@ -44,7 +44,7 @@ void* WavesDropdown::get_item_associated_data(int item_number) { Gtk::Menu_Helpers::MenuList& items = _menu.items (); - if (item_number >= items.size() ) { + if (item_number >= items.size()) { return NULL; } @@ -58,7 +58,7 @@ Gtk::MenuItem* WavesDropdown::get_item (int item_number) { Gtk::Menu_Helpers::MenuList& items = _menu.items (); - if (item_number >= items.size() ) { + if (item_number >= items.size()) { return NULL; } diff --git a/gtk2_ardour/waves_dropdown.h b/gtk2_ardour/waves_dropdown.h index a482a3b81f..f7040c4766 100644 --- a/gtk2_ardour/waves_dropdown.h +++ b/gtk2_ardour/waves_dropdown.h @@ -36,7 +36,9 @@ class WavesDropdown : public WavesIconButton int get_current_item () { return _current_item_number; } void set_current_item (int current_item_number); - void* get_item_associated_data (int); + void* get_item_associated_data (size_t); + int get_item_data_i (size_t item) { return (char*)get_item_associated_data(item) - (char*)0; } + unsigned int get_item_data_u (size_t item) { return (char*)get_item_associated_data(item) - (char*)0; } Gtk::MenuItem* get_item (int); Gtk::MenuItem* get_item (const std::string&); @@ -46,7 +48,7 @@ class WavesDropdown : public WavesIconButton void set_maxmenuheight (int maxmenuheight) { _maxmenuheight = ((maxmenuheight < 0) ? -1 : maxmenuheight); } int get_maxmenuheight () const { return _maxmenuheight; } - sigc::signal2 selected_item_changed; + sigc::signal2 selected_item_changed; private: static char* menu_item_data_key; diff --git a/gtk2_ardour/waves_export_filename_selector.cc b/gtk2_ardour/waves_export_filename_selector.cc index 8d107b4f56..818168267d 100644 --- a/gtk2_ardour/waves_export_filename_selector.cc +++ b/gtk2_ardour/waves_export_filename_selector.cc @@ -209,7 +209,7 @@ WavesExportFilenameSelector::change_date_format (WavesDropdown*, int item) return; } - filename->set_date_format ((DateFormat)((char*)_date_format_dropdown.get_item_associated_data(item) - (char*)0)); + filename->set_date_format ((DateFormat)_date_format_dropdown.get_item_data_u(item)); CriticalSelectionChanged(); } @@ -220,7 +220,7 @@ WavesExportFilenameSelector::change_time_format (WavesDropdown*, int item) return; } - filename->set_time_format ((TimeFormat)((char*)_time_format_dropdown.get_item_associated_data(item) - (char*)0)); + filename->set_time_format ((TimeFormat)_time_format_dropdown.get_item_data_u(item)); CriticalSelectionChanged(); } diff --git a/gtk2_ardour/waves_export_format_selector.cc b/gtk2_ardour/waves_export_format_selector.cc index 34923a5db4..1d84a35b57 100644 --- a/gtk2_ardour/waves_export_format_selector.cc +++ b/gtk2_ardour/waves_export_format_selector.cc @@ -198,7 +198,7 @@ void WavesExportFormatSelector::on_format_dropdown (WavesDropdown*, int item) { if (_state && _state->format) { - ExportFormatId export_format_id = ExportFormatId((char*)_format_dropdown.get_item_associated_data(item) - (char*)0); + ExportFormatId export_format_id = ExportFormatId(_format_dropdown.get_item_data_u(item)); switch (export_format_id) { case AIFF: _state->format->set_format_id (ARDOUR::ExportFormatBase::F_AIFF); @@ -223,7 +223,7 @@ void WavesExportFormatSelector::on_depth_dropdown (WavesDropdown*, int item) { if (_state && _state->format) { - int depth = int((char*)_depth_dropdown.get_item_associated_data(item) - (char*)0); + unsigned int depth = _depth_dropdown.get_item_data_u(item); switch (depth) { case 24: @@ -243,7 +243,7 @@ void WavesExportFormatSelector::on_sample_rate_dropdown (WavesDropdown*, int item) { if (_state && _state->format) { - int sample_rate = int((char*)_sample_rate_dropdown.get_item_associated_data(item) - (char*)0); + unsigned int sample_rate = _sample_rate_dropdown.get_item_data_u(item); switch (sample_rate) { case 44100: @@ -275,7 +275,7 @@ void WavesExportFormatSelector::on_dithering_dropdown (WavesDropdown*, int item) { if (_state && _state->format) { - ExportDitheringId export_format_id = ExportDitheringId((char*)_dithering_dropdown.get_item_associated_data(item) - (char*)0); + ExportDitheringId export_format_id = ExportDitheringId(_dithering_dropdown.get_item_data_u(item)); switch (export_format_id) { case Shaped: _state->format->set_dither_type (ARDOUR::ExportFormatBase::D_Shaped);