diff options
| author | Devin J. Pohly <djpohly@gmail.com> | 2020-04-21 14:26:04 -0500 | 
|---|---|---|
| committer | Devin J. Pohly <djpohly@gmail.com> | 2020-04-21 17:45:44 -0500 | 
| commit | bf58f7c0d2e6eeced073e83a6a9c5be9bbbeb4e0 (patch) | |
| tree | 7a29e60b8c4902ce0c5d3867e6c496a65726f481 /dwl.c | |
| parent | 46ff18413fb0a18236b7cc5591348c116f73e4da (diff) | |
use expressions in sizeof instead of type names
Diffstat (limited to 'dwl.c')
| -rw-r--r-- | dwl.c | 9 | 
1 files changed, 3 insertions, 6 deletions
| @@ -204,8 +204,7 @@ buttonpress(struct wl_listener *listener, void *data)  void  createkeyboard(struct wlr_input_device *device)  { -	struct dwl_keyboard *keyboard = -		calloc(1, sizeof(struct dwl_keyboard)); +	struct dwl_keyboard *keyboard = calloc(1, sizeof(*keyboard));  	keyboard->device = device;  	/* We need to prepare an XKB keymap and assign it to the keyboard. This @@ -242,8 +241,7 @@ createnotify(struct wl_listener *listener, void *data)  	}  	/* Allocate a dwl_view for this surface */ -	struct dwl_view *view = -		calloc(1, sizeof(struct dwl_view)); +	struct dwl_view *view = calloc(1, sizeof(*view));  	view->xdg_surface = xdg_surface;  	/* Listen to the various events it can emit */ @@ -280,8 +278,7 @@ createoutput(struct wl_listener *listener, void *data)  	}  	/* Allocates and configures our state for this output */ -	struct dwl_output *output = -		calloc(1, sizeof(struct dwl_output)); +	struct dwl_output *output = calloc(1, sizeof(*output));  	output->wlr_output = wlr_output;  	/* Sets up a listener for the frame notify event. */  	output->frame.notify = renderoutput; | 
