From 8d5c098fc48eec23933b6548086bd6fbdc718cda 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@1401 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd.h | 4 ++-- program/src/rrd_error.c | 2 +- program/src/rrd_format.h | 2 +- program/src/rrd_gfx.c | 6 ++++-- program/src/rrd_info.c | 2 +- program/src/rrd_open.c | 14 +++++++------- program/src/rrd_update.c | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/program/src/rrd.h b/program/src/rrd.h index 5f4145bd..376d84f1 100644 --- a/program/src/rrd.h +++ b/program/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/program/src/rrd_error.c b/program/src/rrd_error.c index e64e2df1..e368ca75 100644 --- a/program/src/rrd_error.c +++ b/program/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/program/src/rrd_format.h b/program/src/rrd_format.h index 5828f90c..5d868576 100644 --- a/program/src/rrd_format.h +++ b/program/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/program/src/rrd_gfx.c b/program/src/rrd_gfx.c index 30a372af..aa7b3ae9 100644 --- a/program/src/rrd_gfx.c +++ b/program/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/program/src/rrd_info.c b/program/src/rrd_info.c index 13d30a6c..f53a752e 100644 --- a/program/src/rrd_info.c +++ b/program/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/program/src/rrd_open.c b/program/src/rrd_open.c index e1685d29..c0e48359 100644 --- a/program/src/rrd_open.c +++ b/program/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/program/src/rrd_update.c b/program/src/rrd_update.c index 66b46700..44dddf28 100644 --- a/program/src/rrd_update.c +++ b/program/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.30.2