/* format f minimal */
for ( des = 0 ; des < 5 ; des++)
{
- if (Fsepare("%.*f", des, &len, xmin, xmax, xpas)) break;
+ if (Fsepare("%.*f", des, &len, xmin, xmax, xpas))
+ {
+ break;
+ }
}
if ( des < 5 && len <= 6)
{
{
for ( des = 0 ; des < 5 ; des++)
{
- if (Fsepare("%.*e", des, &len, xmin, xmax, xpas)) break;
+ if (Fsepare("%.*e", des, &len, xmin, xmax, xpas))
+ {
+ break;
+ }
}
c = 'e';
strcpy(fmt, "%.*e");
sprintf(buf2, fmt, *desres, yy1 + xpas );
sscanf(buf1, "%lf", &x1);
sscanf(buf2, "%lf", &x2);
- if ( Abs((x2 - x1 - xpas) / xpas) >= 0.1) *desres += 1;
- if ( Abs((x1 - yy1) / xpas) >= 0.01) *desres += 1;
+ if ( Abs((x2 - x1 - xpas) / xpas) >= 0.1)
+ {
+ *desres += 1;
+ }
+ if ( Abs((x1 - yy1) / xpas) >= 0.01)
+ {
+ *desres += 1;
+ }
i++;
}
}
/** Take care of : sprintf(buf1,"%.*f",0,1.d230) which overflow in buf1 **/
/** we don't use %.*f format if numbers are two big **/
if (strcmp("%.*f", fmt) == 0 && (Abs(xmax) > 1.e+10 || Abs(xmin) > 1.e+10))
+ {
return(0);
+ }
sprintf(buf1, fmt, dec, xmin);
while ( x < xmax )
{
strcpy(buf2, buf1);
sprintf(buf1, fmt, dec, x);
*l = (((int)strlen(buf1) >= *l) ? (int) strlen(buf1) : *l) ;
- if ( strcmp(buf1, buf2) == 0) return(0);
+ if ( strcmp(buf1, buf2) == 0)
+ {
+ return(0);
+ }
}
return(1);
}
/* format f minimal */
for ( des = 0 ; des < 5 ; des++)
{
- if (Fsepare1("%.*f", des, &len, xx, nx)) break;
+ if (Fsepare1("%.*f", des, &len, xx, nx))
+ {
+ break;
+ }
}
if ( des < 5 && len <= 6)
{
{
for ( des = 0 ; des < 5 ; des++)
{
- if (Fsepare1("%.*e", des, &len, xx, nx)) break;
+ if (Fsepare1("%.*e", des, &len, xx, nx))
+ {
+ break;
+ }
}
c = 'e';
strcpy(fmt, "%.*e");
xpas = xx[i + 1] - xx[i];
if ( xpas != 0.0)
{
- if (Abs((x2 - x1 - xpas) / xpas) >= 0.1) *desres += 1;
- if (Abs((x1 - xx[i]) / xpas) >= 0.1) *desres += 1;
+ if (Abs((x2 - x1 - xpas) / xpas) >= 0.1)
+ {
+ *desres += 1;
+ }
+ if (Abs((x1 - xx[i]) / xpas) >= 0.1)
+ {
+ *desres += 1;
+ }
}
i++;
}
/** Take care of : sprintf(buf1,"%.*f",0,1.d230) which overflow in buf1 **/
/** we don't use %.*f format if numbers are two big **/
if (strcmp("%.*f", fmt) == 0 && (Abs(xx[nx - 1]) > 1.e+10 || Abs(xx[0]) > 1.e+10))
+ {
return(0);
+ }
sprintf(buf1, fmt, dec, xx[0]);
for ( i = 1 ; i < nx ; i++)
{
strcpy(buf2, buf1);
sprintf(buf1, fmt, dec, xx[i]);
*l = (((int)strlen(buf1) >= *l) ? (int) strlen(buf1) : *l) ;
- if ( strcmp(buf1, buf2) == 0) return(0);
+ if ( strcmp(buf1, buf2) == 0)
+ {
+ return(0);
+ }
}
return(1);
}
graduate1(&xmi1, &xma1, xi, xa, np1, np2, kminr, kmaxr, ar, 0);
}
else
+ {
graduate1(xmi, xma, xi, xa, np1, np2, kminr, kmaxr, ar, 0);
+ }
return(0);
}
,*kminr,*kmaxr,*ar,npr); */
*np2 = npr;
if ( *np2 <= 20 )
+ {
break;
+ }
else
+ {
b--;
+ }
}
/*
on veut essayer de ne pas depasser 10 intervalles ( *np2 <= 10)
des nombres et une sous graduation np1 juste avec des tirets.
*/
*np1 = 2 ;
- if ( *np2 <= 10 ) return ;
+ if ( *np2 <= 10 )
+ {
+ return ;
+ }
/* le nombre est > 10 : s'il est impair on rajoute 1
pour diviser par deux */
if ( *np2 % 2 == 1 )
x0a = x1a;
}
loc = Min( floor(x0 * exp10((double) - x1a)), ((double)DMAX));
- if ( loc < 0) loc = Max( loc, -((double) DMAX));
+ if ( loc < 0)
+ {
+ loc = Max( loc, -((double) DMAX));
+ }
kmin1 = (int) loc;
kmax1 = x1k;
np1 = Abs(kmax1 - kmin1);
if ( np1 > 10 )
{
if ((np1 % 2) == 0)
+ {
np1 /= 2;
+ }
else
{
np1++;
if ( np2 > 10 )
{
if ( np2 % 2 == 0)
+ {
np2 /= 2;
+ }
else
{
np2++;
*xa = (int) ceil(log10(x)) - b ;
*xk = (int) ceil(x / exp10((double) * xa));
xd = (*xk - 1) * exp10((double) * xa);
- if ( Abs((x - xd) / x) < epsilon ) *xk -= 1;
+ if ( Abs((x - xd) / x) < epsilon )
+ {
+ *xk -= 1;
+ }
}
else
{
* we increment xk
*/
xup = (*xk + 1) * exp10((double) * xa);
- if ( Abs((x - xup) / x) < epsilon ) *xk += 1;
+ if ( Abs((x - xup) / x) < epsilon )
+ {
+ *xk += 1;
+ }
}
else
{
}
for (i = 0; i < n; i++)
+ {
(*vector)[i] = val[i];
+ }
}
else if (xy_type == 'r')
{
if (checkdim)
{
if (nval != 3)
+ {
sciprint(_("Warning: %s must be changed, %s is '%s' and %s dimension is not %d.\n"), "tics_coord", "xy_type", "r", "tics_coord", 3);
+ }
if (nval < 3)
{
step = (val[1] - val[0]) / (n - 1);
for (i = 0; i < n - 1; i++)
+ {
(*vector)[i] = val[0] + i * step;
+ }
(*vector)[n - 1] = val[1]; /* xmax */
if (checkdim)
{
if (nval != 4)
+ {
sciprint(_("Warning: %s must be changed, %s is '%s' and %s dimension is not %d.\n"), "tics_coord", "xy_type", "i", "tics_coord", 4);
+ }
if (nval < 4)
{
for (i = 0; i < n - 1; i++)
+ {
(*vector)[i] = val[0] * exp10(val[2]) + i * step;
+ }
(*vector)[n - 1] = val[1] * exp10(val[2]); /* xmax */
int tmp = 0;
int* piTmp = &tmp;
- char ticksStyle;
+ char ticksStyle = 'v';
getGraphicObjectProperty(pobjUID, __GO_FORMATN__, jni_string, (void **)&c_format);