[MPlayer-cvslog] r23826 - in trunk: codec-cfg.c get_path.c m_config.c parser-cfg.c

reimar subversion at mplayerhq.hu
Thu Jul 19 15:52:39 CEST 2007


Author: reimar
Date: Thu Jul 19 15:52:39 2007
New Revision: 23826

Log:
Remove some more useless *alloc casts


Modified:
   trunk/codec-cfg.c
   trunk/get_path.c
   trunk/m_config.c
   trunk/parser-cfg.c

Modified: trunk/codec-cfg.c
==============================================================================
--- trunk/codec-cfg.c	(original)
+++ trunk/codec-cfg.c	Thu Jul 19 15:52:39 2007
@@ -378,7 +378,7 @@ static int add_comment(char *s, char **d
 		pos = strlen(*d);
 		(*d)[pos++] = '\n';
 	}
-	if (!(*d = (char *) realloc(*d, pos + strlen(s) + 1))) {
+	if (!(*d = realloc(*d, pos + strlen(s) + 1))) {
 		mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment);
 		return 0;
 	}
@@ -519,7 +519,7 @@ int parse_codec_cfg(const char *cfgfile)
 		return 0;
 	}
 
-	if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
+	if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
 		mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno));
 		return 0;
 	}
@@ -576,7 +576,7 @@ int parse_codec_cfg(const char *cfgfile)
 				goto err_out;
 #endif
 			}
-		        if (!(*codecsp = (codecs_t *) realloc(*codecsp,
+		        if (!(*codecsp = realloc(*codecsp,
 				sizeof(codecs_t) * (*nr_codecsp + 2)))) {
 			    mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno));
 			    goto err_out;

Modified: trunk/get_path.c
==============================================================================
--- trunk/get_path.c	(original)
+++ trunk/get_path.c	Thu Jul 19 15:52:39 2007
@@ -53,12 +53,12 @@ char *get_path(const char *filename){
 #endif       
 	len = strlen(homedir) + strlen(config_dir) + 1;
 	if (filename == NULL) {
-		if ((buff = (char *) malloc(len)) == NULL)
+		if ((buff = malloc(len)) == NULL)
 			return NULL;
 		sprintf(buff, "%s%s", homedir, config_dir);
 	} else {
 		len += strlen(filename) + 1;
-		if ((buff = (char *) malloc(len)) == NULL)
+		if ((buff = malloc(len)) == NULL)
 			return NULL;
 		sprintf(buff, "%s%s/%s", homedir, config_dir, filename);
 	}
@@ -95,7 +95,7 @@ char *get_path(const char *filename){
 				maxlen=strlen(filename)+strlen(res_url_path)+2;
 			}
 			free(buff);
-			buff = (char *) malloc(maxlen);
+			buff = malloc(maxlen);
 			strcpy(buff, res_url_path);
 				
 			strcat(buff,"/");

Modified: trunk/m_config.c
==============================================================================
--- trunk/m_config.c	(original)
+++ trunk/m_config.c	Thu Jul 19 15:52:39 2007
@@ -199,7 +199,7 @@ m_config_add_option(m_config_t *config, 
   // Fill in the full name
   if(prefix && strlen(prefix) > 0) {
     int l = strlen(prefix) + 1 + strlen(arg->name) + 1;
-    co->name = (char*) malloc(l);
+    co->name = malloc(l);
     sprintf(co->name,"%s:%s",prefix,arg->name);
   } else
     co->name = arg->name;

Modified: trunk/parser-cfg.c
==============================================================================
--- trunk/parser-cfg.c	(original)
+++ trunk/parser-cfg.c	Thu Jul 19 15:52:39 2007
@@ -69,7 +69,7 @@ int m_config_parse_config_file(m_config_
 	  
 	config->mode = M_CONFIG_FILE;
 
-	if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
+	if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
 		mp_msg(MSGT_CFGPARSER,MSGL_FATAL,"\ncan't get memory for 'line': %s", strerror(errno));
 		ret = -1;
 		goto out;



More information about the MPlayer-cvslog mailing list