Fix more MSVC warnings in test apps (#109)

- test/checkers.cxx
 - test/cube.cxx
 - test/offscreen.cxx
 - test/unittest_simple_terminal.cxx
 - test/utf8.cxx
This commit is contained in:
Albrecht Schlosser
2021-08-31 17:49:31 +02:00
parent e5310144b7
commit ef86d9aced
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -1305,7 +1305,7 @@ int didabort(void) {
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
seed = time(0); seed = (int)time(0);
newgame(); newgame();
#ifdef BOTH #ifdef BOTH
fl_register_images(); fl_register_images();
+2 -2
View File
@@ -100,14 +100,14 @@ void cube_box::draw() {
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
glFrustum(-1,1,-1,1,2,10000); glFrustum(-1,1,-1,1,2,10000);
glTranslatef(0,0,-10); glTranslatef(0,0,-10);
glClearColor(0.4, 0.4, 0.4, 0); glClearColor(0.4f, 0.4f, 0.4f, 0);
} }
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix(); glPushMatrix();
glRotatef(float(lasttime*1.6),0,0,1); glRotatef(float(lasttime*1.6),0,0,1);
glRotatef(float(lasttime*4.2),1,0,0); glRotatef(float(lasttime*4.2),1,0,0);
glRotatef(float(lasttime*2.3),0,1,0); glRotatef(float(lasttime*2.3),0,1,0);
glTranslatef(-1.0, 1.2f, -1.5); glTranslatef(-1.0f, 1.2f, -1.5f);
glScalef(float(size),float(size),float(size)); glScalef(float(size),float(size),float(size));
drawcube(wire); drawcube(wire);
glPopMatrix(); glPopMatrix();
+2 -2
View File
@@ -33,7 +33,7 @@ static const int win_size = 512;
static const int first_useful_color = 56; static const int first_useful_color = 56;
static const int last_useful_color = 255; static const int last_useful_color = 255;
static const int num_iterations = 300; static const int num_iterations = 300;
static const double max_line_width = 9.0; static const int max_line_width = 9;
static const double delta_time = 0.1; static const double delta_time = 0.1;
/*****************************************************************************/ /*****************************************************************************/
@@ -256,7 +256,7 @@ int main(int argc, char **argv)
main_window->show(argc, argv); main_window->show(argc, argv);
srand(time(NULL)); // seed the random sequence generator srand((unsigned int)time(NULL)); // seed the random sequence generator
Fl::add_timeout(delta_time, oscr_anim); Fl::add_timeout(delta_time, oscr_anim);
+1 -1
View File
@@ -88,7 +88,7 @@ public:
{ 0x33333300, FL_COURIER_BOLD, 14 }, // "\033[8m" 8 white 20% { 0x33333300, FL_COURIER_BOLD, 14 }, // "\033[8m" 8 white 20%
{ 0x1a1a1a00, FL_COURIER_BOLD, 14 }, // "\033[9m" 9 white 10% { 0x1a1a1a00, FL_COURIER_BOLD, 14 }, // "\033[9m" 9 white 10%
}; };
int tty_h = (h/3.5); int tty_h = (int)(h/3.5);
int tty_y1 = y+(tty_h*0)+20; int tty_y1 = y+(tty_h*0)+20;
int tty_y2 = y+(tty_h*1)+40; int tty_y2 = y+(tty_h*1)+40;
int tty_y3 = y+(tty_h*2)+60; int tty_y3 = y+(tty_h*2)+60;
+6 -6
View File
@@ -324,8 +324,8 @@ static void create_font_widget()
ulong c; ulong c;
for (c = ' '+1; c < 127; c++) { for (c = ' '+1; c < 127; c++) {
if (!(c&0x1f)) label[i++]='\n'; if (!(c&0x1f)) label[i++]='\n';
if (c=='@') label[i++]=c; if (c == '@') label[i++] = '@';
label[i++]=c; label[i++] = (char)c;
} }
label[i++] = '\n'; label[i++] = '\n';
for (c = 0xA1; c < 0x600; c += 9) { for (c = 0xA1; c < 0x600; c += 9) {
@@ -491,8 +491,8 @@ public:
void drawtext(int X, int Y, int W, int H) { void drawtext(int X, int Y, int W, int H) {
fl_color(textcolor()); fl_color(textcolor());
fl_font(textfont(), textsize()); fl_font(textfont(), textsize());
fl_rtl_draw(value(), strlen(value()), fl_rtl_draw(value(), (int)strlen(value()),
X + W, Y + fl_height() -fl_descent()); X + W, Y + fl_height() - fl_descent());
} }
}; };
@@ -570,8 +570,8 @@ int main(int argc, char** argv)
"\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33"; "\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33";
char *utf8 = (char*) malloc(strlen(latin1) * 5 + 1); char *utf8 = (char*) malloc(strlen(latin1) * 5 + 1);
int l = fl_utf8froma(utf8, (strlen(latin1) * 5 + 1), latin1, strlen(latin1)); int l = fl_utf8froma(utf8, (unsigned int)strlen(latin1) * 5 + 1,
latin1, (unsigned int)strlen(latin1));
make_font_chooser(); make_font_chooser();
extra_font = FL_TIMES_BOLD_ITALIC; extra_font = FL_TIMES_BOLD_ITALIC;