diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-19 13:52:39 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-19 13:52:39 +0000 |
commit | e607c7289f5fa7487f810eff2f1e71970cf0645b (patch) | |
tree | a527ed50daef75535706d0f8410fc32a60a73d70 | |
parent | 7de92dc41c3a1c9ff9b3a0f0b928f696768170c5 (diff) |
Remove some more useless *alloc casts
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23826 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | codec-cfg.c | 6 | ||||
-rw-r--r-- | get_path.c | 6 | ||||
-rw-r--r-- | m_config.c | 2 | ||||
-rw-r--r-- | parser-cfg.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/codec-cfg.c b/codec-cfg.c index 4a373a5fef..73bff8bb0c 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -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; diff --git a/get_path.c b/get_path.c index 679b0632ed..f40580f1f9 100644 --- a/get_path.c +++ b/get_path.c @@ -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,"/"); diff --git a/m_config.c b/m_config.c index d1cb0e0485..feab9537e6 100644 --- a/m_config.c +++ b/m_config.c @@ -199,7 +199,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) { // 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 --git a/parser-cfg.c b/parser-cfg.c index e3988badd8..7976939106 100644 --- a/parser-cfg.c +++ b/parser-cfg.c @@ -69,7 +69,7 @@ int m_config_parse_config_file(m_config_t* config, char *conffile) 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; |