mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Rename macros related to dir_list::size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
6b31f67f31
commit
3470695357
@ -266,7 +266,7 @@ dir_list_grow (dir_list * list, int delta)
|
||||
size = list->size + delta;
|
||||
if (size <= 0)
|
||||
{
|
||||
size = MIN_FILES;
|
||||
size = DIR_LIST_MIN_SIZE;
|
||||
clear = TRUE;
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ dir_list_append (dir_list * list, const char *fname, const struct stat *st,
|
||||
gboolean link_to_dir, gboolean stale_link)
|
||||
{
|
||||
/* Need to grow the *list? */
|
||||
if (list->len == list->size && !dir_list_grow (list, RESIZE_STEPS))
|
||||
if (list->len == list->size && !dir_list_grow (list, DIR_LIST_RESIZE_STEP))
|
||||
return FALSE;
|
||||
|
||||
list->list[list->len].fnamelen = strlen (fname);
|
||||
@ -528,7 +528,7 @@ clean_dir (dir_list * list)
|
||||
|
||||
list->len = 0;
|
||||
/* reduce memory usage */
|
||||
dir_list_grow (list, MIN_FILES - list->size);
|
||||
dir_list_grow (list, DIR_LIST_MIN_SIZE - list->size);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -538,7 +538,7 @@ gboolean
|
||||
set_zero_dir (dir_list * list)
|
||||
{
|
||||
/* Need to grow the *list? */
|
||||
if (list->size == 0 && !dir_list_grow (list, RESIZE_STEPS))
|
||||
if (list->size == 0 && !dir_list_grow (list, DIR_LIST_RESIZE_STEP))
|
||||
{
|
||||
list->len = 0;
|
||||
return FALSE;
|
||||
|
@ -13,8 +13,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define MIN_FILES 128
|
||||
#define RESIZE_STEPS 128
|
||||
#define DIR_LIST_MIN_SIZE 128
|
||||
#define DIR_LIST_RESIZE_STEP 128
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs,
|
||||
continue;
|
||||
}
|
||||
/* Need to grow the *list? */
|
||||
if (list->len == list->size && !dir_list_grow (list, RESIZE_STEPS))
|
||||
if (list->len == list->size && !dir_list_grow (list, DIR_LIST_RESIZE_STEP))
|
||||
{
|
||||
g_free (name);
|
||||
break;
|
||||
|
@ -4069,7 +4069,7 @@ panel_new_with_dir (const char *panel_name, const vfs_path_t * vpath)
|
||||
panel->hist_name = g_strconcat ("Dir Hist ", panel_name, (char *) NULL);
|
||||
/* directories history will be get later */
|
||||
|
||||
panel->dir.size = MIN_FILES;
|
||||
panel->dir.size = DIR_LIST_MIN_SIZE;
|
||||
panel->dir.list = g_new (file_entry, panel->dir.size);
|
||||
panel->dir.len = 0;
|
||||
panel->active = 0;
|
||||
|
@ -51,7 +51,7 @@ setup (void)
|
||||
mc_global.mc_run_mode = MC_RUN_FULL;
|
||||
current_panel = g_new0 (struct WPanel, 1);
|
||||
current_panel->cwd_vpath = vfs_path_from_str ("/home");
|
||||
current_panel->dir.size = MIN_FILES;
|
||||
current_panel->dir.size = DIR_LIST_MIN_SIZE;
|
||||
current_panel->dir.list = g_new0 (file_entry, current_panel->dir.size);
|
||||
current_panel->dir.len = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user