From 7bd35b8d099910071a57c66687f6ef79c5df9a5c Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 5 Jun 2008 19:59:18 +0000 Subject: [PATCH] fixed indenting git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1401 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd.h | 4 ++-- src/rrd_error.c | 2 +- src/rrd_format.h | 2 +- src/rrd_gfx.c | 6 ++++-- src/rrd_info.c | 2 +- src/rrd_open.c | 14 +++++++------- src/rrd_update.c | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/rrd.h b/src/rrd.h index 5f4145b..376d84f 100644 --- a/src/rrd.h +++ b/src/rrd.h @@ -231,8 +231,8 @@ extern "C" { /* 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 */ diff --git a/src/rrd_error.c b/src/rrd_error.c index e64e2df..e368ca7 100644 --- a/src/rrd_error.c +++ b/src/rrd_error.c @@ -122,7 +122,7 @@ struct rrd_context *rrd_new_context( struct rrd_context *rrd_ctx = (struct rrd_context *) malloc(sizeof(struct rrd_context)); - if (! rrd_ctx) { + if (!rrd_ctx) { return NULL; } diff --git a/src/rrd_format.h b/src/rrd_format.h index 5828f90..5d86857 100644 --- a/src/rrd_format.h +++ b/src/rrd_format.h @@ -384,7 +384,7 @@ typedef struct rrd_t { 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 */ diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 30a372a..aa7b3ae 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -139,7 +139,8 @@ static PangoLayout *gfx_prep_text( 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, @@ -155,7 +156,8 @@ static PangoLayout *gfx_prep_text( 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; } diff --git a/src/rrd_info.c b/src/rrd_info.c index 13d30a6..f53a752 100644 --- a/src/rrd_info.c +++ b/src/rrd_info.c @@ -23,7 +23,7 @@ char *sprintf_alloc( 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 diff --git a/src/rrd_open.c b/src/rrd_open.c index e1685d2..c0e4835 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -226,13 +226,13 @@ rrd_file_t *rrd_open( 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 { @@ -528,8 +528,8 @@ void rrd_init( 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 diff --git a/src/rrd_update.c b/src/rrd_update.c index 66b4670..44dddf2 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -832,7 +832,7 @@ static int process_arg( 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); -- 2.11.0