X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=cdacbb7795ec0060ae24dca4d797d47b99dc28a6;hb=61a4ed99b1a5b6d371bb745933d0efc5dff9505c;hp=671d1f3fa41b1353c35f8fae01d64117aa017f27;hpb=3d887357f3c5034bd95731734f4b5c79b0b00ad0;p=collectd.git diff --git a/src/perl.c b/src/perl.c index 671d1f3f..cdacbb77 100644 --- a/src/perl.c +++ b/src/perl.c @@ -138,8 +138,8 @@ static int perl_flush(cdtime_t timeout, const char *identifier, typedef struct c_ithread_s { /* the thread's Perl interpreter */ PerlInterpreter *interp; - _Bool running; /* thread is inside Perl interpreter */ - _Bool shutdown; + bool running; /* thread is inside Perl interpreter */ + bool shutdown; pthread_t pthread; /* double linked list of threads */ @@ -183,7 +183,7 @@ extern char **environ; * private variables */ -static _Bool register_legacy_flush = 1; +static bool register_legacy_flush = 1; /* if perl_threads != NULL perl_threads->head must * point to the "base" thread */ @@ -331,12 +331,12 @@ static size_t av2value(pTHX_ char *name, AV *array, value_t *value, if (array_len < ds->ds_num) { log_warn("av2value: array does not contain enough elements for type " - "\"%s\": got %zu, want %zu", + "\"%s\": got %" PRIsz ", want %" PRIsz, name, array_len, ds->ds_num); return 0; } else if (array_len > ds->ds_num) { log_warn("av2value: array contains excess elements for type \"%s\": got " - "%zu, want %zu", + "%" PRIsz ", want %" PRIsz, name, array_len, ds->ds_num); } @@ -706,10 +706,8 @@ static int value_list2hv(pTHX_ value_list_t *vl, data_set_t *ds, HV *hash) { static int notification_meta2av(pTHX_ notification_meta_t *meta, AV *array) { int meta_num = 0; - - while (meta) { + for (notification_meta_t *m = meta; m != NULL; m = m->next) { ++meta_num; - meta = meta->next; } av_extend(array, meta_num); @@ -983,7 +981,7 @@ static int pplugin_dispatch_notification(pTHX_ HV *notif) { * Call perl sub with thread locking flags handled. */ static int call_pv_locked(pTHX_ const char *sub_name) { - _Bool old_running; + bool old_running; int ret; c_ithread_t *t = (c_ithread_t *)pthread_getspecific(perl_thr_key);