Fix: error: member access into incomplete type 'WINDOW' (aka '_win_st') error: comparison between pointer and integer ('char *' and 'char') warning: add explicit braces to avoid dangling else [-Wdangling-else] --- screen.cc.orig 2004-04-26 08:22:26.000000000 -0500 +++ screen.cc 2024-10-16 16:43:45.000000000 -0500 @@ -80,12 +80,13 @@ /* not used screen */ snprintf(buffer, textsize, SCREEN_NOT_USED); } - InfoTop->_cury = InfoTop->_curx = 0; + wmove(InfoTop, 0, 0); whline(InfoTop, 0, 5); - InfoTop->_curx = 5; + wmove(InfoTop, 0, 5); wprintw(InfoTop, "%s", buffer); - InfoTop->_curx = 5 + strlen(buffer); - whline(InfoTop, 0, COLSnow-(InfoTop->_curx)); + int x = 5 + strlen(buffer); + wmove(InfoTop, 0, x); + whline(InfoTop, 0, COLSnow - x); wrefresh(InfoTop); SetCursorToInputScreen(); return; @@ -96,9 +97,9 @@ CheckScreenForRedraw(); werase(InfoBottom); int textsize = COLSnow - 24; - InfoBottom->_cury = InfoBottom->_curx = 0; + wmove(InfoBottom, 0, 0); whline(InfoBottom, 0, 15); - InfoBottom->_curx = 15; + wmove(InfoBottom, 0, 15); char * channel_str_ptr = MakeScreenString(0); char * dchat_str_ptr = MakeScreenString(1); int num_users = 0; @@ -116,8 +117,9 @@ snprintf(help_buffer, HELP_BUF_LEN, "%s - no Screens!", nickname); } int num = print_format_text(InfoBottom, help_buffer, textsize); - InfoBottom->_curx = 15 + num; - whline(InfoBottom, 0, COLSnow - (InfoBottom->_curx)); + int x = 15 + num; + wmove(InfoBottom, 0, x); + whline(InfoBottom, 0, COLSnow - x); wrefresh(InfoBottom); if(channel_str_ptr) delete[] channel_str_ptr; if(dchat_str_ptr) delete[] dchat_str_ptr; @@ -134,7 +136,7 @@ /* count how many messages we can print on the screen */ int messages_to_print = MessagesToPrint(); werase(TextScreen); - TextScreen->_curx = TextScreen->_cury = 0; + wmove(TextScreen, 0, 0); for(int i = messages_to_print+first_print_msg-1; i >= first_print_msg; i--) { /* print 1 line */ @@ -186,7 +188,7 @@ buf[num_read] = '\0'; int ret = Test_Input_for_special_Chars(buf); if(ret == 1) { - if(InputBuffer == '\0') return; /* return when enter is pressed but no input given */ + if(InputBuffer[0] == '\0') return; /* return when enter is pressed but no input given */ /* Input Data is ready, parse it */ if(InputBuffer[0] == '/') { ParseCommandToServer(NULL); @@ -756,8 +758,15 @@ Classes.Connection->UnsetMaybeReconnect(); } } - if(message == NULL) if(!command_used) Classes.Connection->WriteMessageToServer(InputBuffer+1); - else if(!command_used) Classes.Connection->WriteMessageToServer(message+1); + if(message == NULL) { + if(!command_used) { + Classes.Connection->WriteMessageToServer(InputBuffer+1); + } + } else { + if(!command_used) { + Classes.Connection->WriteMessageToServer(message+1); + } + } DrawTextScreen(); return; }