remove unused dc/gc variables
This commit is contained in:
		
							
								
								
									
										27
									
								
								sent.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								sent.c
									
									
									
									
									
								
							| @ -59,13 +59,6 @@ typedef struct { | |||||||
| 	int uw, uh; /* usable dimensions for drawing text and images */ | 	int uw, uh; /* usable dimensions for drawing text and images */ | ||||||
| } XWindow; | } XWindow; | ||||||
|  |  | ||||||
| /* Drawing Context linked list*/ |  | ||||||
| struct DC{ |  | ||||||
| 	XFontStruct *font; |  | ||||||
| 	GC gc; |  | ||||||
| 	struct DC *next; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| typedef union { | typedef union { | ||||||
| 	int i; | 	int i; | ||||||
| 	unsigned int ui; | 	unsigned int ui; | ||||||
| @ -92,7 +85,7 @@ static void pngscale(struct image *img); | |||||||
| static void pngdraw(struct image *img); | static void pngdraw(struct image *img); | ||||||
|  |  | ||||||
| static void getfontsize(char *str, unsigned int *width, unsigned int *height); | static void getfontsize(char *str, unsigned int *width, unsigned int *height); | ||||||
| static void cleanup(struct DC *cur); | static void cleanup(); | ||||||
| static void eprintf(const char *, ...); | static void eprintf(const char *, ...); | ||||||
| static void die(const char *, ...); | static void die(const char *, ...); | ||||||
| static void load(FILE *fp); | static void load(FILE *fp); | ||||||
| @ -120,7 +113,6 @@ static Slide *slides = NULL; | |||||||
| static int idx = 0; | static int idx = 0; | ||||||
| static int slidecount = 0; | static int slidecount = 0; | ||||||
| static XWindow xw; | static XWindow xw; | ||||||
| static struct DC dc; |  | ||||||
| static Drw *d = NULL; | static Drw *d = NULL; | ||||||
| static Scm *sc; | static Scm *sc; | ||||||
| static Fnt *fonts[NUMFONTSCALES]; | static Fnt *fonts[NUMFONTSCALES]; | ||||||
| @ -335,21 +327,8 @@ void getfontsize(char *str, unsigned int *width, unsigned int *height) | |||||||
| 	*width += d->fonts->h; | 	*width += d->fonts->h; | ||||||
| } | } | ||||||
|  |  | ||||||
| void cleanup(struct DC *cur) | void cleanup() | ||||||
| { | { | ||||||
| //	XFreeFont(xw.dpy, cur->font); |  | ||||||
| //	XFreeGC(xw.dpy, cur->gc); |  | ||||||
|  |  | ||||||
| 	if (cur->next) { |  | ||||||
| 		cleanup(cur->next); |  | ||||||
| 		cur->next = NULL; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	if (cur != &dc) { |  | ||||||
| 		free(cur); |  | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	drw_scm_free(sc); | 	drw_scm_free(sc); | ||||||
| 	drw_free(d); | 	drw_free(d); | ||||||
|  |  | ||||||
| @ -644,6 +623,6 @@ int main(int argc, char *argv[]) | |||||||
| 	xinit(); | 	xinit(); | ||||||
| 	run(); | 	run(); | ||||||
|  |  | ||||||
| 	cleanup(&dc); | 	cleanup(); | ||||||
| 	return EXIT_SUCCESS; | 	return EXIT_SUCCESS; | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user