mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '4147_vfs_timeout'
* 4147_vfs_timeout: Drop mc_timer. Use g_get_real_time() instead. Ticket #4147: VFS timestamps: use g_get_real_time().
This commit is contained in:
commit
446a031350
@ -42,8 +42,7 @@ libmc_la_SOURCES = \
|
||||
serialize.c serialize.h \
|
||||
shell.c shell.h \
|
||||
stat-size.h \
|
||||
timefmt.c timefmt.h \
|
||||
timer.c timer.h
|
||||
timefmt.c timefmt.h
|
||||
|
||||
if USE_MAINTAINER_MODE
|
||||
libmc_la_SOURCES += logging.c logging.h
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef ENABLE_SUBSHELL
|
||||
@ -51,7 +50,6 @@
|
||||
mc_global_t mc_global = {
|
||||
.mc_run_mode = MC_RUN_FULL,
|
||||
.run_from_parent_mc = FALSE,
|
||||
.timer = NULL,
|
||||
.midnight_shutdown = FALSE,
|
||||
|
||||
.sysconfig_dir = NULL,
|
||||
|
@ -148,8 +148,6 @@
|
||||
|
||||
#define DEFAULT_CHARSET "ASCII"
|
||||
|
||||
#include "lib/timer.h" /* mc_timer_t */
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/* run mode and params */
|
||||
@ -167,8 +165,6 @@ typedef struct
|
||||
{
|
||||
mc_run_mode_t mc_run_mode;
|
||||
gboolean run_from_parent_mc;
|
||||
/* global timer */
|
||||
mc_timer_t *timer;
|
||||
/* Used so that widgets know if they are being destroyed or shut down */
|
||||
gboolean midnight_shutdown;
|
||||
|
||||
|
106
lib/timer.c
106
lib/timer.c
@ -1,106 +0,0 @@
|
||||
/*
|
||||
Simple timer for the Midnight Commander.
|
||||
|
||||
Copyright (C) 2013-2020
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Andrew Borodin 2013
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
The Midnight Commander is free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
The Midnight Commander is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief Source: simple timer
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
/**
|
||||
* mc_timer_t:
|
||||
*
|
||||
* Opaque datatype that records a start time.
|
||||
* #mc_timer_t records a start time, and counts microseconds elapsed since
|
||||
* that time.
|
||||
**/
|
||||
struct mc_timer_t
|
||||
{
|
||||
guint64 start;
|
||||
};
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/*** public functions ****************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Creates a new timer, and starts timing.
|
||||
*
|
||||
* @return: a new #mc_timer_t.
|
||||
**/
|
||||
mc_timer_t *
|
||||
mc_timer_new (void)
|
||||
{
|
||||
mc_timer_t *timer;
|
||||
|
||||
timer = g_new (mc_timer_t, 1);
|
||||
timer->start = (guint64) g_get_real_time ();
|
||||
|
||||
return timer;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Destroys a timer, freeing associated resources.
|
||||
*
|
||||
* @timer: an #mc_timer_t to destroy.
|
||||
**/
|
||||
void
|
||||
mc_timer_destroy (mc_timer_t * timer)
|
||||
{
|
||||
g_free (timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Obtains the time since the timer was started.
|
||||
*
|
||||
* @timer: an #mc_timer_t.
|
||||
*
|
||||
* @return: microseconds elapsed, the time since the timer was started
|
||||
*
|
||||
**/
|
||||
guint64
|
||||
mc_timer_elapsed (const mc_timer_t * timer)
|
||||
{
|
||||
return ((guint64) g_get_real_time () - timer->start);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
27
lib/timer.h
27
lib/timer.h
@ -1,27 +0,0 @@
|
||||
/** \file timer.h
|
||||
* \brief Header: simple timer
|
||||
*/
|
||||
|
||||
#ifndef MC_TIMER_H
|
||||
#define MC_TIMER_H
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
struct mc_timer_t;
|
||||
typedef struct mc_timer_t mc_timer_t;
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
mc_timer_t *mc_timer_new (void);
|
||||
void mc_timer_destroy (mc_timer_t * timer);
|
||||
guint64 mc_timer_elapsed (const mc_timer_t * timer);
|
||||
|
||||
/*** inline functions **************************************************/
|
||||
|
||||
#endif /* MC_TIMER_H */
|
@ -51,7 +51,6 @@
|
||||
#include "lib/vfs/vfs.h"
|
||||
#include "lib/strutil.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
@ -1518,11 +1517,11 @@ mc_replace_error (GError ** dest, int code, const char *format, ...)
|
||||
* @return TRUE if clock skew detected, FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
mc_time_elapsed (guint64 * timestamp, guint64 delay)
|
||||
mc_time_elapsed (gint64 * timestamp, gint64 delay)
|
||||
{
|
||||
guint64 now;
|
||||
gint64 now;
|
||||
|
||||
now = mc_timer_elapsed (mc_global.timer);
|
||||
now = g_get_real_time ();
|
||||
|
||||
if (now >= *timestamp && now < *timestamp + delay)
|
||||
return FALSE;
|
||||
|
@ -272,7 +272,7 @@ void mc_propagate_error (GError ** dest, int code, const char *format, ...) G_GN
|
||||
void mc_replace_error (GError ** dest, int code, const char *format, ...) G_GNUC_PRINTF (3, 4);
|
||||
/* *INDENT-ON* */
|
||||
|
||||
gboolean mc_time_elapsed (guint64 * timestamp, guint64 delay);
|
||||
gboolean mc_time_elapsed (gint64 * timestamp, gint64 delay);
|
||||
|
||||
/*** inline functions **************************************************/
|
||||
|
||||
|
@ -70,7 +70,6 @@
|
||||
|
||||
#include "lib/tty/tty.h" /* enable/disable interrupt key */
|
||||
#include "lib/util.h" /* custom_canonicalize_pathname() */
|
||||
#include "lib/timer.h"
|
||||
#if 0
|
||||
#include "lib/widget.h" /* message() */
|
||||
#endif
|
||||
@ -863,7 +862,7 @@ vfs_s_free (vfsid id)
|
||||
static gboolean
|
||||
vfs_s_dir_uptodate (struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
{
|
||||
guint64 tim;
|
||||
gint64 tim;
|
||||
|
||||
if (me->flush)
|
||||
{
|
||||
@ -871,7 +870,7 @@ vfs_s_dir_uptodate (struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
return 0;
|
||||
}
|
||||
|
||||
tim = mc_timer_elapsed (mc_global.timer);
|
||||
tim = g_get_real_time ();
|
||||
|
||||
return (tim < ino->timestamp);
|
||||
}
|
||||
|
11
lib/vfs/gc.c
11
lib/vfs/gc.c
@ -44,7 +44,6 @@
|
||||
#include "lib/global.h"
|
||||
#include "lib/event.h"
|
||||
#include "lib/util.h" /* MC_PTR_FREE */
|
||||
#include "lib/timer.h"
|
||||
|
||||
#include "vfs.h"
|
||||
#include "utilvfs.h"
|
||||
@ -98,7 +97,7 @@ struct vfs_stamping
|
||||
{
|
||||
struct vfs_class *v;
|
||||
vfsid id;
|
||||
guint64 time;
|
||||
gint64 time;
|
||||
};
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
@ -130,7 +129,7 @@ vfs_addstamp (struct vfs_class *v, vfsid id)
|
||||
stamp = g_new (struct vfs_stamping, 1);
|
||||
stamp->v = v;
|
||||
stamp->id = id;
|
||||
stamp->time = mc_timer_elapsed (mc_global.timer);
|
||||
stamp->time = g_get_real_time ();
|
||||
|
||||
stamps = g_slist_append (stamps, stamp);
|
||||
}
|
||||
@ -153,7 +152,7 @@ vfs_stamp (struct vfs_class *v, vfsid id)
|
||||
stamp = g_slist_find_custom (stamps, &what, vfs_stamp_compare);
|
||||
if (stamp != NULL && stamp->data != NULL)
|
||||
{
|
||||
VFS_STAMPING (stamp->data)->time = mc_timer_elapsed (mc_global.timer);
|
||||
VFS_STAMPING (stamp->data)->time = g_get_real_time ();
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
@ -239,7 +238,7 @@ void
|
||||
vfs_expire (gboolean now)
|
||||
{
|
||||
static gboolean locked = FALSE;
|
||||
guint64 curr_time, exp_time;
|
||||
gint64 curr_time, exp_time;
|
||||
GSList *stamp;
|
||||
|
||||
/* Avoid recursive invocation, e.g. when one of the free functions
|
||||
@ -248,7 +247,7 @@ vfs_expire (gboolean now)
|
||||
return;
|
||||
locked = TRUE;
|
||||
|
||||
curr_time = mc_timer_elapsed (mc_global.timer);
|
||||
curr_time = g_get_real_time ();
|
||||
exp_time = curr_time - vfs_timeout * G_USEC_PER_SEC;
|
||||
|
||||
if (now)
|
||||
|
@ -91,7 +91,7 @@ struct vfs_s_inode
|
||||
struct stat st; /* Parameters of this inode */
|
||||
char *linkname; /* Symlink's contents */
|
||||
char *localname; /* Filename of local file, if we have one */
|
||||
guint64 timestamp; /* Subclass specific */
|
||||
gint64 timestamp; /* Subclass specific */
|
||||
off_t data_offset; /* Subclass specific */
|
||||
};
|
||||
|
||||
|
@ -583,17 +583,17 @@ void
|
||||
status_msg_init (status_msg_t * sm, const char *title, double delay, status_msg_cb init_cb,
|
||||
status_msg_update_cb update_cb, status_msg_cb deinit_cb)
|
||||
{
|
||||
guint64 start;
|
||||
gint64 start;
|
||||
|
||||
/* repaint screen to remove previous finished dialog */
|
||||
mc_refresh ();
|
||||
|
||||
start = mc_timer_elapsed (mc_global.timer);
|
||||
start = g_get_real_time ();
|
||||
|
||||
sm->dlg = dlg_create (TRUE, 0, 0, 7, MIN (MAX (40, COLS / 2), COLS), WPOS_CENTER, FALSE,
|
||||
dialog_colors, NULL, NULL, NULL, title);
|
||||
sm->start = start;
|
||||
sm->delay = (guint64) (delay * G_USEC_PER_SEC);
|
||||
sm->delay = (gint64) (delay * G_USEC_PER_SEC);
|
||||
sm->block = FALSE;
|
||||
|
||||
sm->init = init_cb;
|
||||
@ -658,7 +658,7 @@ status_msg_common_update (status_msg_t * sm)
|
||||
/* dialog is not shown yet */
|
||||
|
||||
/* do not change sm->start */
|
||||
guint64 start = sm->start;
|
||||
gint64 start = sm->start;
|
||||
|
||||
if (mc_time_elapsed (&start, sm->delay))
|
||||
dlg_init (sm->dlg);
|
||||
|
@ -5,8 +5,6 @@
|
||||
#ifndef MC__WTOOLS_H
|
||||
#define MC__WTOOLS_H
|
||||
|
||||
#include "lib/timer.h"
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/* Pass this as def_text to request a password */
|
||||
@ -42,8 +40,8 @@ enum
|
||||
struct status_msg_t
|
||||
{
|
||||
WDialog *dlg; /* pointer to status message dialog */
|
||||
guint64 start; /* start time in microseconds */
|
||||
guint64 delay; /* delay before raise the 'dlg' in microseconds */
|
||||
gint64 start; /* start time in microseconds */
|
||||
gint64 delay; /* delay before raise the 'dlg' in microseconds */
|
||||
gboolean block; /* how to get event using tty_get_event() */
|
||||
|
||||
status_msg_cb init; /* callback to init derived classes */
|
||||
|
@ -616,9 +616,9 @@ do_compute_dir_size (const vfs_path_t * dirname_vpath, dirsize_status_msg_t * ds
|
||||
size_t * dir_count, size_t * ret_marked, uintmax_t * ret_total,
|
||||
mc_stat_fn stat_func)
|
||||
{
|
||||
static guint64 timestamp = 0;
|
||||
static gint64 timestamp = 0;
|
||||
/* update with 25 FPS rate */
|
||||
static const guint64 delay = G_USEC_PER_SEC / 25;
|
||||
static const gint64 delay = G_USEC_PER_SEC / 25;
|
||||
|
||||
status_msg_t *sm = STATUS_MSG (dsm);
|
||||
int res;
|
||||
|
@ -1158,9 +1158,9 @@ file_progress_show_target (file_op_context_t * ctx, const vfs_path_t * vpath)
|
||||
gboolean
|
||||
file_progress_show_deleting (file_op_context_t * ctx, const char *s, size_t * count)
|
||||
{
|
||||
static guint64 timestamp = 0;
|
||||
static gint64 timestamp = 0;
|
||||
/* update with 25 FPS rate */
|
||||
static const guint64 delay = G_USEC_PER_SEC / 25;
|
||||
static const gint64 delay = G_USEC_PER_SEC / 25;
|
||||
|
||||
gboolean ret;
|
||||
|
||||
|
@ -1027,9 +1027,9 @@ set_hintbar (const char *str)
|
||||
void
|
||||
rotate_dash (gboolean show)
|
||||
{
|
||||
static guint64 timestamp = 0;
|
||||
static gint64 timestamp = 0;
|
||||
/* update with 10 FPS rate */
|
||||
static const guint64 delay = G_USEC_PER_SEC / 10;
|
||||
static const gint64 delay = G_USEC_PER_SEC / 10;
|
||||
|
||||
const Widget *w = CONST_WIDGET (midnight_dlg);
|
||||
|
||||
|
@ -1666,8 +1666,8 @@ midnight_set_buttonbar (WButtonBar * b)
|
||||
char *
|
||||
get_random_hint (gboolean force)
|
||||
{
|
||||
static const guint64 update_period = 60 * G_USEC_PER_SEC;
|
||||
static guint64 tv = 0;
|
||||
static const gint64 update_period = 60 * G_USEC_PER_SEC;
|
||||
static gint64 tv = 0;
|
||||
|
||||
char *data, *result = NULL, *eop;
|
||||
size_t len, start;
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "lib/tty/tty.h"
|
||||
#include "lib/tty/key.h" /* For init_key() */
|
||||
#include "lib/tty/mouse.h" /* init_mouse() */
|
||||
#include "lib/timer.h"
|
||||
#include "lib/skin.h"
|
||||
#include "lib/filehighlight.h"
|
||||
#include "lib/fileloc.h"
|
||||
@ -255,8 +254,6 @@ main (int argc, char *argv[])
|
||||
|
||||
mc_global.run_from_parent_mc = !check_sid ();
|
||||
|
||||
mc_global.timer = mc_timer_new ();
|
||||
|
||||
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
|
||||
#ifdef HAVE_SETLOCALE
|
||||
(void) setlocale (LC_ALL, "");
|
||||
@ -277,7 +274,6 @@ main (int argc, char *argv[])
|
||||
startup_exit_ok:
|
||||
mc_shell_deinit ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
return exit_code;
|
||||
}
|
||||
|
||||
@ -557,8 +553,6 @@ main (int argc, char *argv[])
|
||||
exit_code = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
|
||||
(void) putchar ('\n'); /* Hack to make shell's prompt start at left of screen */
|
||||
|
||||
return exit_code;
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/util.h" /* my_exit() */
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
#include "src/execute.h" /* pre_exec, post_exec */
|
||||
|
||||
@ -766,7 +765,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
|
||||
vfs_print_message (_("fish: Reading directory %s..."), remote_path);
|
||||
|
||||
dir->timestamp = mc_timer_elapsed (mc_global.timer) + fish_directory_timeout * G_USEC_PER_SEC;
|
||||
dir->timestamp = g_get_real_time () + fish_directory_timeout * G_USEC_PER_SEC;
|
||||
|
||||
quoted_path = strutils_shell_escape (remote_path);
|
||||
(void) fish_command_v (me, super, NONE, FISH_SUPER (super)->scr_ls, "FISH_FILENAME=%s;\n",
|
||||
|
@ -98,7 +98,6 @@ What to do with this?
|
||||
#include "lib/util.h"
|
||||
#include "lib/strutil.h" /* str_move() */
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
#include "lib/tty/tty.h" /* enable/disable interrupt key */
|
||||
#include "lib/widget.h" /* message() */
|
||||
@ -1491,17 +1490,17 @@ ftpfs_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh)
|
||||
|
||||
if (select (dsock + 1, &mask, NULL, NULL, NULL) > 0)
|
||||
{
|
||||
guint64 start_tim;
|
||||
gint64 start_tim;
|
||||
char buf[BUF_8K];
|
||||
|
||||
start_tim = mc_timer_elapsed (mc_global.timer);
|
||||
start_tim = g_get_real_time ();
|
||||
|
||||
/* flush the remaining data */
|
||||
while (read (dsock, buf, sizeof (buf)) > 0)
|
||||
{
|
||||
guint64 tim;
|
||||
gint64 tim;
|
||||
|
||||
tim = mc_timer_elapsed (mc_global.timer);
|
||||
tim = g_get_real_time ();
|
||||
|
||||
if (tim > start_tim + ABORT_TIMEOUT)
|
||||
{
|
||||
@ -1748,7 +1747,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
return (-1);
|
||||
}
|
||||
|
||||
dir->timestamp = mc_timer_elapsed (mc_global.timer) + ftpfs_directory_timeout * G_USEC_PER_SEC;
|
||||
dir->timestamp = g_get_real_time () + ftpfs_directory_timeout * G_USEC_PER_SEC;
|
||||
|
||||
if (ftp_super->strict == RFC_STRICT)
|
||||
sock = ftpfs_open_data_connection (me, super, "LIST", 0, TYPE_ASCII, 0);
|
||||
|
@ -43,7 +43,6 @@ static char resolved_path[PATH_MAX];
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
vfs_init ();
|
||||
vfs_init_localfs ();
|
||||
@ -56,7 +55,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -79,7 +79,6 @@ config_object__deinit (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings ("KOI8-R");
|
||||
vfs_init ();
|
||||
vfs_init_localfs ();
|
||||
@ -97,7 +96,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -59,7 +59,6 @@ setup (void)
|
||||
g_setenv ("XDG_DATA_HOME", CONF_DATA, TRUE);
|
||||
g_setenv ("XDG_CACHE_HOME", CONF_CACHE, TRUE);
|
||||
#endif
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings ("UTF-8");
|
||||
vfs_init ();
|
||||
vfs_init_localfs ();
|
||||
@ -73,7 +72,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -45,7 +45,6 @@ static struct vfs_class vfs_test_ops;
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -74,7 +73,6 @@ teardown (void)
|
||||
vfs_shut ();
|
||||
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -55,7 +55,6 @@ test_chdir (const vfs_path_t * vpath)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -75,7 +74,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -42,7 +42,6 @@
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -67,7 +66,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -42,7 +42,6 @@
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -67,7 +66,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -60,7 +60,6 @@ init_test_classes (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -87,7 +86,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -65,7 +65,6 @@ teardown (void)
|
||||
static void
|
||||
test_init_vfs (const char *encoding)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (encoding);
|
||||
|
||||
vfs_init ();
|
||||
@ -86,7 +85,6 @@ test_deinit_vfs (void)
|
||||
free_codepages_list ();
|
||||
str_uninit_strings ();
|
||||
vfs_shut ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -45,7 +45,6 @@ static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3;
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -79,7 +78,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -73,7 +73,6 @@ test_chdir__deinit (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -102,7 +101,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -45,7 +45,6 @@
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -61,7 +60,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -55,7 +55,6 @@ setup (void)
|
||||
{
|
||||
static struct stat initstat;
|
||||
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -81,7 +80,6 @@ teardown (void)
|
||||
vfs_s_free_entry (vfs_test_ops1, vfs_root_entry);
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -46,7 +46,6 @@ mc_config_get_home_dir (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -62,7 +61,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -48,7 +48,6 @@ static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3;
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -82,7 +81,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -55,7 +55,6 @@ test_which (struct vfs_class *me, const char *path)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -81,7 +80,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -82,7 +82,6 @@ test1_mock_archive_same (const vfs_path_element_t * vpath_element, struct vfs_s_
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -110,7 +109,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
|
||||
|
@ -76,7 +76,6 @@ mc_stat (const vfs_path_t * vpath, struct stat *my_stat)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -92,7 +91,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -41,7 +41,6 @@ static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3;
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -66,7 +65,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "lib/timer.h"
|
||||
#ifdef HAVE_CHARSET
|
||||
#include "lib/charsets.h"
|
||||
#endif
|
||||
@ -152,7 +151,6 @@ editcmd_dialog_completion_show__deinit (void)
|
||||
static void
|
||||
my_setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -187,7 +185,6 @@ my_teardown (void)
|
||||
vfs_shut ();
|
||||
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -238,7 +238,6 @@ mc_ungetlocalcopy__deinit (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
vfs_init ();
|
||||
vfs_init_localfs ();
|
||||
@ -267,7 +266,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -95,7 +95,6 @@ mc_config_get_string__deinit (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
vfs_init ();
|
||||
vfs_init_localfs ();
|
||||
@ -114,7 +113,6 @@ teardown (void)
|
||||
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -80,7 +80,6 @@ mc_config_get_home_dir (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -98,7 +97,6 @@ teardown (void)
|
||||
vfs_path_free (do_cd__new_dir_vpath__captured);
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -42,7 +42,6 @@
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -62,7 +61,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -38,7 +38,6 @@
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
str_init_strings (NULL);
|
||||
|
||||
vfs_init ();
|
||||
@ -54,7 +53,6 @@ teardown (void)
|
||||
{
|
||||
vfs_shut ();
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -30,7 +30,6 @@
|
||||
|
||||
#include "lib/strutil.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/timer.h"
|
||||
|
||||
#include "src/filemanager/midnight.h"
|
||||
|
||||
@ -62,7 +61,6 @@ rand (void)
|
||||
static void
|
||||
setup (void)
|
||||
{
|
||||
mc_global.timer = mc_timer_new ();
|
||||
mc_global.share_data_dir = (char *) TEST_SHARE_DIR;
|
||||
str_init_strings (NULL);
|
||||
}
|
||||
@ -71,7 +69,6 @@ static void
|
||||
teardown (void)
|
||||
{
|
||||
str_uninit_strings ();
|
||||
mc_timer_destroy (mc_global.timer);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user