Changed menu_file_create::m_ok to be a reference instead of a pointer

This commit is contained in:
Nathan Woods 2016-07-05 21:16:19 -04:00
parent aed7acbe66
commit a95f190523
4 changed files with 8 additions and 8 deletions

View File

@ -162,15 +162,15 @@ static int is_valid_filename_char(unicode_char unichar)
// ctor
//-------------------------------------------------
menu_file_create::menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool *ok)
menu_file_create::menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool &ok)
: menu(mui, container)
, m_current_directory(current_directory)
, m_current_file(current_file)
, m_current_format(nullptr)
, m_ok(ok)
{
m_image = image;
m_ok = ok;
*m_ok = true;
m_ok = true;
auto const sep = current_file.rfind(PATH_SEPARATOR);
m_filename.reserve(1024);
@ -276,7 +276,7 @@ void menu_file_create::handle()
}
break;
case IPT_UI_CANCEL:
*m_ok = false;
m_ok = false;
break;
}
}

View File

@ -38,7 +38,7 @@ private:
class menu_file_create : public menu
{
public:
menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool *ok);
menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool &ok);
virtual ~menu_file_create() override;
virtual void populate() override;
virtual void handle() override;
@ -52,7 +52,7 @@ private:
std::string m_filename;
protected:
bool * m_ok;
bool & m_ok;
};
// ======================> menu_select_format

View File

@ -157,7 +157,7 @@ void menu_control_floppy_image::handle()
break;
case menu_select_rw::result::WRITE_OTHER:
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, &create_ok);
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, create_ok);
state = CHECK_CREATE;
break;

View File

@ -278,7 +278,7 @@ void menu_control_device_image::handle()
break;
case menu_file_selector::result::CREATE:
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, &create_ok);
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, create_ok);
state = CHECK_CREATE;
break;