# HG changeset patch # User reimar # Date 1184853159 0 # Node ID 0a38ad149c5c74181c598bc783c3572bc92eddbb # Parent 3c6db57870eaebd76a7f7b43b8901067344fea52 Remove some more useless *alloc casts diff -r 3c6db57870ea -r 0a38ad149c5c codec-cfg.c --- a/codec-cfg.c Thu Jul 19 07:24:43 2007 +0000 +++ b/codec-cfg.c Thu Jul 19 13:52:39 2007 +0000 @@ -378,7 +378,7 @@ 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 @@ 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 @@ 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; diff -r 3c6db57870ea -r 0a38ad149c5c get_path.c --- a/get_path.c Thu Jul 19 07:24:43 2007 +0000 +++ b/get_path.c Thu Jul 19 13:52:39 2007 +0000 @@ -53,12 +53,12 @@ #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 @@ maxlen=strlen(filename)+strlen(res_url_path)+2; } free(buff); - buff = (char *) malloc(maxlen); + buff = malloc(maxlen); strcpy(buff, res_url_path); strcat(buff,"/"); diff -r 3c6db57870ea -r 0a38ad149c5c m_config.c --- a/m_config.c Thu Jul 19 07:24:43 2007 +0000 +++ b/m_config.c Thu Jul 19 13:52:39 2007 +0000 @@ -199,7 +199,7 @@ // 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; diff -r 3c6db57870ea -r 0a38ad149c5c parser-cfg.c --- a/parser-cfg.c Thu Jul 19 07:24:43 2007 +0000 +++ b/parser-cfg.c Thu Jul 19 13:52:39 2007 +0000 @@ -69,7 +69,7 @@ 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;