Update of /cvsroot/perfparse/_perfparse/cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27673/cgi
Modified Files:
perfgant.c
Log Message:
Replace round() with rint(). Hopefully this will fix compile problems on Solaris
Index: perfgant.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/cgi/perfgant.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** perfgant.c 13 Jun 2007 13:56:12 -0000 1.8
--- perfgant.c 8 Aug 2007 22:19:16 -0000 1.9
***************
*** 185,195 ****
int last_scale=-30;
for (i = 0; i < iDays; i++) {
! if((int) round(i*(dRowHeight + dRowGap)) - last_scale >20) {
! last_scale=(int) round(i*(dRowHeight + dRowGap));
t = i * DAY1 + tFromMidnight;
r = localtime(&t);
// sprintf(s, "%04d-%02d-%02d", r->tm_year + 1900, r->tm_mon + 1, r->tm_mday);
sprintf(s, "%02d-%02d", r->tm_mon + 1, r->tm_mday);
! gdImageString(gant, gdFontSmall, 8, (int) round(i*(dRowHeight + dRowGap)) + iBorder + 12,(unsigned char*) s, black);
switch (r->tm_wday) {
case 0: strncpy(s, _("Sun"),4); break;
--- 185,195 ----
int last_scale=-30;
for (i = 0; i < iDays; i++) {
! if((int) rint(i*(dRowHeight + dRowGap)) - last_scale >20) {
! last_scale=(int) rint(i*(dRowHeight + dRowGap));
t = i * DAY1 + tFromMidnight;
r = localtime(&t);
// sprintf(s, "%04d-%02d-%02d", r->tm_year + 1900, r->tm_mon + 1, r->tm_mday);
sprintf(s, "%02d-%02d", r->tm_mon + 1, r->tm_mday);
! gdImageString(gant, gdFontSmall, 8, (int) rint(i*(dRowHeight + dRowGap)) + iBorder + 12,(unsigned char*) s, black);
switch (r->tm_wday) {
case 0: strncpy(s, _("Sun"),4); break;
***************
*** 201,205 ****
case 6: strncpy(s, _("Sat"),4); break;
}
! gdImageString(gant, gdFontSmall, iWidth - iSideBorder + 15, (int) round(i*(dRowHeight + dRowGap)) + iBorder + 12,(unsigned char*) s, black);
}
}
--- 201,205 ----
case 6: strncpy(s, _("Sat"),4); break;
}
! gdImageString(gant, gdFontSmall, iWidth - iSideBorder + 15, (int) rint(i*(dRowHeight + dRowGap)) + iBorder + 12,(unsigned char*) s, black);
}
}
***************
*** 367,371 ****
int getY(time_t t)
{
! return (int) round(getDay(t)*(dRowHeight + dRowGap)) + iBorder + iRowGap;
}
--- 367,371 ----
int getY(time_t t)
{
! return (int) rint(getDay(t)*(dRowHeight + dRowGap)) + iBorder + iRowGap;
}
***************
*** 452,456 ****
iDays = (int)(tToMidnight - tFromMidnight) / DAY1;
! iHeight = iBorder * 2 + iRowHeight * iDays + (int) round(dRowGap) * (iDays + 1);
if(iHeight > 600) {
iHeight=600;
--- 452,456 ----
iDays = (int)(tToMidnight - tFromMidnight) / DAY1;
! iHeight = iBorder * 2 + iRowHeight * iDays + (int) rint(dRowGap) * (iDays + 1);
if(iHeight > 600) {
iHeight=600;
***************
*** 458,463 ****
dRowGap=dRowHeight/2;
}
! iRowHeight=(int) round(dRowHeight);
! iRowGap=(int) round(dRowGap);
#ifdef DEBUG
--- 458,463 ----
dRowGap=dRowHeight/2;
}
! iRowHeight=(int) rint(dRowHeight);
! iRowGap=(int) rint(dRowGap);
#ifdef DEBUG
|