remove unnecessary NULL checks and add void for an empty parameter list
				
					
				
			This commit is contained in:
		
				
					committed by
					
						 Hiltjo Posthuma
						Hiltjo Posthuma
					
				
			
			
				
	
			
			
			
						parent
						
							08006e0d00
						
					
				
				
					commit
					882d54c225
				
			
							
								
								
									
										30
									
								
								sent.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								sent.c
									
									
									
									
									
								
							| @ -99,12 +99,12 @@ static void load(FILE *fp); | |||||||
| static void advance(const Arg *arg); | static void advance(const Arg *arg); | ||||||
| static void quit(const Arg *arg); | static void quit(const Arg *arg); | ||||||
| static void resize(int width, int height); | static void resize(int width, int height); | ||||||
| static void run(); | static void run(void); | ||||||
| static void usage(); | static void usage(void); | ||||||
| static void xdraw(); | static void xdraw(void); | ||||||
| static void xhints(); | static void xhints(void); | ||||||
| static void xinit(); | static void xinit(void); | ||||||
| static void xloadfonts(); | static void xloadfonts(void); | ||||||
|  |  | ||||||
| static void bpress(XEvent *); | static void bpress(XEvent *); | ||||||
| static void cmessage(XEvent *); | static void cmessage(XEvent *); | ||||||
| @ -216,8 +216,7 @@ ffload(Slide *s) | |||||||
| 	s->img->bufwidth = ntohl(*(uint32_t *)&hdr[8]); | 	s->img->bufwidth = ntohl(*(uint32_t *)&hdr[8]); | ||||||
| 	s->img->bufheight = ntohl(*(uint32_t *)&hdr[12]); | 	s->img->bufheight = ntohl(*(uint32_t *)&hdr[12]); | ||||||
|  |  | ||||||
| 	if (s->img->buf) | 	free(s->img->buf); | ||||||
| 		free(s->img->buf); |  | ||||||
| 	/* internally the image is stored in 888 format */ | 	/* internally the image is stored in 888 format */ | ||||||
| 	s->img->buf = ecalloc(s->img->bufwidth * s->img->bufheight, strlen("888")); | 	s->img->buf = ecalloc(s->img->bufwidth * s->img->bufheight, strlen("888")); | ||||||
|  |  | ||||||
| @ -499,7 +498,7 @@ resize(int width, int height) | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| run() | run(void) | ||||||
| { | { | ||||||
| 	XEvent ev; | 	XEvent ev; | ||||||
|  |  | ||||||
| @ -521,7 +520,7 @@ run() | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| xdraw() | xdraw(void) | ||||||
| { | { | ||||||
| 	unsigned int height, width, i; | 	unsigned int height, width, i; | ||||||
| 	Image *im = slides[idx].img; | 	Image *im = slides[idx].img; | ||||||
| @ -549,7 +548,7 @@ xdraw() | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| xhints() | xhints(void) | ||||||
| { | { | ||||||
| 	XClassHint class = {.res_name = "sent", .res_class = "presenter"}; | 	XClassHint class = {.res_name = "sent", .res_class = "presenter"}; | ||||||
| 	XWMHints wm = {.flags = InputHint, .input = True}; | 	XWMHints wm = {.flags = InputHint, .input = True}; | ||||||
| @ -567,7 +566,7 @@ xhints() | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| xinit() | xinit(void) | ||||||
| { | { | ||||||
| 	XTextProperty prop; | 	XTextProperty prop; | ||||||
| 	unsigned int i; | 	unsigned int i; | ||||||
| @ -611,7 +610,7 @@ xinit() | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| xloadfonts() | xloadfonts(void) | ||||||
| { | { | ||||||
| 	int i, j; | 	int i, j; | ||||||
| 	char *fstrs[LEN(fontfallbacks)]; | 	char *fstrs[LEN(fontfallbacks)]; | ||||||
| @ -630,8 +629,7 @@ xloadfonts() | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	for (j = 0; j < LEN(fontfallbacks); j++) | 	for (j = 0; j < LEN(fontfallbacks); j++) | ||||||
| 		if (fstrs[j]) | 		free(fstrs[j]); | ||||||
| 			free(fstrs[j]); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| @ -680,7 +678,7 @@ configure(XEvent *e) | |||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| usage() | usage(void) | ||||||
| { | { | ||||||
| 	die("usage: %s [file]", argv0); | 	die("usage: %s [file]", argv0); | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user