summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36ee20d)
raw | patch | inline | side by side (parent: 36ee20d)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 11:35:09 +0000 (13:35 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 11:35:09 +0000 (13:35 +0200) |
29 files changed:
diff --git a/src/apache.c b/src/apache.c
index baa6081a6046743679a6949b16d2f07e347aed24..3d25c350fbb366fcfe5569e5f0a3d23bef98e233 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
{
char *temp;
- temp = (char *) realloc (st->apache_buffer,
+ temp = realloc (st->apache_buffer,
st->apache_buffer_fill + len + 1);
if (temp == NULL)
{
diff --git a/src/ascent.c b/src/ascent.c
index d38e85916e937468c13dfb1d33e6706991fd261b..74f714a83515c967cc12f3435b9aab969a8fd7c5 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
@@ -161,7 +161,7 @@ static size_t ascent_curl_callback (void *buf, size_t size, size_t nmemb, /* {{{
{
char *temp;
- temp = (char *) realloc (ascent_buffer,
+ temp = realloc (ascent_buffer,
ascent_buffer_fill + len + 1);
if (temp == NULL)
{
diff --git a/src/bind.c b/src/bind.c
index f2cd1677d8a4f7e854970ab0c6ef1cd5f3f40868..a546ff975834dc016ec188b6d06fe568c585cffa 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
return (-1);
}
- tmp = (char **) realloc (view->zones,
+ tmp = realloc (view->zones,
sizeof (char *) * (view->zones_num + 1));
if (tmp == NULL)
{
return (-1);
}
- tmp = (cb_view_t *) realloc (views, sizeof (*views) * (views_num + 1));
+ tmp = realloc (views, sizeof (*views) * (views_num + 1));
if (tmp == NULL)
{
ERROR ("bind plugin: realloc failed.");
diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c
index 712c24fa5b153272b5be422b0ef2ae7fcdf12eb8..fe56d5d36af2accf85afd8b525c6d969ca215947 100644 (file)
--- a/src/collectd-nagios.c
+++ b/src/collectd-nagios.c
case 'd':
{
char **tmp;
- tmp = (char **) realloc (match_ds_g,
+ tmp = realloc (match_ds_g,
(match_ds_num_g + 1)
* sizeof (char *));
if (tmp == NULL)
diff --git a/src/curl.c b/src/curl.c
index 4bb58e2c9925e5984d340fda2105b6a44f0278fd..ea03ce220915fe041fda430380a7c557b7c64dcb 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
size_t temp_size;
temp_size = wp->buffer_fill + len + 1;
- temp = (char *) realloc (wp->buffer, temp_size);
+ temp = realloc (wp->buffer, temp_size);
if (temp == NULL)
{
ERROR ("curl plugin: realloc failed.");
diff --git a/src/curl_xml.c b/src/curl_xml.c
index 58cb42db7e20daf818c82253fb7e7b17e03696fb..fa2f0ca47f3a5f6b901f0789225a2a2058fa6f46 100644 (file)
--- a/src/curl_xml.c
+++ b/src/curl_xml.c
{
char *temp;
- temp = (char *) realloc (db->buffer,
+ temp = realloc (db->buffer,
db->buffer_fill + len + 1);
if (temp == NULL)
{
index 1d81a6528c027e46c71de7fdc8c52c4ccf9ba9fc..70ada80a6d04a8180c0e7904658a7b90b2d3c1fe 100644 (file)
--- a/src/daemon/configfile.c
+++ b/src/daemon/configfile.c
return (0);
}
- temp = (oconfig_item_t *) realloc (dst->children,
+ temp = realloc (dst->children,
sizeof (oconfig_item_t)
* (dst->children_num + src->children_num - 1));
if (temp == NULL)
if ((src == NULL) || (src->children_num == 0))
return (0);
- temp = (oconfig_item_t *) realloc (dst->children,
+ temp = realloc (dst->children,
sizeof (oconfig_item_t)
* (dst->children_num + src->children_num));
if (temp == NULL)
}
++filenames_num;
- tmp = (char **) realloc (filenames,
+ tmp = realloc (filenames,
filenames_num * sizeof (*filenames));
if (tmp == NULL) {
ERROR ("configfile: realloc failed.");
index f4e343c1b33f2cd1eaafea64d971c672b84a95e3..a622af961dcf281b557c14634d9ef041a8d10175 100644 (file)
}
plugin = child->values[j].value.string;
- temp = (fc_writer_t *) realloc (plugin_list, (plugin_list_len + 2)
+ temp = realloc (plugin_list, (plugin_list_len + 2)
* (sizeof (*plugin_list)));
if (temp == NULL)
{
index b5b059c0392e8f7b357c4bdab114eeb3f4e12b77..9328d7ad9b413218c71b36920df36029c426d0c3 100644 (file)
--- a/src/daemon/utils_cache.c
+++ b/src/daemon/utils_cache.c
continue;
/* If entry has not been updated, add to `keys' array */
- tmp = (char **) realloc ((void *) keys,
+ tmp = realloc ((void *) keys,
(keys_len + 1) * sizeof (char *));
if (tmp == NULL)
{
index 1e5da95e181550b3b54e21df6773be0805e5482d..1aeb814a08398ca961db75e33e87d6d38667dfd2 100644 (file)
{
cu_tail_match_match_t *temp;
- temp = (cu_tail_match_match_t *) realloc (obj->matches,
+ temp = realloc (obj->matches,
sizeof (cu_tail_match_match_t) * (obj->matches_num + 1));
if (temp == NULL)
return (-1);
diff --git a/src/dbi.c b/src/dbi.c
index 655581e8bdc74b7b0e45fcbf90d3af8bae0b20a3..36e0d1693e67944957310518ecf2b8c2d79995d3 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
@@ -240,7 +240,7 @@ static int cdbi_config_add_database_driver_option (cdbi_database_t *db, /* {{{ *
return (-1);
}
- option = (cdbi_driver_option_t *) realloc (db->driver_options,
+ option = realloc (db->driver_options,
sizeof (*option) * (db->driver_options_num + 1));
if (option == NULL)
{
{
cdbi_database_t **temp;
- temp = (cdbi_database_t **) realloc (databases,
+ temp = realloc (databases,
sizeof (*databases) * (databases_num + 1));
if (temp == NULL)
{
diff --git a/src/filecount.c b/src/filecount.c
index 270e5d0528f567ca99307d9a01199529dcdc45b6..c81fdc250c9840901cafeb2f7a09098963bed105 100644 (file)
--- a/src/filecount.c
+++ b/src/filecount.c
{
fc_directory_conf_t **temp;
- temp = (fc_directory_conf_t **) realloc (directories,
+ temp = realloc (directories,
sizeof (*directories) * (directories_num + 1));
if (temp == NULL)
{
diff --git a/src/iptables.c b/src/iptables.c
index 1e35851ab7ff49f14e8208a7ee4d6fe5f11e87d0..0103725fa4a343fa712043a8f1a2162fd21a104e 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
table = NULL;
chain = NULL;
- list = (ip_chain_t **) realloc (chain_list, (chain_num + 1) * sizeof (ip_chain_t *));
+ list = realloc (chain_list, (chain_num + 1) * sizeof (ip_chain_t *));
if (list == NULL)
{
char errbuf[1024];
diff --git a/src/java.c b/src/java.c
index 50cd69658f68d04b3bf16cf35f54476391c0b8ea..4187e7c382d03c3658238e0b7aa65a34cd231bd1 100644 (file)
--- a/src/java.c
+++ b/src/java.c
pthread_mutex_lock (&java_callbacks_lock);
- tmp = (cjni_callback_info_t *) realloc (java_callbacks,
+ tmp = realloc (java_callbacks,
(java_callbacks_num + 1) * sizeof (*java_callbacks));
if (tmp == NULL)
{
return (-1);
}
- tmp = (char **) realloc (jvm_argv, sizeof (char *) * (jvm_argc + 1));
+ tmp = realloc (jvm_argv, sizeof (char *) * (jvm_argc + 1));
if (tmp == NULL)
{
ERROR ("java plugin: realloc failed.");
if (jvm_env == NULL)
return (-1);
- class = (java_plugin_class_t *) realloc (java_classes_list,
+ class = realloc (java_classes_list,
(java_classes_list_len + 1) * sizeof (*java_classes_list));
if (class == NULL)
{
index 41d66438dd86e1176621034734d4666a29e0d773..7a831c2a8f63390e8435adca419867c1a5604fc9 100644 (file)
--- a/src/liboconfig/scanner.l
+++ b/src/liboconfig/scanner.l
if (ml_free <= len) {
ml_len += len - ml_free + 1;
- ml_buffer = (char *)realloc (ml_buffer, ml_len);
+ ml_buffer = realloc (ml_buffer, ml_len);
if (NULL == ml_buffer)
YY_FATAL_ERROR ("out of dynamic memory in ml_append");
}
diff --git a/src/match_value.c b/src/match_value.c
index 64e1136703e9aaf2833a13fea9ded807a5802199..fd63ad83c2088312ca390d5ea4215e5f01ea3d51 100644 (file)
--- a/src/match_value.c
+++ b/src/match_value.c
/* Allocate space for the char pointers */
new_data_sources_num = m->data_sources_num + ((size_t) ci->values_num);
- temp = (char **) realloc (m->data_sources,
+ temp = realloc (m->data_sources,
new_data_sources_num * sizeof (char *));
if (temp == NULL)
{
diff --git a/src/netlink.c b/src/netlink.c
index c8905d5ca10325c1b4100d003b90015315b2ac02..5c3a9f007beb656aeefcc2a81152243671243d1e 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
{
char **temp;
- temp = (char **) realloc (iflist, (msg->ifi_index + 1) * sizeof (char *));
+ temp = realloc (iflist, (msg->ifi_index + 1) * sizeof (char *));
if (temp == NULL)
{
ERROR ("netlink plugin: update_iflist: realloc failed.");
diff --git a/src/notify_email.c b/src/notify_email.c
index 6843987cbf34b0f4f986846f051e954090b95643..c77b2d19e1d6618c5d1bd431d9cba75c6085572e 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
{
char **tmp;
- tmp = (char **) realloc ((void *) recipients, (recipients_len + 1) * sizeof (char *));
+ tmp = realloc (recipients, (recipients_len + 1) * sizeof (char *));
if (tmp == NULL) {
ERROR ("notify_email: realloc failed.");
return (-1);
diff --git a/src/ntpd.c b/src/ntpd.c
index 4a31e455eece36ad595f8bbc41ac7ee6985c35e7..1071d0b34544aa773017f483381f69333f239234 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
*/
DEBUG ("realloc (%p, %zu)", (void *) *res_data,
(items_num + pkt_item_num) * res_item_size);
- items = realloc ((void *) *res_data,
+ items = realloc (*res_data,
(items_num + pkt_item_num) * res_item_size);
if (items == NULL)
{
diff --git a/src/oracle.c b/src/oracle.c
index 55139dd1083498c840e4c61389eca5e8c350126d..cb9b3dbf9230aede137294f91160ddea73db2af4 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
{
o_database_t **temp;
- temp = (o_database_t **) realloc (databases,
+ temp = realloc (databases,
sizeof (*databases) * (databases_num + 1));
if (temp == NULL)
{
diff --git a/src/perl.c b/src/perl.c
index 920e7b3f015a60c3c3c3aa349c3a2d711a3d961b..27214bb6568acc18796fe913be4d01fa3969d9ef 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
value = ci->values[0].value.string;
- perl_argv = (char **)realloc (perl_argv,
+ perl_argv = realloc (perl_argv,
(++perl_argc + 1) * sizeof (char *));
if (NULL == perl_argv) {
value = ci->values[0].value.string;
if (NULL == aTHX) {
- perl_argv = (char **)realloc (perl_argv,
+ perl_argv = realloc (perl_argv,
(++perl_argc + 1) * sizeof (char *));
if (NULL == perl_argv) {
diff --git a/src/postgresql.c b/src/postgresql.c
index b4b4ca7769d2933bb137821a014b36ebcac98951..759560e874dea71be320627da02d2bf7613e7946 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
return NULL;
}
- tmp = (c_psql_database_t **)realloc (databases,
+ tmp = realloc (databases,
(databases_num + 1) * sizeof (*databases));
if (NULL == tmp) {
log_err ("Out of memory.");
if (strcasecmp (name, src_writers[i].name) != 0)
continue;
- tmp = (c_psql_writer_t **)realloc (*dst_writers,
+ tmp = realloc (*dst_writers,
sizeof (**dst_writers) * (*dst_writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
return 1;
}
- tmp = (c_psql_writer_t *)realloc (writers,
+ tmp = realloc (writers,
sizeof (*writers) * (writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
diff --git a/src/powerdns.c b/src/powerdns.c
index 1c41ff8d62ab31a5dca62ee5ac5f0746b8c2ad89..f72bd40ffcd52c8099362fa4397053d1fdb7239d 100644 (file)
--- a/src/powerdns.c
+++ b/src/powerdns.c
else if (status == 0)
break;
- buffer_new = (char *) realloc (buffer, buffer_size + status + 1);
+ buffer_new = realloc (buffer, buffer_size + status + 1);
if (buffer_new == NULL)
{
FUNC_ERROR ("realloc");
return (-1);
}
- temp = (char **) realloc (li->fields,
+ temp = realloc (li->fields,
sizeof (char *) * (li->fields_num + ci->values_num));
if (temp == NULL)
{
diff --git a/src/rrdtool.c b/src/rrdtool.c
index b45f8d997fc4b7acb2882b645eebfb519a3b22b2..3cd6d6bb6807b842407f79e5760c4708d78a9a0e 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
}
else /* ancient and no values -> waste of memory */
{
- char **tmp = (char **) realloc ((void *) keys,
+ char **tmp = realloc (keys,
(keys_num + 1) * sizeof (char *));
if (tmp == NULL)
{
return (-1);
}
- values_new = (char **) realloc ((void *) rc->values,
+ values_new = realloc ((void *) rc->values,
(rc->values_num + 1) * sizeof (char *));
if (values_new == NULL)
{
diff --git a/src/snmp.c b/src/snmp.c
index 8b21907a031070df3e011b06c2bdc2a565e4575f..d6fc05dcaa278d6964f719af14832b0b7dc56ddd 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
}
data_list_len = host->data_list_len + ci->values_num;
- data_list = (data_definition_t **) realloc (host->data_list,
+ data_list = realloc (host->data_list,
sizeof (data_definition_t *) * data_list_len);
if (data_list == NULL)
return (-1);
diff --git a/src/table.c b/src/table.c
index aebf0bbfad39123fba3f34b58d02c06bd743f1be..38d5f03a0161fc6e905da089fb6ce9002ee5f739 100644 (file)
--- a/src/table.c
+++ b/src/table.c
return 1;
}
- res = (tbl_result_t *)realloc (tbl->results,
+ res = realloc (tbl->results,
(tbl->results_num + 1) * sizeof (*tbl->results));
if (res == NULL) {
char errbuf[1024];
return 1;
}
- tbl = (tbl_t *)realloc (tables, (tables_num + 1) * sizeof (*tables));
+ tbl = realloc (tables, (tables_num + 1) * sizeof (*tables));
if (NULL == tbl) {
char errbuf[1024];
log_err ("realloc failed: %s.",
diff --git a/src/tail.c b/src/tail.c
index ffdba8ae3e6ee62eeacf59200a1c4de00b2d1500..5402f6664857e26c671be1f5650b37a3c6d718ac 100644 (file)
--- a/src/tail.c
+++ b/src/tail.c
{
cu_tail_match_t **temp;
- temp = (cu_tail_match_t **) realloc (tail_match_list,
+ temp = realloc (tail_match_list,
sizeof (cu_tail_match_t *) * (tail_match_list_num + 1));
if (temp == NULL)
{
diff --git a/src/target_scale.c b/src/target_scale.c
index 3ac399c904bcbafff2a803dc06bb6ee015d0485c..74652ff81dbeeb6452f0fce8c2d01768e10d3836 100644 (file)
--- a/src/target_scale.c
+++ b/src/target_scale.c
/* Allocate space for the char pointers */
new_data_sources_num = data->data_sources_num + ((size_t) ci->values_num);
- temp = (char **) realloc (data->data_sources,
+ temp = realloc (data->data_sources,
new_data_sources_num * sizeof (char *));
if (temp == NULL)
{
diff --git a/src/utils_db_query.c b/src/utils_db_query.c
index 74c3a81fe7c69d8052f1ce54baae71e70a6547ac..5c5d1d775a48bcda03ff89084cdad16855fb749d 100644 (file)
--- a/src/utils_db_query.c
+++ b/src/utils_db_query.c
}
array_len = *ret_array_len;
- array = (char **) realloc (*ret_array,
+ array = realloc (*ret_array,
sizeof (char *) * (array_len + ci->values_num));
if (array == NULL)
{
{
udb_query_t **temp;
- temp = (udb_query_t **) realloc (query_list,
+ temp = realloc (query_list,
sizeof (*query_list) * (query_list_len + 1));
if (temp == NULL)
{
continue;
tmp_list_len = *dst_list_len;
- tmp_list = (udb_query_t **) realloc (*dst_list, (tmp_list_len + 1)
+ tmp_list = realloc (*dst_list, (tmp_list_len + 1)
* sizeof (udb_query_t *));
if (tmp_list == NULL)
{