X-Git-Url: https://git.deb.at/?a=blobdiff_plain;ds=sidebyside;f=estr.c;h=3f2d25e9b766c07bab0b5c07da95672567f2363b;hb=3cea3c8809447c5d6658671b78b9af7137fd9b0d;hp=93c2290d94c3ebd21d038386c485ff06bcd10832;hpb=b8966ec4ee3c9d035850ff49aaf5485081fe0d20;p=pkg%2Fabook.git diff --git a/estr.c b/estr.c index 93c2290..3f2d25e 100644 --- a/estr.c +++ b/estr.c @@ -78,7 +78,7 @@ wenter_string(WINDOW *win, const int maxlen, const int flags) int size = maxlen > 0 ? maxlen + 1 : INITIAL_BUFSIZE; getyx(win, y, x); - str = MALLOC(size); + str = (char *)MALLOC(size); for( ;; ) { /* main loop */ if(flags & ESTR_DONT_WRAP && x+i > COLS-2) { @@ -122,7 +122,7 @@ wenter_string(WINDOW *win, const int maxlen, const int flags) str[i++] = ch; waddch(win,ch); if( i + 1 >= size ) - str = REALLOC( str, size *= 2 ); + str = (char *)REALLOC( str, size *= 2 ); } out: if( i >= 0 && str != NULL ) @@ -258,7 +258,8 @@ filesel_add_filesel_list_item(struct filesel_list_item item) if( ++filesel_items > filesel_list_capacity) { filesel_list_capacity = filesel_list_capacity < 1 ? 30:filesel_list_capacity << 1; - lst = REALLOC(lst, filesel_list_capacity * + lst = (struct filesel_list_item *)REALLOC(lst, + filesel_list_capacity * sizeof(struct filesel_list_item) ); } @@ -519,7 +520,8 @@ filesel_enter() if(lst[filesel_curitem].type == FLSL_TYPE_DIR) { dir = my_getcwd(); - newdir = MALLOC(strlen(dir)+strlen(lst[filesel_curitem].filename) +2 ); + newdir = (char *)MALLOC(strlen(dir) + + strlen(lst[filesel_curitem].filename) +2 ); strcpy(newdir, dir); strcat(newdir, "/"); strcat(newdir,lst[filesel_curitem].filename); @@ -595,7 +597,8 @@ filesel() if( !filesel_loop() ) { dir = my_getcwd(); - tmp = MALLOC(strlen(dir) + strlen(lst[filesel_curitem].filename) + 2); + tmp = (char *)MALLOC(strlen(dir) + + strlen(lst[filesel_curitem].filename) + 2); strcpy(tmp,dir); strcat(tmp, "/"); strcat(tmp, lst[filesel_curitem].filename);