avoid type conversion warning size_t -> int

This commit is contained in:
Holger Vogt 2020-04-23 15:47:14 +02:00
parent d3866a6315
commit a084f4f2b5
2 changed files with 5 additions and 5 deletions

View File

@ -698,8 +698,8 @@ int WIN_NewViewport(GRAPH *graph)
wtext = TMALLOC(wchar_t, 2 * strlen(graph->plotname) + 1);
wtext2 = TMALLOC(wchar_t, 2 * strlen(WindowName) + 1);
/* translate UTF-8 to UTF-16 */
MultiByteToWideChar(CP_UTF8, 0, graph->plotname, -1, wtext, 2 * strlen(graph->plotname) + 1);
MultiByteToWideChar(CP_UTF8, 0, WindowName, -1, wtext2, 2 * strlen(WindowName) + 1);
MultiByteToWideChar(CP_UTF8, 0, graph->plotname, -1, wtext, 2 * (int)strlen(graph->plotname) + 1);
MultiByteToWideChar(CP_UTF8, 0, WindowName, -1, wtext2, 2 * (int)strlen(WindowName) + 1);
window = CreateWindowW(wtext2, wtext, WS_OVERLAPPEDWINDOW,
0, 0, WinLineWidth, i * 2 - 22, NULL, NULL, hInst, NULL);
tfree(wtext);
@ -1045,7 +1045,7 @@ int WIN_Text(char *text, int x, int y, int angle)
#else
wchar_t *wtext;
wtext = TMALLOC(wchar_t, 2 * strlen(text) + 1);
MultiByteToWideChar(CP_UTF8, 0, text, -1, wtext, 2 * strlen(text) + 1);
MultiByteToWideChar(CP_UTF8, 0, text, -1, wtext, 2 * (int)strlen(text) + 1);
TextOutW(wd->hDC, x, wd->Area.bottom - y - currentgraph->fontheight, wtext, 2 * (int)strlen(text) + 1);
tfree(wtext);
#endif

View File

@ -296,7 +296,7 @@ int WPRINT_NewViewport(GRAPH * graph)
#else
wchar_t* wtext;
wtext = TMALLOC(wchar_t, 2 * strlen(graph->plotname) + 1);
MultiByteToWideChar(CP_UTF8, 0, graph->plotname, -1, wtext, 2 * strlen(graph->plotname) + 1);
MultiByteToWideChar(CP_UTF8, 0, graph->plotname, -1, wtext, 2 * (int)strlen(graph->plotname) + 1);
TextOutW(PrinterDC, PrinterWidth - graph->fontwidth, 1, wtext, 2 * (int)strlen(graph->plotname) + 1);
tfree(wtext);
#endif
@ -433,7 +433,7 @@ int WPRINT_Text(char * text, int x, int y, int degrees)
#else
wchar_t* wtext;
wtext = TMALLOC(wchar_t, 2 * strlen(text) + 1);
MultiByteToWideChar(CP_UTF8, 0, text, -1, wtext, 2 * strlen(text) + 1);
MultiByteToWideChar(CP_UTF8, 0, text, -1, wtext, 2 * (int)strlen(text) + 1);
TextOutW(PrinterDC, x, PrinterHeight - y - currentgraph->fontheight, wtext, 2 * (int)strlen(text) + 1);
tfree(wtext);
#endif