mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	hid: Get rid of undefined behavior
Modifying a variable twice across a sequence point.
This commit is contained in:
		
							parent
							
								
									ad883db7a9
								
							
						
					
					
						commit
						a3cad6c332
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -58,7 +58,7 @@ void Update() {
 | 
			
		|||
 | 
			
		||||
    mem->pad.current_state.hex = state.hex;
 | 
			
		||||
    mem->pad.index = next_pad_index;
 | 
			
		||||
    ++next_touch_index %= mem->pad.entries.size();
 | 
			
		||||
    next_touch_index = (next_touch_index + 1) % mem->pad.entries.size();
 | 
			
		||||
 | 
			
		||||
    // Get the previous Pad state
 | 
			
		||||
    u32 last_entry_index = (mem->pad.index - 1) % mem->pad.entries.size();
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ void Update() {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    mem->touch.index = next_touch_index;
 | 
			
		||||
    ++next_touch_index %= mem->touch.entries.size();
 | 
			
		||||
    next_touch_index = (next_touch_index + 1) % mem->touch.entries.size();
 | 
			
		||||
 | 
			
		||||
    // Get the current touch entry
 | 
			
		||||
    TouchDataEntry* touch_entry = &mem->touch.entries[mem->touch.index];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue