Code

fixed indentation ... gnu indent results are not realy beautifl. I might switch...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Wed, 27 Aug 2008 21:25:43 +0000 (21:25 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Wed, 27 Aug 2008 21:25:43 +0000 (21:25 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1466 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd.h
src/rrd_gfx.c
src/rrd_graph.c
src/rrd_open.c
src/rrd_update.c

index b6b51ee7eef893461f2cb5832509cd6d145ca127..83f4e4f11cc16315456da97ded27bec20497dfc6 100644 (file)
--- 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 */
 
index 74dce6b7e5ec1b1c100442acb02d8fbb2aa60bcd..cb42b8f2465d1831c47a3c77653feee5af2b4d80 100644 (file)
@@ -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
index 03027b13b80263f57336b79f7d82547d0364883c..8019d7fc221402f6e67960ac639a42b3d13f699b 100644 (file)
@@ -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
index e8aa1e484cafdba2fdd5240a87d6ae116a5bc6df..aa9350eb695397ca88b2e8c0747d7dc11f29ef0f 100644 (file)
@@ -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
index 3e6376d40d7180c21ae8ff740b3afe583e61313b..dc2a6753c10523c6b45f1e4d949773e375015e06 100644 (file)
@@ -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;
         }