/* END parsetime.h */
struct rrd_context {
- char lib_errstr[256];
- char rrd_error[4096];
+ char lib_errstr[256];
+ char rrd_error[4096];
};
/* returns the current per-thread rrd_context */
struct rrd_context *rrd_ctx =
(struct rrd_context *) malloc(sizeof(struct rrd_context));
- if (! rrd_ctx) {
+ if (!rrd_ctx) {
return NULL;
}
ds_def_t *ds_def; /* list of data source definitions */
rra_def_t *rra_def; /* list of round robin archive def */
live_head_t *live_head; /* rrd v >= 3 last_up with us */
- time_t *legacy_last_up; /* rrd v < 3 last_up time */
+ time_t *legacy_last_up; /* rrd v < 3 last_up time */
pdp_prep_t *pdp_prep; /* pdp data prep area */
cdp_prep_t *cdp_prep; /* cdp prep area */
rra_ptr_t *rra_ptr; /* list of rra pointers */
tab_array = pango_tab_array_new(tab_count, (gboolean) (1));
for (i = 1; i <= tab_count; i++) {
pango_tab_array_set_tab(tab_array,
- i, PANGO_TAB_LEFT, tabwidth * i - tab_shift+border);
+ i, PANGO_TAB_LEFT,
+ tabwidth * i - tab_shift + border);
}
cairo_new_path(cr);
cairo_set_source_rgba(cr, color.red, color.green, color.blue,
font_desc = pango_font_description_from_string(font);
pango_font_description_set_size(font_desc, size * PANGO_SCALE);
pango_layout_set_font_description(layout, font_desc);
- pango_layout_set_markup(layout, text, -1);
+ if (im->with_markup)
+ pango_layout_set_markup(layout, text, -1);
return layout;
}
int maxlen = 1024 + strlen(fmt);
char *str = NULL;
va_list argp;
- str = malloc(sizeof(char) * (maxlen+1));
+ str = malloc(sizeof(char) * (maxlen + 1));
if (str != NULL) {
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
rrd_set_error("live_head_t malloc");
goto out_close;
}
-
#if defined USE_MADVISE
/* the live_head will be needed soonish, so hint accordingly */
- madvise(data + PAGE_START(offset),
- sizeof(time_t), MADV_WILLNEED);
-#endif
- __rrd_read(rrd->legacy_last_up,time_t,1);
+ madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED);
+#endif
+ __rrd_read(rrd->legacy_last_up, time_t,
+ 1);
+
rrd->live_head->last_up = *rrd->legacy_last_up;
rrd->live_head->last_up_usec = 0;
} else {
void rrd_free(
rrd_t *rrd)
{
- if (rrd->legacy_last_up){ /* this gets set for version < 3 only */
- free(rrd->live_head);
+ if (rrd->legacy_last_up) { /* this gets set for version < 3 only */
+ free(rrd->live_head);
}
}
#else
rrd->live_head->last_up = *current_time;
rrd->live_head->last_up_usec = *current_time_usec;
- if ( version < 3 ){
+ if (version < 3) {
*rrd->legacy_last_up = rrd->live_head->last_up;
}
free(seasonal_coef);