remove unnecessary (char *) casts for ast_config_AST_* variables.

There are some left in the .flex files, left to the maintainer...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Luigi Rizzo 18 years ago
parent 3ff440bd37
commit fd88390af7

@ -1356,7 +1356,7 @@ static struct adsi_script *compile_script(char *script)
if (script[0] == '/')
ast_copy_string(fn, script, sizeof(fn));
else
snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, script);
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, script);
if (!(f = fopen(fn, "r"))) {
ast_log(LOG_WARNING, "Can't open file '%s'\n", fn);

@ -145,7 +145,7 @@ static int ices_exec(struct ast_channel *chan, void *data)
if (((char *)data)[0] == '/')
ast_copy_string(filename, (char *) data, sizeof(filename));
else
snprintf(filename, sizeof(filename), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, (char *)data);
snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_CONFIG_DIR, (char *)data);
/* Placeholder for options */
c = strchr(filename, '|');
if (c)

@ -258,7 +258,7 @@ static int writefile(char *s, char *acc)
return -1;
}
snprintf(tmp, sizeof(tmp), "%s/%s/%s.csv", (char *)ast_config_AST_LOG_DIR,CSV_LOG_DIR, acc);
snprintf(tmp, sizeof(tmp), "%s/%s/%s.csv", ast_config_AST_LOG_DIR,CSV_LOG_DIR, acc);
ast_mutex_lock(&acf_lock);
if (!(f = fopen(tmp, "a"))) {

@ -1893,7 +1893,7 @@ static void reload_firmware(int unload)
/* Now that we have marked them dead... load new ones */
if (!unload) {
snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_DATA_DIR);
snprintf(dir, sizeof(dir), "%s/firmware/iax", ast_config_AST_DATA_DIR);
fwd = opendir(dir);
if (fwd) {
while((de = readdir(fwd))) {

@ -1711,7 +1711,7 @@ static int write_history(struct unistimsession *pte, char way, char ismissed)
return -1;
}
snprintf(tmp, sizeof(tmp), "%s/%s", (char *) ast_config_AST_LOG_DIR, USTM_LOG_DIR);
snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, USTM_LOG_DIR);
if (ast_mkdir(tmp, 0770)) {
if (errno != EEXIST) {
display_last_error("Unable to create directory for history");
@ -1731,7 +1731,7 @@ static int write_history(struct unistimsession *pte, char way, char ismissed)
atm.tm_year + 1900, atm.tm_mon + 1, atm.tm_mday, atm.tm_hour,
atm.tm_min, atm.tm_sec, tmp2);
snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", (char *) ast_config_AST_LOG_DIR,
snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
if ((f = fopen(tmp, "r"))) {
struct stat bufstat;
@ -1794,7 +1794,7 @@ static int write_history(struct unistimsession *pte, char way, char ismissed)
fclose(f);
return -1;
}
snprintf(tmp2, sizeof(tmp2), "%s/%s/%s-%c.csv.tmp", (char *) ast_config_AST_LOG_DIR,
snprintf(tmp2, sizeof(tmp2), "%s/%s/%s-%c.csv.tmp", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
if (!(f2 = fopen(tmp2, "w"))) {
display_last_error("Unable to create temporary history log.");
@ -3036,7 +3036,7 @@ static char OpenHistory(struct unistimsession *pte, char way, FILE ** f)
char tmp[AST_CONFIG_MAX_PATH];
char count;
snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", (char *) ast_config_AST_LOG_DIR,
snprintf(tmp, sizeof(tmp), "%s/%s/%s-%c.csv", ast_config_AST_LOG_DIR,
USTM_LOG_DIR, pte->device->name, way);
*f = fopen(tmp, "r");
if (!*f) {

@ -1135,7 +1135,7 @@ static int ast_tryconnect(void)
}
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_LOCAL;
ast_copy_string(sunaddr.sun_path, (char *) ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
ast_copy_string(sunaddr.sun_path, ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
res = connect(ast_consock, (struct sockaddr *)&sunaddr, sizeof(sunaddr));
if (res) {
close(ast_consock);

@ -465,7 +465,7 @@ void __ast_mm_init(void)
ast_cli_register_multiple(cli_memory, sizeof(cli_memory) / sizeof(struct ast_cli_entry));
snprintf(filename, sizeof(filename), "%s/mmlog", (char *)ast_config_AST_LOG_DIR);
snprintf(filename, sizeof(filename), "%s/mmlog", ast_config_AST_LOG_DIR);
if (option_verbose)
ast_verbose("Asterisk Malloc Debugger Started (see %s))\n", filename);

@ -1082,7 +1082,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
if (filename[0] == '/') {
ast_copy_string(fn, filename, sizeof(fn));
} else {
snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
}
if (ast_test_flag(&flags, CONFIG_FLAG_WITHCOMMENTS)) {

@ -53,7 +53,7 @@ AST_MUTEX_DEFINE_STATIC(dblock);
static int dbinit(void)
{
if (!astdb && !(astdb = dbopen((char *)ast_config_AST_DB, O_CREAT | O_RDWR, AST_FILE_MODE, DB_BTREE, NULL))) {
if (!astdb && !(astdb = dbopen(ast_config_AST_DB, O_CREAT | O_RDWR, AST_FILE_MODE, DB_BTREE, NULL))) {
ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", ast_config_AST_DB, strerror(errno));
return -1;
}

@ -449,13 +449,13 @@ static void crypto_load(int ifd, int ofd)
}
/* Load new keys */
if ((dir = opendir((char *)ast_config_AST_KEY_DIR))) {
if ((dir = opendir(ast_config_AST_KEY_DIR))) {
while((ent = readdir(dir))) {
try_load_key((char *)ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, &note);
try_load_key(ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, &note);
}
closedir(dir);
} else
ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", (char *)ast_config_AST_KEY_DIR);
ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", ast_config_AST_KEY_DIR);
if (note)
ast_log(LOG_NOTICE, "Please run the command 'init keys' to enter the passcodes for the keys\n");
@ -562,7 +562,7 @@ static char *handle_cli_keys_init(struct ast_cli_entry *e, int cmd, struct ast_c
if (key->ktype & KEY_NEEDS_PASSCODE) {
kn = key->fn + strlen(ast_config_AST_KEY_DIR) + 1;
ast_copy_string(tmp, kn, sizeof(tmp));
try_load_key((char *) ast_config_AST_KEY_DIR, tmp, a->fd, a->fd, &ign);
try_load_key(ast_config_AST_KEY_DIR, tmp, a->fd, a->fd, &ign);
}
}
AST_RWLIST_TRAVERSE_SAFE_END

@ -3656,7 +3656,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
if (use_local_dir)
snprintf(fn, sizeof(fn), "./%s", filename);
else
snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
}
if (withcomments && cfg && cfg->include_level < 2 ) {

Loading…
Cancel
Save