mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	wlr_{box, fbox}_equal: Handle NULL
This commit is contained in:
		
							parent
							
								
									d7bebb0a4c
								
							
						
					
					
						commit
						acaf57dcca
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -175,11 +175,19 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
 | 
				
			||||||
#ifdef WLR_USE_UNSTABLE
 | 
					#ifdef WLR_USE_UNSTABLE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
 | 
					bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
 | 
				
			||||||
 | 
						if (a == NULL || b == NULL) {
 | 
				
			||||||
 | 
							return a == b;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return a->x == b->x && a->y == b->y &&
 | 
						return a->x == b->x && a->y == b->y &&
 | 
				
			||||||
		a->width == b->width && a->height == b->height;
 | 
							a->width == b->width && a->height == b->height;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wlr_fbox_equal(const struct wlr_fbox *a, const struct wlr_fbox *b) {
 | 
					bool wlr_fbox_equal(const struct wlr_fbox *a, const struct wlr_fbox *b) {
 | 
				
			||||||
 | 
						if (a == NULL || b == NULL) {
 | 
				
			||||||
 | 
							return a == b;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return a->x == b->x && a->y == b->y &&
 | 
						return a->x == b->x && a->y == b->y &&
 | 
				
			||||||
		a->width == b->width && a->height == b->height;
 | 
							a->width == b->width && a->height == b->height;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue