diff libvo/sub.c @ 30702:9fc9d1e788aa

Do not cast the results of malloc/calloc/realloc. These functions return void*, which is compatible with any pointer, so there is no need for casts.
author diego
date Fri, 26 Feb 2010 15:01:37 +0000
parents 358ac046eccc
children f6249bc89c38
line wrap: on
line diff
--- a/libvo/sub.c	Fri Feb 26 12:49:49 2010 +0000
+++ b/libvo/sub.c	Fri Feb 26 15:01:37 2010 +0000
@@ -726,7 +726,7 @@
 	      render_one_glyph(sub_font, c);
 
 		if (c == ' ') {
-		    struct osd_text_t *tmp_ott = (struct osd_text_t *) calloc(1, sizeof(struct osd_text_t));
+		    struct osd_text_t *tmp_ott = calloc(1, sizeof(struct osd_text_t));
 
 		    if (osl == NULL) {
 			osl = cp_ott = tmp_ott;
@@ -739,7 +739,7 @@
 		    }
 		    tmp_ott->osd_length = xsize;
 		    tmp_ott->text_length = char_position;
-		    tmp_ott->text = (int *) malloc(char_position * sizeof(int));
+		    tmp_ott->text = malloc(char_position * sizeof(int));
 		    for (counter = 0; counter < char_position; ++counter)
 			tmp_ott->text[counter] = char_seq[counter];
 		    char_position = 0;
@@ -769,7 +769,7 @@
 
 	    // osl holds an ordered (as they appear in the lines) chain of the subtitle words
 	    {
-		struct osd_text_t *tmp_ott = (struct osd_text_t *) calloc(1, sizeof(struct osd_text_t));
+		struct osd_text_t *tmp_ott = calloc(1, sizeof(struct osd_text_t));
 
 		if (osl == NULL) {
 		    osl = cp_ott = tmp_ott;
@@ -782,7 +782,7 @@
 		}
 		tmp_ott->osd_length = xsize;
 		tmp_ott->text_length = char_position;
-		tmp_ott->text = (int *) malloc(char_position * sizeof(int));
+		tmp_ott->text = malloc(char_position * sizeof(int));
 		for (counter = 0; counter < char_position; ++counter)
 		    tmp_ott->text[counter] = char_seq[counter];
 		char_position = 0;
@@ -794,7 +794,7 @@
 		int value = 0, exit = 0, minimum = 0;
 
 		// otp will contain the chain of the osd subtitle lines coming from the single vo_sub line.
-		otp = tmp_otp = (struct osd_text_p *) calloc(1, sizeof(struct osd_text_p));
+		otp = tmp_otp = calloc(1, sizeof(struct osd_text_p));
 		tmp_otp->ott = osl;
 		for (tmp_ott = tmp_otp->ott; exit == 0; ) {
 		    do {
@@ -802,7 +802,7 @@
 			tmp_ott = tmp_ott->next;
 		    } while ((tmp_ott != NULL) && (value + tmp_ott->osd_kerning + tmp_ott->osd_length <= xlimit));
 		    if (tmp_ott != NULL) {
-			struct osd_text_p *tmp = (struct osd_text_p *) calloc(1, sizeof(struct osd_text_p));
+			struct osd_text_p *tmp = calloc(1, sizeof(struct osd_text_p));
 
 			tmp_otp->value = value;
 			tmp_otp->next = tmp;