From 728d3d0bb29ba4a73b9c7c19f03e7e4ba687be84 Mon Sep 17 00:00:00 2001 From: oetiker Date: Wed, 27 Aug 2008 21:25:43 +0000 Subject: [PATCH] fixed indentation ... gnu indent results are not realy beautifl. I might switch to uncrustify. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1466 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd.h | 75 ++++++++++++++++++++++++++++++++++---------------------- src/rrd_gfx.c | 4 +-- src/rrd_graph.c | 20 ++++++++------- src/rrd_open.c | 1 - src/rrd_update.c | 18 +++++++------- 5 files changed, 68 insertions(+), 50 deletions(-) diff --git a/src/rrd.h b/src/rrd.h index b6b51ee..83f4e4f 100644 --- a/src/rrd.h +++ b/src/rrd.h @@ -322,36 +322,53 @@ extern "C" { #if defined(__GNUC__) && defined (RRD_EXPORT_DEPRECATED) # define RRD_DEPRECATED __attribute__((deprecated)) #else -# define RRD_DEPRECATED /**/ +# define RRD_DEPRECATED /**/ #endif - - void rrd_free (rrd_t *rrd) - RRD_DEPRECATED; - void rrd_init (rrd_t *rrd) - RRD_DEPRECATED; - - rrd_file_t *rrd_open (const char *const file_name, rrd_t *rrd, - unsigned rdwr) - RRD_DEPRECATED; - - void rrd_dontneed (rrd_file_t *rrd_file, rrd_t *rrd) - RRD_DEPRECATED; - int rrd_close (rrd_file_t *rrd_file) - RRD_DEPRECATED; - ssize_t rrd_read (rrd_file_t *rrd_file, void *buf, size_t count) - RRD_DEPRECATED; - ssize_t rrd_write (rrd_file_t *rrd_file, - const void *buf, size_t count) - RRD_DEPRECATED; - void rrd_flush (rrd_file_t *rrd_file) - RRD_DEPRECATED; - off_t rrd_seek (rrd_file_t *rrd_file, off_t off, int whence) - RRD_DEPRECATED; - off_t rrd_tell (rrd_file_t *rrd_file) - RRD_DEPRECATED; - int rrd_lock (rrd_file_t *file) - RRD_DEPRECATED; -#endif /* defined(_RRD_TOOL_H) || defined(RRD_EXPORT_DEPRECATED) */ + void rrd_free( + rrd_t *rrd) + RRD_DEPRECATED; + void rrd_init( + rrd_t *rrd) + RRD_DEPRECATED; + + rrd_file_t *rrd_open( + const char *const file_name, + rrd_t *rrd, + unsigned rdwr) + RRD_DEPRECATED; + + void rrd_dontneed( + rrd_file_t *rrd_file, + rrd_t *rrd) + RRD_DEPRECATED; + int rrd_close( + rrd_file_t *rrd_file) + RRD_DEPRECATED; + ssize_t rrd_read( + rrd_file_t *rrd_file, + void *buf, + size_t count) + RRD_DEPRECATED; + ssize_t rrd_write( + rrd_file_t *rrd_file, + const void *buf, + size_t count) + RRD_DEPRECATED; + void rrd_flush( + rrd_file_t *rrd_file) + RRD_DEPRECATED; + off_t rrd_seek( + rrd_file_t *rrd_file, + off_t off, + int whence) + RRD_DEPRECATED; + off_t rrd_tell( + rrd_file_t *rrd_file) + RRD_DEPRECATED; + int rrd_lock( + rrd_file_t *file) + RRD_DEPRECATED; +#endif /* defined(_RRD_TOOL_H) || defined(RRD_EXPORT_DEPRECATED) */ #endif /* _RRDLIB_H */ diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 74dce6b..cb42b8f 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -136,7 +136,7 @@ static PangoLayout *gfx_prep_text( long tab_shift = fmod(x, tabwidth); int border = im->text_prop[TEXT_PROP_LEGEND].size * 2.0; - gchar *utf8_text; + gchar *utf8_text; PangoTabArray *tab_array; PangoContext *pango_context; @@ -163,7 +163,7 @@ static PangoLayout *gfx_prep_text( pango_layout_set_font_description(layout, font_desc); /* pango expects the string to be utf-8 encoded */ - utf8_text = g_locale_to_utf8((const gchar *)text, -1, NULL, NULL, NULL); + utf8_text = g_locale_to_utf8((const gchar *) text, -1, NULL, NULL, NULL); /* In case of an error, i.e. utf8_text == NULL (locale settings messed * up?), we fall back to a possible "invalid UTF-8 string" warning instead diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 03027b1..8019d7f 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -2969,7 +2969,7 @@ int graph_paint( * if there are no graph elements (i==0) we stop here ... * if we are lazy, try to quit ... */ - i = print_calc(im); + i = print_calc(im); if (i < 0) return -1; @@ -3567,7 +3567,7 @@ int rrd_graph( *ysize = 0; *ymin = 0; *ymax = 0; - while (walker) { + while (walker) { if (strcmp(walker->key, "image_width") == 0) { *xsize = walker->value.u_int; } else if (strcmp(walker->key, "image_height") == 0) { @@ -3667,10 +3667,12 @@ rrd_info_t *rrd_graph_v( if (im.imginfo) { rrd_infoval_t info; - char *filename; - filename=im.graphfile+strlen(im.graphfile); - while(filename > im.graphfile) { - if (*(filename-1)=='/' || *(filename-1)=='\\' ) break; + char *filename; + + filename = im.graphfile + strlen(im.graphfile); + while (filename > im.graphfile) { + if (*(filename - 1) == '/' || *(filename - 1) == '\\') + break; filename--; } info.u_str = @@ -4453,9 +4455,9 @@ int vdef_calc( src = &im->gdes[dst->vidx]; data = src->data + src->ds; end = - src->end_orig % (long)src->step == - 0 ? src->end_orig : (src->end_orig + (long)src->step - - src->end_orig % (long)src->step); + src->end_orig % (long) src->step == + 0 ? src->end_orig : (src->end_orig + (long) src->step - + src->end_orig % (long) src->step); steps = (end - src->start) / src->step; #if 0 diff --git a/src/rrd_open.c b/src/rrd_open.c index e8aa1e4..aa9350e 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -116,7 +116,6 @@ rrd_file_t *rrd_open( mm_flags |= MAP_NONBLOCK; /* just populate ptes */ #endif } - #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) flags |= O_BINARY; #endif diff --git a/src/rrd_update.c b/src/rrd_update.c index 3e6376d..dc2a675 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -502,15 +502,15 @@ int _rrd_update( rra_step_cnt, updvals, tmpl_idx, tmpl_cnt, &pcdp_summary, version, skip_update, &schedule_smooth) == -1) { - if (rrd_test_error()) { /* Should have error string always here */ - char *save_error; - - /* Prepend file name to error message */ - if ((save_error = strdup(rrd_get_error())) != NULL) { - rrd_set_error("%s: %s", filename, save_error); - free(save_error); - } - } + if (rrd_test_error()) { /* Should have error string always here */ + char *save_error; + + /* Prepend file name to error message */ + if ((save_error = strdup(rrd_get_error())) != NULL) { + rrd_set_error("%s: %s", filename, save_error); + free(save_error); + } + } free(arg_copy); break; } -- 2.11.0