projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
port forward of fixes from the stable version of rrd_cgi
[rrdtool.git]
/
src
/
rrd_graph.c
diff --git
a/src/rrd_graph.c
b/src/rrd_graph.c
index
36c8054
..
6d91954
100644
(file)
--- a/
src/rrd_graph.c
+++ b/
src/rrd_graph.c
@@
-41,7
+41,7
@@
char rrd_win_default_font[80];
text_prop_t text_prop[] = {
{ 10.0, RRD_DEFAULT_FONT }, /* default */
text_prop_t text_prop[] = {
{ 10.0, RRD_DEFAULT_FONT }, /* default */
- { 1
2
.0, RRD_DEFAULT_FONT }, /* title */
+ { 1
0
.0, RRD_DEFAULT_FONT }, /* title */
{ 8.0, RRD_DEFAULT_FONT }, /* axis */
{ 10.0, RRD_DEFAULT_FONT }, /* unit */
{ 10.0, RRD_DEFAULT_FONT } /* legend */
{ 8.0, RRD_DEFAULT_FONT }, /* axis */
{ 10.0, RRD_DEFAULT_FONT }, /* unit */
{ 10.0, RRD_DEFAULT_FONT } /* legend */
@@
-601,7
+601,7
@@
printf("row_cnt after: %lu\n",row_cnt);
** into one interval for the destination.
*/
** into one interval for the destination.
*/
- for (dst_row=0;row_cnt>=reduce_factor;dst_row++) {
+ for (dst_row=0;
(long int)
row_cnt>=reduce_factor;dst_row++) {
for (col=0;col<(*ds_cnt);col++) {
rrd_value_t newval=DNAN;
unsigned long validval=0;
for (col=0;col<(*ds_cnt);col++) {
rrd_value_t newval=DNAN;
unsigned long validval=0;
@@
-681,11
+681,11
@@
for (col=0;col<row_cnt;col++) {
int
data_fetch(image_desc_t *im )
{
int
data_fetch(image_desc_t *im )
{
-
unsigned
int i,ii;
+ int i,ii;
int skip;
/* pull the data from the log files ... */
int skip;
/* pull the data from the log files ... */
- for (i=0;i<im->gdes_c;i++){
+ for (i=0;i<
(int)
im->gdes_c;i++){
/* only GF_DEF elements fetch data */
if (im->gdes[i].gf != GF_DEF)
continue;
/* only GF_DEF elements fetch data */
if (im->gdes[i].gf != GF_DEF)
continue;
@@
-743,8
+743,8
@@
data_fetch(image_desc_t *im )
}
}
}
}
- /* lets see if the required data source is realy there */
- for(ii=0;ii<im->gdes[i].ds_cnt;ii++){
+ /* lets see if the required data source is real
l
y there */
+ for(ii=0;ii<
(int)
im->gdes[i].ds_cnt;ii++){
if(strcmp(im->gdes[i].ds_namv[ii],im->gdes[i].ds_nam) == 0){
im->gdes[i].ds=ii; }
}
if(strcmp(im->gdes[i].ds_namv[ii],im->gdes[i].ds_nam) == 0){
im->gdes[i].ds=ii; }
}
@@
-913,7
+913,8
@@
data_calc( image_desc_t *im){
im->gdes[gdi].rpnp[rpi].op == OP_PREV_OTHER){
long ptr = im->gdes[gdi].rpnp[rpi].ptr;
if(im->gdes[gdi].start > im->gdes[ptr].start) {
im->gdes[gdi].rpnp[rpi].op == OP_PREV_OTHER){
long ptr = im->gdes[gdi].rpnp[rpi].ptr;
if(im->gdes[gdi].start > im->gdes[ptr].start) {
- im->gdes[gdi].rpnp[rpi].data += im->gdes[gdi].rpnp[rpi].ds_cnt;
+ im->gdes[gdi].rpnp[rpi].data += im->gdes[gdi].rpnp[rpi].ds_cnt
+ * ((im->gdes[gdi].start - im->gdes[ptr].start) / im->gdes[ptr].step);
}
}
}
}
}
}
@@
-1015,8
+1016,8
@@
data_proc( image_desc_t *im ){
** the time of the graph. Beware.
*/
vidx = im->gdes[ii].vidx;
** the time of the graph. Beware.
*/
vidx = im->gdes[ii].vidx;
- if ( (
gr_time >=
im->gdes[vidx].start) &&
- (
gr_time <=
im->gdes[vidx].end) ) {
+ if ( (
(long int)gr_time >= (long int)
im->gdes[vidx].start) &&
+ (
(long int)gr_time <= (long int)
im->gdes[vidx].end) ) {
value = im->gdes[vidx].data[
(unsigned long) floor(
(double)(gr_time - im->gdes[vidx].start)
value = im->gdes[vidx].data[
(unsigned long) floor(
(double)(gr_time - im->gdes[vidx].start)
@@
-1900,16
+1901,16
@@
grid_paint(image_desc_t *im)
7, (im->yorigin - im->ysize/2),
im->graph_col[GRC_FONT],
im->text_prop[TEXT_PROP_AXIS].font,
7, (im->yorigin - im->ysize/2),
im->graph_col[GRC_FONT],
im->text_prop[TEXT_PROP_AXIS].font,
- im->text_prop[TEXT_PROP_AXIS].size, im->tabwidth, 270.0,
+ im->text_prop[TEXT_PROP_AXIS].size, im->tabwidth,
+ RRDGRAPH_YLEGEND_ANGLE,
GFX_H_LEFT, GFX_V_CENTER,
im->ylegend);
} else {
/* horrible hack until we can actually print vertically */
{
int n;
GFX_H_LEFT, GFX_V_CENTER,
im->ylegend);
} else {
/* horrible hack until we can actually print vertically */
{
int n;
- int l=strlen(im->ylegend);
char s[2];
char s[2];
- for (n=0;n<strlen(im->ylegend);n++) {
+ for (n=0;n<
(int)
strlen(im->ylegend);n++) {
s[0]=im->ylegend[n];
s[1]='\0';
gfx_new_text(im->canvas,7,im->text_prop[TEXT_PROP_AXIS].size*(n+1),
s[0]=im->ylegend[n];
s[1]='\0';
gfx_new_text(im->canvas,7,im->text_prop[TEXT_PROP_AXIS].size*(n+1),
@@
-2852,13
+2853,13
@@
rrd_graph_options(int argc, char *argv[],image_desc_t *im)
&im->xlab_user.precis,
&stroff) == 7 && stroff != 0){
strncpy(im->xlab_form, optarg+stroff, sizeof(im->xlab_form) - 1);
&im->xlab_user.precis,
&stroff) == 7 && stroff != 0){
strncpy(im->xlab_form, optarg+stroff, sizeof(im->xlab_form) - 1);
- if((im->xlab_user.gridtm = tmt_conv(scan_gtm)) == -1){
+ if((i
nt)(i
m->xlab_user.gridtm = tmt_conv(scan_gtm)) == -1){
rrd_set_error("unknown keyword %s",scan_gtm);
return;
rrd_set_error("unknown keyword %s",scan_gtm);
return;
- } else if ((im->xlab_user.mgridtm = tmt_conv(scan_mtm)) == -1){
+ } else if ((i
nt)(i
m->xlab_user.mgridtm = tmt_conv(scan_mtm)) == -1){
rrd_set_error("unknown keyword %s",scan_mtm);
return;
rrd_set_error("unknown keyword %s",scan_mtm);
return;
- } else if ((im->xlab_user.labtm = tmt_conv(scan_ltm)) == -1){
+ } else if ((i
nt)(i
m->xlab_user.labtm = tmt_conv(scan_ltm)) == -1){
rrd_set_error("unknown keyword %s",scan_ltm);
return;
}
rrd_set_error("unknown keyword %s",scan_ltm);
return;
}
@@
-2935,7
+2936,7
@@
rrd_graph_options(int argc, char *argv[],image_desc_t *im)
im->imginfo = optarg;
break;
case 'a':
im->imginfo = optarg;
break;
case 'a':
- if((im->canvas->imgformat = if_conv(optarg)) == -1) {
+ if((i
nt)(i
m->canvas->imgformat = if_conv(optarg)) == -1) {
rrd_set_error("unsupported graphics format '%s'",optarg);
return;
}
rrd_set_error("unsupported graphics format '%s'",optarg);
return;
}
@@
-3166,12
+3167,12
@@
char *str;
n=0;
sscanf(str,"%le,%29[A-Z]%n",¶m,func,&n);
n=0;
sscanf(str,"%le,%29[A-Z]%n",¶m,func,&n);
- if (n==strlen(str)) { /* matched */
+ if (n==
(int)
strlen(str)) { /* matched */
;
} else {
n=0;
sscanf(str,"%29[A-Z]%n",func,&n);
;
} else {
n=0;
sscanf(str,"%29[A-Z]%n",func,&n);
- if (n==strlen(str)) { /* matched */
+ if (n==
(int)
strlen(str)) { /* matched */
param=DNAN;
} else {
rrd_set_error("Unknown function string '%s' in VDEF '%s'"
param=DNAN;
} else {
rrd_set_error("Unknown function string '%s' in VDEF '%s'"