diff --git a/SourceX/DiabloUI/credits.cpp b/SourceX/DiabloUI/credits.cpp index 944cd9006..af74594ce 100644 --- a/SourceX/DiabloUI/credits.cpp +++ b/SourceX/DiabloUI/credits.cpp @@ -519,7 +519,8 @@ void credts_Render() x += 40; } - if (text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color)) { + text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color); + if (text_surface) { SDL_Rect src_rect = { 0, -y, SCREEN_WIDTH, 251 }; SDL_Rect dsc_rect = { 64 + x, 160 + 114, SCREEN_WIDTH, SCREEN_HEIGHT }; SDL_BlitSurface(text_surface, &src_rect, pal_surface, &dsc_rect); diff --git a/SourceX/DiabloUI/diabloui.cpp b/SourceX/DiabloUI/diabloui.cpp index 676d75ffe..e101eccd6 100644 --- a/SourceX/DiabloUI/diabloui.cpp +++ b/SourceX/DiabloUI/diabloui.cpp @@ -543,7 +543,7 @@ int GetStrWidth(char *str, int size) { int strWidth = 0; - for (int i = 0; i < strlen((char *)str); i++) { + for (size_t i = 0; i < strlen((char *)str); i++) { BYTE w = FontTables[size][*(BYTE *)&str[i] + 2]; if (w) strWidth += w; @@ -633,7 +633,7 @@ void DrawArtStr(UI_Item *item) if (item->flags & UIS_VCENTER) sy += (item->rect.h - ArtFonts[size][color].height) / 2; - for (int i = 0; i < strlen((char *)item->caption); i++) { + for (size_t i = 0; i < strlen((char *)item->caption); i++) { if (item->caption[i] == '\n') { sx = x; sy += ArtFonts[size][color].height; diff --git a/SourceX/DiabloUI/diabloui.h b/SourceX/DiabloUI/diabloui.h index 5ddbddfd4..91451f2a3 100644 --- a/SourceX/DiabloUI/diabloui.h +++ b/SourceX/DiabloUI/diabloui.h @@ -68,7 +68,7 @@ typedef struct UI_Item { int flags; int value; char *caption; - void *context; + const void *context; } UI_Item; extern TTF_Font *font; diff --git a/SourceX/DiabloUI/title.cpp b/SourceX/DiabloUI/title.cpp index 3e8334cbd..27d5c7568 100644 --- a/SourceX/DiabloUI/title.cpp +++ b/SourceX/DiabloUI/title.cpp @@ -27,7 +27,7 @@ BOOL UiTitleDialog(int a1) title_Load(); bool endMenu = false; - int timeOut = SDL_GetTicks() + 7000; + Uint32 timeOut = SDL_GetTicks() + 7000; SDL_Event event; while (!endMenu && SDL_GetTicks() < timeOut) {