diff --git a/src/hu_stuff.c b/src/hu_stuff.c index fa7060dff..55e5a9f5c 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -431,7 +431,7 @@ void HU_Start(void) void HU_Shiftform(void) { - shiftxform = cv_keyboardlayout.value == 3 ? french_shiftxform : english_shiftxform; + shiftxform = (cv_keyboardlayout.value == 3) ? french_shiftxform : english_shiftxform; } //====================================================================== @@ -465,8 +465,8 @@ static INT16 addy = 0; // use this to make the messages scroll smoothly when one static void HU_removeChatText_Mini(void) { // MPC: Don't create new arrays, just iterate through an existing one - size_t i; - for(i=0;i 0) stop_spamming[i]--; } // handle chat timers - for (i=0; (i 0) chat_timers[i]--; @@ -1231,7 +1231,7 @@ static void HU_SendChatMessage(void) nodenum[2] = '\0'; // check for undesirable characters in our "number" - if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) + if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) { // check if nodenum[1] is a space if (nodenum[1] == ' ') @@ -1499,7 +1499,7 @@ static void HU_drawMiniChat(void) if (splitscreen > 1) boxw = max(64, boxw/2); - for (; i>0; i--) + for (; i > 0; i--) { char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]); size_t j = 0; @@ -1572,7 +1572,7 @@ static void HU_drawMiniChat(void) i = 0; prev_linereturn = false; - for (; i<=(chat_nummsg_min-1); i++) // iterate through our hot messages + for (; i <= (chat_nummsg_min-1); i++) // iterate through our hot messages { INT32 clrflag = 0; INT32 timer = ((cv_chattime.value*TICRATE)-chat_timers[i]) - cv_chattime.value*TICRATE+9; // see below... @@ -1749,7 +1749,6 @@ static void HU_drawChatLog(INT32 offset) Z_Free(msg); } - if (((chat_scroll >= chat_maxscroll) || (chat_scrollmedown)) && !(justscrolleddown || justscrolledup || chat_scrolltime)) // was already at the bottom of the page before new maxscroll calculation and was NOT scrolling. { atbottom = true; // we should scroll @@ -2284,6 +2283,7 @@ static void HU_DrawSongCreditsBox(void) V_DrawFill(x, y, strwidth*dup, BOXCREDITHEIGHT*dup, 28|flags|(bgt<= MAXTRANSLATIONS) I_Error("Invalid skin color #%hu.", (UINT16)color); - if (skinnum < 0 && skinnum > TC_DEFAULT) - I_Error("Invalid translation colormap index %d.", skinnum); - starttranscolor = (skinnum != TC_DEFAULT) ? K_GetSkinArray(local)[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR; if (starttranscolor >= NUM_PALETTE_ENTRIES) diff --git a/src/v_video.c b/src/v_video.c index 0104cf78c..9e7ece0d1 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -641,8 +641,8 @@ void VID_BlitLinearScreen(const UINT8 *restrict srcptr, UINT8 *restrict destptr, } } -static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; -static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; +static const UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; +static const UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; UINT8 hudtrans = 0; static const UINT8 *v_colormap = NULL;