diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-27 20:22:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-27 20:22:09 +0300 |
commit | db4ab01eb1d39593351b3ac15a92286a50868814 (patch) | |
tree | 7431377c532f50d7f0832fcb7f8536d70bd2d2c7 | |
parent | 4d22b4e8668cc717440d66120b8607be9a273c97 (diff) | |
download | tagr-db4ab01eb1d39593351b3ac15a92286a50868814.tar.gz tagr-db4ab01eb1d39593351b3ac15a92286a50868814.tar.bz2 |
Minor changes
-rw-r--r-- | src/graph.c | 14 | ||||
-rw-r--r-- | src/html.gram.y | 4 | ||||
-rw-r--r-- | src/main.c | 27 |
3 files changed, 9 insertions, 36 deletions
diff --git a/src/graph.c b/src/graph.c index 1464e8b..8088773 100644 --- a/src/graph.c +++ b/src/graph.c @@ -153,7 +153,7 @@ draw_graph (FILE *fp, xtr (x), ytr (0), xtr (x), ytr (tnext.inrate), i_in); gdImageLine (graph, xtr (x), ytr (th.inrate), - xtr (x+1), ytr (tnext.inrate), i_in); + xtr (x + xstep), ytr (tnext.inrate), i_in); } /* Outgoing traffic */ @@ -166,7 +166,7 @@ draw_graph (FILE *fp, scale_sample (mon, queue_get_ptr (dataq, i - 1), &tnext); gdImageLine (graph, xtr (x), ytr (th.outrate), - xtr (x+1), ytr (tnext.outrate), gdBrushed); + xtr (x + xstep), ytr (tnext.outrate), gdBrushed); } /* Border */ @@ -196,13 +196,13 @@ draw_graph (FILE *fp, /* Left tick */ gdImageLine (graph, - xtr (-2), y, - xtr (1), y, + xtr (0) - 2, y, + xtr (0) + 1, y, i_grid); /* Right tick */ gdImageLine (graph, - xtr (xmax - 1), y, - xtr (xmax + 1), y, + xtr (xmax) - 1, y, + xtr (xmax) + 1, y, i_grid); /* Grid line */ @@ -230,7 +230,7 @@ draw_graph (FILE *fp, /* Tick */ gdImageLine (graph, - x, ytr (-2), x, ytr (1), + x, ytr (0) - 2, x, ytr (0) + 1, i_grid); /* Grid line */ gdImageLine (graph, diff --git a/src/html.gram.y b/src/html.gram.y index e488494..32e464e 100644 --- a/src/html.gram.y +++ b/src/html.gram.y @@ -60,8 +60,8 @@ static void deduce_format (pp_value_t *res, %% -input: list - ; +input : list + ; list : item @@ -636,33 +636,6 @@ sig_child (int sig) signal (sig, sig_child); } -void -assign_string (char **pstr, const char *s) -{ - free (*pstr); - if (s) - { - *pstr = xmalloc (strlen (s) + 1); - strcpy (*pstr, s); - } - else - *pstr = NULL; -} - -void -assign_string_n (char **pstr, const char *s, size_t length) -{ - free (*pstr); - if (s) - { - *pstr = xmalloc (length + 1); - memcpy (*pstr, s, length); - (*pstr)[length] = 0; - } - else - *pstr = NULL; -} - char * mkfilename (const char *dir, const char *name, const char *suffix) { |