aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-09-19 09:37:30 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-09-19 09:37:30 +0200
commit7deabe9ff611d68ae780903e4970b5d73cd13493 (patch)
tree3830c51fc3dc1777715efc57dfe76aedc06f2938
parent969f1536918e342bb331acfb042bf906c307978c (diff)
downloadmessenger-cli-7deabe9ff611d68ae780903e4970b5d73cd13493.tar.gz
messenger-cli-7deabe9ff611d68ae780903e4970b5d73cd13493.zip
Remove library flags from compiling and fix warning
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--Makefile2
-rw-r--r--src/chat.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 540e33b..66bb7e2 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ release: CFLAGS += $(RELEASEFLAGS)
71release: $(BINARY) 71release: $(BINARY)
72 72
73%.o: %.c 73%.o: %.c
74 $(GNU_CC) $(CFLAGS) -c $< -o $@ $(LIBRARY_FLAGS) 74 $(GNU_CC) $(CFLAGS) -c $< -o $@
75 75
76$(BINARY): $(OBJECT_FILES) 76$(BINARY): $(OBJECT_FILES)
77 $(GNU_LD) $(LDFLAGS) $^ -o $@ $(LIBRARY_FLAGS) 77 $(GNU_LD) $(LDFLAGS) $^ -o $@ $(LIBRARY_FLAGS)
diff --git a/src/chat.c b/src/chat.c
index b7ed4fa..a0073d9 100644
--- a/src/chat.c
+++ b/src/chat.c
@@ -205,11 +205,11 @@ _chat_update_layout_chats(struct MESSENGER_Application *app)
205 if (offset_x > 0) 205 if (offset_x > 0)
206 { 206 {
207 app->ui.left = subwin( 207 app->ui.left = subwin(
208 app->window, 208 app->window,
209 rows - offset_y, 209 rows - offset_y,
210 UI_ACCOUNTS_COLS_MIN, 210 UI_ACCOUNTS_COLS_MIN,
211 offset_y, 211 offset_y,
212 0 212 0
213 ); 213 );
214 214
215 wmove(app->window, offset_y > 0? offset_y : 0, UI_ACCOUNTS_COLS_MIN); 215 wmove(app->window, offset_y > 0? offset_y : 0, UI_ACCOUNTS_COLS_MIN);
@@ -244,12 +244,16 @@ _chat_update_layout_messages(struct MESSENGER_Application *app)
244 UTIL_LOGO_COLS : UI_CHATS_COLS_MIN 244 UTIL_LOGO_COLS : UI_CHATS_COLS_MIN
245 ); 245 );
246 246
247 int offset_x = 0; 247 int offset_x, cut_x;
248 cut_x = 0;
248 249
249 if (cols >= cols_min_left + UI_MESSAGES_COLS_MIN) 250 if (cols >= cols_min_left + UI_MESSAGES_COLS_MIN)
250 offset_x = cols_min_left + 1; 251 offset_x = cols_min_left + 1;
251 else 252 else
253 {
254 offset_x = 0;
252 goto skip_left_split; 255 goto skip_left_split;
256 }
253 257
254 if (rows >= UTIL_LOGO_ROWS + UI_CHATS_ROWS_MIN) 258 if (rows >= UTIL_LOGO_ROWS + UI_CHATS_ROWS_MIN)
255 { 259 {
@@ -264,8 +268,6 @@ _chat_update_layout_messages(struct MESSENGER_Application *app)
264 else 268 else
265 app->ui.left = subwin(app->window, rows, cols_min_left, 0, 0); 269 app->ui.left = subwin(app->window, rows, cols_min_left, 0, 0);
266 270
267 int cut_x = 0;
268
269 if (cols >= cols_min_left + UI_MESSAGES_COLS_MIN + UI_MEMBERS_COLS_MIN) 271 if (cols >= cols_min_left + UI_MESSAGES_COLS_MIN + UI_MEMBERS_COLS_MIN)
270 { 272 {
271 cut_x = UI_MEMBERS_COLS_MIN + 1; 273 cut_x = UI_MEMBERS_COLS_MIN + 1;