From 02e3edf762d05ec4aacb348eb550f35ee1558a9f Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Mon, 28 Mar 2011 09:12:38 +0200 Subject: [PATCH] Fix to deal with ncurses 5.8 API violation, newwin(0,0,0,0) doesn't create a new full-screen window anymore. --- src/askloc.c | 2 +- src/dimage.c | 2 +- src/dirpart.c | 2 +- src/fat1x.c | 2 +- src/fat32.c | 2 +- src/fat_adv.c | 6 +++--- src/intrfn.c | 8 ++++---- src/ntfs_adv.c | 4 ++-- src/ntfs_udl.c | 4 ++-- src/partmacn.c | 2 +- src/pfree_whole.c | 2 +- src/texfat.c | 2 +- src/thfs.c | 2 +- src/tntfs.c | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/askloc.c b/src/askloc.c index 55f380fd..12ff468a 100644 --- a/src/askloc.c +++ b/src/askloc.c @@ -148,7 +148,7 @@ char *ask_location(const char*msg, const char *src_dir, const char *dst_org) char dst_directory[4096]; char *res=NULL; int quit; - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy_short(window); if(dst_org != NULL) strncpy(dst_directory, dst_org, sizeof(dst_directory)); diff --git a/src/dimage.c b/src/dimage.c index ed784355..c69b43cf 100644 --- a/src/dimage.c +++ b/src/dimage.c @@ -110,7 +110,7 @@ int disk_image(disk_t *disk, const partition_t *partition, const char *image_dd) return -1; } #ifdef HAVE_NCURSES - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); wmove(window,5,0); wprintw(window,"%s\n",disk->description_short(disk)); diff --git a/src/dirpart.c b/src/dirpart.c index 949019d8..d946da5c 100644 --- a/src/dirpart.c +++ b/src/dirpart.c @@ -103,7 +103,7 @@ int dir_partition(disk_t *disk_car, const partition_t *partition, const int verb } } #ifdef HAVE_NCURSES - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ dir_data.display=window; aff_copy(window); #else diff --git a/src/fat1x.c b/src/fat1x.c index d3b472f1..8f9afa0e 100644 --- a/src/fat1x.c +++ b/src/fat1x.c @@ -45,7 +45,7 @@ #ifdef HAVE_NCURSES static void dump_fat1x_ncurses(disk_t *disk_car, partition_t *partition, const unsigned char *buffer_bs) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); diff --git a/src/fat32.c b/src/fat32.c index a921d8d8..4508638a 100644 --- a/src/fat32.c +++ b/src/fat32.c @@ -47,7 +47,7 @@ #ifdef HAVE_NCURSES static void dump_fat32_ncurses(disk_t *disk_car, const partition_t *partition, const unsigned char *buffer_bs, const unsigned char *buffer_backup_bs) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); diff --git a/src/fat_adv.c b/src/fat_adv.c index 1636344e..67cb5a96 100644 --- a/src/fat_adv.c +++ b/src/fat_adv.c @@ -190,7 +190,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co const file_data_t *current_file; const file_data_t *pos=dir_list; WINDOW *window; - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); wmove(window,4,0); aff_part(window,AFF_PART_ORDER|AFF_PART_STATUS,disk_car,partition); @@ -881,7 +881,7 @@ static int analyse_dir_entries2(disk_t *disk_car,const partition_t *partition, c #ifdef HAVE_NCURSES static void fat32_dump_ncurses(disk_t *disk_car, const partition_t *partition, const upart_type_t upart_type, const unsigned char *orgboot, const unsigned char *newboot) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); @@ -2279,7 +2279,7 @@ int repair_FAT_table(disk_t *disk_car, partition_t *partition, const int verbose unsigned int fat32_root_cluster=0; int fat_damaged=0; #ifdef HAVE_NCURSES - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); #endif { diff --git a/src/intrfn.c b/src/intrfn.c index 227ad12b..2dfd8fec 100644 --- a/src/intrfn.c +++ b/src/intrfn.c @@ -569,7 +569,7 @@ unsigned long long int ask_number(const unsigned long long int val_cur, const un void dump_ncurses(const void *nom_dump, unsigned int lng) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); dump(window, nom_dump, lng); @@ -1001,7 +1001,7 @@ int ask_confirmation(const char*_format, ...) { va_list ap; int res; - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); va_start(ap,_format); vaff_txt(4, window, _format, ap); @@ -1017,7 +1017,7 @@ int ask_confirmation(const char*_format, ...) void not_implemented(const char *msg) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); wmove(window,7,0); wprintw(window,"Function %s not implemented",msg); @@ -1399,7 +1399,7 @@ void display_message(const char*msg) { 'Q', "Ok", "" }, { 0, NULL, NULL } }; - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ log_info("%s",msg); aff_copy(window); mvwaddstr(window,5,0,msg); diff --git a/src/ntfs_adv.c b/src/ntfs_adv.c index 721c42d9..cc83a733 100644 --- a/src/ntfs_adv.c +++ b/src/ntfs_adv.c @@ -69,7 +69,7 @@ static int read_mft_info(disk_t *disk_car, partition_t *partition, const uint64_ #ifdef HAVE_NCURSES static void ntfs_dump_ncurses(disk_t *disk_car, const partition_t *partition, const unsigned char *orgboot, const unsigned char *newboot) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); @@ -231,7 +231,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p case 'D': if(strchr(options,'D')!=NULL) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c index 68fd070d..9a9c76e2 100644 --- a/src/ntfs_udl.c +++ b/src/ntfs_udl.c @@ -1500,7 +1500,7 @@ int ntfs_undelete_part(disk_t *disk_car, const partition_t *partition, const int #endif int res=dir_partition_ntfs_init(disk_car,partition,&dir_data,verbose); #ifdef HAVE_NCURSES - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ dir_data.display=window; aff_copy(window); #else @@ -1571,7 +1571,7 @@ int ntfs_undelete_part(disk_t *disk_car, const partition_t *partition, const int { #ifdef HAVE_NCURSES WINDOW *window; - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); #endif log_info("\n"); diff --git a/src/partmacn.c b/src/partmacn.c index a629c5e4..d62baa45 100644 --- a/src/partmacn.c +++ b/src/partmacn.c @@ -43,7 +43,7 @@ extern const arch_fnct_t arch_mac; void write_part_mac_warning_ncurses(void) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); wmove(window,7,0); wprintw(window,"Function write_part_mac not implemented"); diff --git a/src/pfree_whole.c b/src/pfree_whole.c index 6a208c5c..0c600eae 100644 --- a/src/pfree_whole.c +++ b/src/pfree_whole.c @@ -93,7 +93,7 @@ int ask_mode_ext2(const disk_t *disk_car, const partition_t *partition, unsigned menu=0; else menu=1; - window=newwin(0,0,0,0); /* full screen */ + window=newwin(LINES, COLS, 0, 0); /* full screen */ aff_copy(window); wmove(window,4,0); aff_part(window, AFF_PART_ORDER|AFF_PART_STATUS,disk_car,partition); diff --git a/src/texfat.c b/src/texfat.c index a2f4b0e9..e566647f 100644 --- a/src/texfat.c +++ b/src/texfat.c @@ -44,7 +44,7 @@ #ifdef HAVE_NCURSES static void exFAT_dump_ncurses(disk_t *disk, const partition_t *partition, const unsigned char *buffer_bs, const unsigned char *buffer_backup_bs) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); diff --git a/src/thfs.c b/src/thfs.c index 62ac5ed4..940e549a 100644 --- a/src/thfs.c +++ b/src/thfs.c @@ -45,7 +45,7 @@ #ifdef HAVE_NCURSES static void hfs_dump_ncurses(disk_t *disk_car, const partition_t *partition, const unsigned char *buffer_bs, const unsigned char *buffer_backup_bs) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0); diff --git a/src/tntfs.c b/src/tntfs.c index 6bf89e0b..0309b131 100644 --- a/src/tntfs.c +++ b/src/tntfs.c @@ -45,7 +45,7 @@ #ifdef HAVE_NCURSES static void dump_NTFS_ncurses(disk_t *disk_car, const partition_t *partition, const unsigned char *buffer_bs, const unsigned char *buffer_backup_bs) { - WINDOW *window=newwin(0,0,0,0); /* full screen */ + WINDOW *window=newwin(LINES, COLS, 0, 0); /* full screen */ keypad(window, TRUE); /* Need it to get arrow key */ aff_copy(window); wmove(window,4,0);