mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-03 16:39:01 -06:00 
			
		
		
		
	BitField: Make trivially copyable and remove assignment operator
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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; }
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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()) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user