projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
iptables: include libiptc headers before capability.h
[collectd.git]
/
src
/
java.c
diff --git
a/src/java.c
b/src/java.c
index
33d0504
..
47f4cd3
100644
(file)
--- a/
src/java.c
+++ b/
src/java.c
@@
-22,6
+22,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "plugin.h"
#include "common.h"
#include "filter_chain.h"
#include "plugin.h"
#include "common.h"
#include "filter_chain.h"
@@
-506,7
+507,6
@@
static jobject ctoj_oconfig_item (JNIEnv *jvm_env, /* {{{ */
jmethodID m_addchild;
jobject o_key;
jobject o_ocitem;
jmethodID m_addchild;
jobject o_key;
jobject o_ocitem;
- int i;
c_ocitem = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/OConfigItem");
if (c_ocitem == NULL)
c_ocitem = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/OConfigItem");
if (c_ocitem == NULL)
@@
-571,7
+571,7
@@
static jobject ctoj_oconfig_item (JNIEnv *jvm_env, /* {{{ */
(*jvm_env)->DeleteLocalRef (jvm_env, o_key);
/* Call OConfigItem.addValue for each value */
(*jvm_env)->DeleteLocalRef (jvm_env, o_key);
/* Call OConfigItem.addValue for each value */
- for (i = 0; i < ci->values_num; i++) /* {{{ */
+ for (i
nt i
= 0; i < ci->values_num; i++) /* {{{ */
{
jobject o_value;
{
jobject o_value;
@@
-589,7
+589,7
@@
static jobject ctoj_oconfig_item (JNIEnv *jvm_env, /* {{{ */
} /* }}} for (i = 0; i < ci->values_num; i++) */
/* Call OConfigItem.addChild for each child */
} /* }}} for (i = 0; i < ci->values_num; i++) */
/* Call OConfigItem.addChild for each child */
- for (i = 0; i < ci->children_num; i++) /* {{{ */
+ for (i
nt i
= 0; i < ci->children_num; i++) /* {{{ */
{
jobject o_child;
{
jobject o_child;
@@
-617,7
+617,6
@@
static jobject ctoj_data_set (JNIEnv *jvm_env, const data_set_t *ds) /* {{{ */
jmethodID m_add;
jobject o_type;
jobject o_dataset;
jmethodID m_add;
jobject o_type;
jobject o_dataset;
- size_t i;
/* Look up the org/collectd/api/DataSet class */
c_dataset = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/DataSet");
/* Look up the org/collectd/api/DataSet class */
c_dataset = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/DataSet");
@@
-667,7
+666,7
@@
static jobject ctoj_data_set (JNIEnv *jvm_env, const data_set_t *ds) /* {{{ */
/* Decrease reference counter on the java.lang.String object. */
(*jvm_env)->DeleteLocalRef (jvm_env, o_type);
/* Decrease reference counter on the java.lang.String object. */
(*jvm_env)->DeleteLocalRef (jvm_env, o_type);
- for (i = 0; i < ds->ds_num; i++)
+ for (
size_t
i = 0; i < ds->ds_num; i++)
{
jobject o_datasource;
{
jobject o_datasource;
@@
-762,7
+761,6
@@
static jobject ctoj_value_list (JNIEnv *jvm_env, /* {{{ */
jmethodID m_valuelist_constructor;
jobject o_valuelist;
int status;
jmethodID m_valuelist_constructor;
jobject o_valuelist;
int status;
- size_t i;
/* First, create a new ValueList instance..
* Look up the class.. */
/* First, create a new ValueList instance..
* Look up the class.. */
@@
-845,7
+843,7
@@
static jobject ctoj_value_list (JNIEnv *jvm_env, /* {{{ */
return (NULL);
}
return (NULL);
}
- for (i = 0; i < vl->values_len; i++)
+ for (
size_t
i = 0; i < vl->values_len; i++)
{
status = ctoj_value_list_add_value (jvm_env, vl->values[i], ds->ds[i].type,
c_valuelist, o_valuelist);
{
status = ctoj_value_list_add_value (jvm_env, vl->values[i], ds->ds[i].type,
c_valuelist, o_valuelist);
@@
-1116,7
+1114,6
@@
static int jtoc_values_array (JNIEnv *jvm_env, /* {{{ */
value_t *values;
int values_num;
value_t *values;
int values_num;
- int i;
values_num = ds->ds_num;
values_num = ds->ds_num;
@@
-1176,7
+1173,7
@@
static int jtoc_values_array (JNIEnv *jvm_env, /* {{{ */
BAIL_OUT (-1);
}
BAIL_OUT (-1);
}
- for (i = 0; i < values_num; i++)
+ for (i
nt i
= 0; i < values_num; i++)
{
jobject o_number;
int status;
{
jobject o_number;
int status;
@@
-1979,7
+1976,6
@@
static int cjni_create_jvm (void) /* {{{ */
JavaVMOption vm_options[jvm_argc];
int status;
JavaVMOption vm_options[jvm_argc];
int status;
- size_t i;
if (jvm != NULL)
return (0);
if (jvm != NULL)
return (0);
@@
-1998,7
+1994,7
@@
static int cjni_create_jvm (void) /* {{{ */
vm_args.options = vm_options;
vm_args.nOptions = (jint) jvm_argc;
vm_args.options = vm_options;
vm_args.nOptions = (jint) jvm_argc;
- for (i = 0; i < jvm_argc; i++)
+ for (
size_t
i = 0; i < jvm_argc; i++)
{
DEBUG ("java plugin: cjni_create_jvm: jvm_argv[%zu] = %s",
i, jvm_argv[i]);
{
DEBUG ("java plugin: cjni_create_jvm: jvm_argv[%zu] = %s",
i, jvm_argv[i]);
@@
-2215,8
+2211,7
@@
static int cjni_config_load_plugin (oconfig_item_t *ci) /* {{{ */
{ /* Replace all dots ('.') with slashes ('/'). Dots are usually used
thorough the Java community, but (Sun's) `FindClass' and friends need
slashes. */
{ /* Replace all dots ('.') with slashes ('/'). Dots are usually used
thorough the Java community, but (Sun's) `FindClass' and friends need
slashes. */
- size_t i;
- for (i = 0; class->name[i] != 0; i++)
+ for (size_t i = 0; class->name[i] != 0; i++)
if (class->name[i] == '.')
class->name[i] = '/';
}
if (class->name[i] == '.')
class->name[i] = '/';
}
@@
-2274,7
+2269,6
@@
static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */
cjni_callback_info_t *cbi;
jobject o_ocitem;
const char *name;
cjni_callback_info_t *cbi;
jobject o_ocitem;
const char *name;
- size_t i;
jclass class;
jmethodID method;
jclass class;
jmethodID method;
@@
-2289,7
+2283,7
@@
static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */
name = ci->values[0].value.string;
cbi = NULL;
name = ci->values[0].value.string;
cbi = NULL;
- for (i = 0; i < java_callbacks_num; i++)
+ for (
size_t
i = 0; i < java_callbacks_num; i++)
{
if (java_callbacks[i].type != CB_TYPE_CONFIG)
continue;
{
if (java_callbacks[i].type != CB_TYPE_CONFIG)
continue;
@@
-2341,12
+2335,11
@@
static int cjni_config_perform (oconfig_item_t *ci) /* {{{ */
int success;
int errors;
int status;
int success;
int errors;
int status;
- int i;
success = 0;
errors = 0;
success = 0;
errors = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
@@
-2709,7
+2702,6
@@
static int cjni_match_target_create (const oconfig_item_t *ci, /* {{{ */
jobject o_ci;
jobject o_tmp;
int type;
jobject o_ci;
jobject o_tmp;
int type;
- size_t i;
cbi_ret = NULL;
o_ci = NULL;
cbi_ret = NULL;
o_ci = NULL;
@@
-2754,7
+2746,7
@@
static int cjni_match_target_create (const oconfig_item_t *ci, /* {{{ */
/* Lets see if we have a matching factory here.. */
cbi_factory = NULL;
/* Lets see if we have a matching factory here.. */
cbi_factory = NULL;
- for (i = 0; i < java_callbacks_num; i++)
+ for (
size_t
i = 0; i < java_callbacks_num; i++)
{
if (java_callbacks[i].type != type)
continue;
{
if (java_callbacks[i].type != type)
continue;
@@
-2936,9
+2928,8
@@
static int cjni_match_target_invoke (const data_set_t *ds, /* {{{ */
static int cjni_init_plugins (JNIEnv *jvm_env) /* {{{ */
{
int status;
static int cjni_init_plugins (JNIEnv *jvm_env) /* {{{ */
{
int status;
- size_t i;
- for (i = 0; i < java_callbacks_num; i++)
+ for (
size_t
i = 0; i < java_callbacks_num; i++)
{
if (java_callbacks[i].type != CB_TYPE_INIT)
continue;
{
if (java_callbacks[i].type != CB_TYPE_INIT)
continue;
@@
-2963,9
+2954,8
@@
static int cjni_init_plugins (JNIEnv *jvm_env) /* {{{ */
static int cjni_shutdown_plugins (JNIEnv *jvm_env) /* {{{ */
{
int status;
static int cjni_shutdown_plugins (JNIEnv *jvm_env) /* {{{ */
{
int status;
- size_t i;
- for (i = 0; i < java_callbacks_num; i++)
+ for (
size_t
i = 0; i < java_callbacks_num; i++)
{
if (java_callbacks[i].type != CB_TYPE_SHUTDOWN)
continue;
{
if (java_callbacks[i].type != CB_TYPE_SHUTDOWN)
continue;
@@
-2990,7
+2980,6
@@
static int cjni_shutdown (void) /* {{{ */
JNIEnv *jvm_env;
JavaVMAttachArgs args = { 0 };
int status;
JNIEnv *jvm_env;
JavaVMAttachArgs args = { 0 };
int status;
- size_t i;
if (jvm == NULL)
return (0);
if (jvm == NULL)
return (0);
@@
-3010,7
+2999,7
@@
static int cjni_shutdown (void) /* {{{ */
cjni_shutdown_plugins (jvm_env);
/* Release all the global references to callback functions */
cjni_shutdown_plugins (jvm_env);
/* Release all the global references to callback functions */
- for (i = 0; i < java_callbacks_num; i++)
+ for (
size_t
i = 0; i < java_callbacks_num; i++)
{
if (java_callbacks[i].object != NULL)
{
{
if (java_callbacks[i].object != NULL)
{
@@
-3023,7
+3012,7
@@
static int cjni_shutdown (void) /* {{{ */
sfree (java_callbacks);
/* Release all the global references to directly loaded classes. */
sfree (java_callbacks);
/* Release all the global references to directly loaded classes. */
- for (i = 0; i < java_classes_list_len; i++)
+ for (
size_t
i = 0; i < java_classes_list_len; i++)
{
if (java_classes_list[i].object != NULL)
{
{
if (java_classes_list[i].object != NULL)
{
@@
-3044,7
+3033,7
@@
static int cjni_shutdown (void) /* {{{ */
pthread_key_delete (jvm_env_key);
/* Free the JVM argument list */
pthread_key_delete (jvm_env_key);
/* Free the JVM argument list */
- for (i = 0; i < jvm_argc; i++)
+ for (
size_t
i = 0; i < jvm_argc; i++)
sfree (jvm_argv[i]);
jvm_argc = 0;
sfree (jvm_argv);
sfree (jvm_argv[i]);
jvm_argc = 0;
sfree (jvm_argv);