Rename macros related to dir_list::size.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-08-24 09:50:20 +04:00
parent 6b31f67f31
commit 3470695357
5 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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 ***************************************************************************************/

View File

@ -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;

View File

@ -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;

View File

@ -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;
}