mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	transaction_apply: use float for quotient
Pre-dividing 1000/60 would lose 2/3 due to round-up Found through static analysis
This commit is contained in:
		
							parent
							
								
									c78ab67877
								
							
						
					
					
						commit
						df494a7e51
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -186,8 +186,8 @@ static void transaction_apply(struct sway_transaction *transaction) {
 | 
				
			||||||
			(now.tv_nsec - commit->tv_nsec) / 1000000.0;
 | 
								(now.tv_nsec - commit->tv_nsec) / 1000000.0;
 | 
				
			||||||
		float ms_total = ms_arranging + ms_waiting;
 | 
							float ms_total = ms_arranging + ms_waiting;
 | 
				
			||||||
		wlr_log(L_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, "
 | 
							wlr_log(L_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, "
 | 
				
			||||||
				"%.1fms total (%.1f frames if 60Hz)", transaction,
 | 
								"%.1fms total (%.1f frames if 60Hz)", transaction,
 | 
				
			||||||
				ms_arranging, ms_waiting, ms_total, ms_total / (1000 / 60));
 | 
								ms_arranging, ms_waiting, ms_total, ms_total / (1000.0f / 60));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Apply the instruction state to the container's current state
 | 
						// Apply the instruction state to the container's current state
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue