BitField: Make trivially copyable and remove assignment operator

This commit is contained in:
MerryMage 2016-02-11 17:41:15 +00:00
parent f1d1049c4f
commit 6c71858c5c
12 changed files with 56 additions and 60 deletions

View file

@ -35,7 +35,7 @@ SharedPtr<Process> Process::Create(SharedPtr<CodeSet> code_set) {
process->codeset = std::move(code_set);
process->flags.raw = 0;
process->flags.memory_region = MemoryRegion::APPLICATION;
process->flags.memory_region.Assign(MemoryRegion::APPLICATION);
Memory::InitLegacyAddressSpace(process->vm_manager);
return process;

View file

@ -193,10 +193,10 @@ union ResultCode {
explicit ResultCode(u32 raw) : raw(raw) {}
ResultCode(ErrorDescription description_, ErrorModule module_,
ErrorSummary summary_, ErrorLevel level_) : raw(0) {
description = description_;
module = module_;
summary = summary_;
level = level_;
description.Assign(description_);
module.Assign(module_);
summary.Assign(summary_);
level.Assign(level_);
}
ResultCode& operator=(const ResultCode& o) { raw = o.raw; return *this; }

View file

@ -293,8 +293,8 @@ ResultCode DeleteConfigNANDSaveFile() {
ResultCode UpdateConfigNANDSavegame() {
FileSys::Mode mode = {};
mode.write_flag = 1;
mode.create_flag = 1;
mode.write_flag.Assign(1);
mode.create_flag.Assign(1);
FileSys::Path path("config");
@ -405,7 +405,7 @@ void Init() {
FileSys::Path config_path("config");
FileSys::Mode open_mode = {};
open_mode.read_flag = 1;
open_mode.read_flag.Assign(1);
auto config_result = Service::FS::OpenFileFromArchive(*archive_result, config_path, open_mode);

View file

@ -347,7 +347,7 @@ void SignalInterrupt(InterruptId interrupt_id) {
FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id);
if (info->is_dirty) {
SetBufferSwap(screen_id, info->framebuffer_info[info->index]);
info->is_dirty = false;
info->is_dirty.Assign(false);
}
}
}
@ -499,7 +499,7 @@ static void SetLcdForceBlack(Service::Interface* self) {
// Since data is already zeroed, there is no need to explicitly set
// the color to black (all zero).
data.is_enabled = enable_black;
data.is_enabled.Assign(enable_black);
LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_top), data.raw); // Top LCD
LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_bottom), data.raw); // Bottom LCD
@ -521,7 +521,7 @@ static void TriggerCmdReqQueue(Service::Interface* self) {
ExecuteCommand(command_buffer->commands[i], thread_id);
// Indicates that command has completed
command_buffer->number_commands = command_buffer->number_commands - 1;
command_buffer->number_commands.Assign(command_buffer->number_commands - 1);
}
}

View file

@ -105,7 +105,7 @@ void Update() {
bool pressed = false;
std::tie(touch_entry->x, touch_entry->y, pressed) = VideoCore::g_emu_window->GetTouchState();
touch_entry->valid = pressed ? 1 : 0;
touch_entry->valid.Assign(pressed ? 1 : 0);
// TODO(bunnei): We're not doing anything with offset 0xA8 + 0x18 of HID SharedMemory, which
// supposedly is "Touch-screen entry, which contains the raw coordinate data prior to being

View file

@ -110,8 +110,8 @@ void Init() {
FileSys::Path gamecoin_path("gamecoin.dat");
FileSys::Mode open_mode = {};
open_mode.write_flag = 1;
open_mode.create_flag = 1;
open_mode.write_flag.Assign(1);
open_mode.create_flag.Assign(1);
// Open the file and write the default gamecoin information
auto gamecoin_result = Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode);
if (gamecoin_result.Succeeded()) {

View file

@ -178,17 +178,17 @@ struct CTRPollFD {
static Events TranslateTo3DS(u32 input_event) {
Events ev = {};
if (input_event & POLLIN)
ev.pollin = 1;
ev.pollin.Assign(1);
if (input_event & POLLPRI)
ev.pollpri = 1;
ev.pollpri.Assign(1);
if (input_event & POLLHUP)
ev.pollhup = 1;
ev.pollhup.Assign(1);
if (input_event & POLLERR)
ev.pollerr = 1;
ev.pollerr.Assign(1);
if (input_event & POLLOUT)
ev.pollout = 1;
ev.pollout.Assign(1);
if (input_event & POLLNVAL)
ev.pollnval = 1;
ev.pollnval.Assign(1);
return ev;
}

View file

@ -146,8 +146,8 @@ inline void Write(u32 addr, const T data) {
// Reset "trigger" flag and set the "finish" flag
// NOTE: This was confirmed to happen on hardware even if "address_start" is zero.
config.trigger = 0;
config.finished = 1;
config.trigger.Assign(0);
config.finished.Assign(1);
}
break;
}
@ -444,16 +444,16 @@ void Init() {
framebuffer_sub.address_left1 = 0x1848F000;
framebuffer_sub.address_left2 = 0x184C7800;
framebuffer_top.width = 240;
framebuffer_top.height = 400;
framebuffer_top.width.Assign(240);
framebuffer_top.height.Assign(400);
framebuffer_top.stride = 3 * 240;
framebuffer_top.color_format = Regs::PixelFormat::RGB8;
framebuffer_top.color_format.Assign(Regs::PixelFormat::RGB8);
framebuffer_top.active_fb = 0;
framebuffer_sub.width = 240;
framebuffer_sub.height = 320;
framebuffer_sub.width.Assign(240);
framebuffer_sub.height.Assign(320);
framebuffer_sub.stride = 3 * 240;
framebuffer_sub.color_format = Regs::PixelFormat::RGB8;
framebuffer_sub.color_format.Assign(Regs::PixelFormat::RGB8);
framebuffer_sub.active_fb = 0;
last_skip_frame = false;