From 0a40eb2af06e73aeddb3fd679f7dadc298213e4f Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Wed, 28 Feb 2018 16:01:49 +0100 Subject: [PATCH] TT#33319 Convert tabs to spaces in code style Change-Id: Ifeabbb0ab740a3ca39b147cd40b5e6e726082bb5 --- mediator.c | 4 ++-- medmysql.c | 12 ++++++------ medredis.c | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mediator.c b/mediator.c index 4c4bd8c..cb25c6a 100644 --- a/mediator.c +++ b/mediator.c @@ -236,8 +236,8 @@ int main(int argc, char **argv) maprefresh = 0; batches = malloc(sizeof(*batches)); if (!batches) { - L_ERROR("Out of memory allocating batches"); - return -1; + L_ERROR("Out of memory allocating batches"); + return -1; } while(!mediator_shutdown) diff --git a/medmysql.c b/medmysql.c index 4681d96..46d202b 100644 --- a/medmysql.c +++ b/medmysql.c @@ -433,23 +433,23 @@ int medmysql_insert_records(med_entry_t *records, uint64_t count, const char *ta int ret; if (!count) - return 0; + return 0; sql_buffer = (char*)malloc(sql_buffer_size); if (!sql_buffer) { - L_ERROR("Failed to allocate memory for redis cleanup sql buffer\n"); - return -1; + L_ERROR("Failed to allocate memory for redis cleanup sql buffer\n"); + return -1; } memset(sql_buffer, 0, sql_buffer_size); snprintf(sql_buffer, sql_buffer_size, "INSERT INTO kamailio.acc_%s " \ - "(sip_code,sip_reason,method,callid,time,time_hires,src_leg,dst_leg) VALUES ", - table); + "(sip_code,sip_reason,method,callid,time,time_hires,src_leg,dst_leg) VALUES ", + table); for (uint64_t i = 0; i < count; ++i) { med_entry_t *e = &(records[i]); snprintf(entry_buffer, sizeof(entry_buffer), "('%s','%s','%s','%s','%s','%f','%s','%s'),", - e->sip_code, e->sip_reason, e->sip_method, e->callid, e->timestamp, e->unix_timestamp, e->src_leg, e->dst_leg); + e->sip_code, e->sip_reason, e->sip_method, e->callid, e->timestamp, e->unix_timestamp, e->src_leg, e->dst_leg); sql_buffer = strcat(sql_buffer, entry_buffer); } sql_buffer[strlen(sql_buffer)-1] = '\0'; diff --git a/medredis.c b/medredis.c index 5dd3772..4a9f0ac 100644 --- a/medredis.c +++ b/medredis.c @@ -696,11 +696,11 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const char buffer[512]; if (medmysql_insert_records(records, count, table) != 0) { - L_CRITICAL("Failed to cleanup redis records\n"); - goto err; + L_CRITICAL("Failed to cleanup redis records\n"); + goto err; } - for (uint64_t i = 0; i < count; ++i) { + for (uint64_t i = 0; i < count; ++i) { med_entry_t *e = &(records[i]); L_DEBUG("Cleaning up redis entry for %s:%f\n", e->callid, e->unix_timestamp); @@ -710,8 +710,8 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const argv[0] = "DEL"; argv[1] = buffer; if (medredis_append_command_argv(con, 2, argv, 1) != 0) { - L_ERROR("Failed to append redis command to remove key '%s'\n", buffer); - goto err; + L_ERROR("Failed to append redis command to remove key '%s'\n", buffer); + goto err; } // delete cid from acc:meth::INVITE and acc:meth::BYE @@ -720,21 +720,21 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const snprintf(buffer, sizeof(buffer), "acc:entry::%s:%f", e->callid, e->unix_timestamp); argv[2] = buffer; if (medredis_append_command_argv(con, 3, argv, 1) != 0) { - L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]); - goto err; + L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]); + goto err; } argv[1] = "acc:meth::BYE"; if (medredis_append_command_argv(con, 3, argv, 1) != 0) { - L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]); - goto err; + L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]); + goto err; } // delete acc:entry::$cid:$timestamp argv[0] = "DEL"; argv[1] = buffer; - if (medredis_append_command_argv(con, 2, argv, 1) != 0) { - L_ERROR("Failed to append redis command to remove key '%s'\n", buffer); - goto err; + if (medredis_append_command_argv(con, 2, argv, 1) != 0) { + L_ERROR("Failed to append redis command to remove key '%s'\n", buffer); + goto err; } }