Standardize variable name.

This commit is contained in:
Hisham Muhammad 2015-08-20 01:27:07 -03:00
parent f019f4cd9e
commit 4597014ea3

18
Meter.c
View File

@ -329,7 +329,7 @@ static const char* GraphMeterMode_dotsAscii[] = {
};
static const char** GraphMeterMode_dots;
static int pixperrow;
static int GraphMeterMode_pixPerRow;
static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
@ -340,12 +340,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
#ifdef HAVE_LIBNCURSESW
if (CRT_utf8) {
GraphMeterMode_dots = GraphMeterMode_dotsUtf8;
pixperrow = PIXPERROW_UTF8;
GraphMeterMode_pixPerRow = PIXPERROW_UTF8;
} else
#endif
{
GraphMeterMode_dots = GraphMeterMode_dotsAscii;
pixperrow = PIXPERROW_ASCII;
GraphMeterMode_pixPerRow = PIXPERROW_ASCII;
}
attrset(CRT_colors[METER_TEXT]);
@ -375,17 +375,17 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
}
for (int i = nValues - (w*2) + 2, k = 0; i < nValues; i+=2, k++) {
const double dot = (1.0 / (pixperrow * 4));
int v1 = MIN(pixperrow * 4, MAX(1, data->values[i] / dot));
int v2 = MIN(pixperrow * 4, MAX(1, data->values[i+1] / dot));
const double dot = (1.0 / (GraphMeterMode_pixPerRow * 4));
int v1 = MIN(GraphMeterMode_pixPerRow * 4, MAX(1, data->values[i] / dot));
int v2 = MIN(GraphMeterMode_pixPerRow * 4, MAX(1, data->values[i+1] / dot));
int colorIdx = GRAPH_1;
for (int line = 0; line < 4; line++) {
int line1 = MIN(pixperrow, MAX(0, v1 - (pixperrow * (3 - line))));
int line2 = MIN(pixperrow, MAX(0, v2 - (pixperrow * (3 - line))));
int line1 = MIN(GraphMeterMode_pixPerRow, MAX(0, v1 - (GraphMeterMode_pixPerRow * (3 - line))));
int line2 = MIN(GraphMeterMode_pixPerRow, MAX(0, v2 - (GraphMeterMode_pixPerRow * (3 - line))));
attrset(CRT_colors[colorIdx]);
mvaddstr(y+line, x+k, GraphMeterMode_dots[line1 * (pixperrow + 1) + line2]);
mvaddstr(y+line, x+k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]);
colorIdx = GRAPH_2;
}
}