X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fpyvalues.c;h=301df4429f0b96fb816c6bbed65b7c070a70ab08;hp=15c1848488e70ead655ea1d2d0744572b371cd2b;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=ba1015262cdc912f9d01ab5a76037e65033c54c5 diff --git a/src/pyvalues.c b/src/pyvalues.c index 15c18484..301df442 100644 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@ -38,7 +38,7 @@ typedef struct { int (*add_signed_int)(void *, const char *, int64_t); int (*add_unsigned_int)(void *, const char *, uint64_t); int (*add_double)(void *, const char *, double); - int (*add_boolean)(void *, const char *, _Bool); + int (*add_boolean)(void *, const char *, bool); } cpy_build_meta_handler_t; #define FreeAll() \ @@ -52,9 +52,8 @@ typedef struct { static PyObject *cpy_common_repr(PyObject *s) { PyObject *ret, *tmp; - static PyObject *l_type = NULL, *l_type_instance = NULL, *l_plugin = NULL, - *l_plugin_instance = NULL; - static PyObject *l_host = NULL, *l_time = NULL; + static PyObject *l_type, *l_type_instance, *l_plugin, *l_plugin_instance; + static PyObject *l_host, *l_time; PluginData *self = (PluginData *)s; if (l_type == NULL) @@ -203,7 +202,7 @@ static int PluginData_init(PyObject *s, PyObject *args, PyObject *kwds) { static PyObject *PluginData_repr(PyObject *s) { PyObject *ret; - static PyObject *l_closing = NULL; + static PyObject *l_closing; if (l_closing == NULL) l_closing = cpy_string_to_unicode_or_bytes(")"); @@ -562,7 +561,7 @@ static int cpy_build_meta_generic(PyObject *meta, CPY_BUILD_META_FUNC(meta_type, func_prefix##_add_signed_int, int64_t) \ CPY_BUILD_META_FUNC(meta_type, func_prefix##_add_unsigned_int, uint64_t) \ CPY_BUILD_META_FUNC(meta_type, func_prefix##_add_double, double) \ - CPY_BUILD_META_FUNC(meta_type, func_prefix##_add_boolean, _Bool) \ + CPY_BUILD_META_FUNC(meta_type, func_prefix##_add_boolean, bool) \ \ static cpy_build_meta_handler_t cpy_##func_prefix = { \ .add_string = cpy_##func_prefix##_add_string, \ @@ -641,7 +640,8 @@ static PyObject *Values_dispatch(Values *self, PyObject *args, PyObject *kwds) { } size = (size_t)PySequence_Length(values); if (size != ds->ds_num) { - PyErr_Format(PyExc_RuntimeError, "type %s needs %zu values, got %zu", + PyErr_Format(PyExc_RuntimeError, + "type %s needs %" PRIsz " values, got %" PRIsz, value_list.type, ds->ds_num, size); return NULL; } @@ -765,7 +765,8 @@ static PyObject *Values_write(Values *self, PyObject *args, PyObject *kwds) { } size = (size_t)PySequence_Length(values); if (size != ds->ds_num) { - PyErr_Format(PyExc_RuntimeError, "type %s needs %zu values, got %zu", + PyErr_Format(PyExc_RuntimeError, + "type %s needs %" PRIsz " values, got %" PRIsz, value_list.type, ds->ds_num, size); return NULL; } @@ -841,8 +842,7 @@ static PyObject *Values_write(Values *self, PyObject *args, PyObject *kwds) { static PyObject *Values_repr(PyObject *s) { PyObject *ret, *tmp; - static PyObject *l_interval = NULL, *l_values = NULL, *l_meta = NULL, - *l_closing = NULL; + static PyObject *l_interval, *l_values, *l_meta, *l_closing; Values *self = (Values *)s; if (l_interval == NULL) @@ -1144,8 +1144,7 @@ static int Notification_setstring(PyObject *self, PyObject *value, void *data) { static PyObject *Notification_repr(PyObject *s) { PyObject *ret, *tmp; - static PyObject *l_severity = NULL, *l_message = NULL, *l_meta = NULL, - *l_closing = NULL; + static PyObject *l_severity, *l_message, *l_meta, *l_closing; Notification *self = (Notification *)s; if (l_severity == NULL)