-O2 related refactoring

This commit is contained in:
nova
2025-07-09 01:09:45 +02:00
parent b6f9633677
commit d96046ac44
10 changed files with 136 additions and 95 deletions

18
main.c
View File

@ -129,11 +129,11 @@ void render_pass(){
/*TODO: check if deallocation of window and reallocation is faster than this or not */
werase(win_t);
werase(win_b);
werase(win_l);
werase(win_m);
werase(win_r);
wclear(win_t);
wclear(win_b);
wclear(win_l);
wclear(win_m);
wclear(win_r);
wresize(win_t, 1, terminal_width);
wresize(win_l, terminal_height-2, terminal_width/8);
@ -172,7 +172,6 @@ void init() {
initscr(); /* start ncurses */
noecho(); /* hide keyboard input */
timeout(0); /* blocking timeout of getch() */
keypad(stdscr, TRUE);
curs_set(0);
/*file_modifiers = (FILE_MODIFIERS_HIDDEN_FILES | FILE_MODIFIERS_SORT_BITMASK);*/
@ -180,13 +179,14 @@ void init() {
memset(input, 0, 255);
status = (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY);
if (getuid() == 0) {
status += STATUS_USER_ROOT;
status |= STATUS_USER_ROOT;
}
threading_init(); /* found in threading.c */
colors_init();
ESCDELAY = 10;
setenv("START_PATH", getcwd(NULL, 0), 0);
char *start_path = getcwd(NULL, 0);
setenv("START_PATH", start_path, 0);
free(start_path);
}