diff --git a/lib/Makefile.am b/lib/Makefile.am index 455f9ddf7..95e4bbf05 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -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 diff --git a/lib/global.c b/lib/global.c index 50ba893ba..5dea86987 100644 --- a/lib/global.c +++ b/lib/global.c @@ -31,7 +31,6 @@ #include #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, diff --git a/lib/global.h b/lib/global.h index 6bf55952c..c60063faa 100644 --- a/lib/global.h +++ b/lib/global.h @@ -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; diff --git a/lib/timer.c b/lib/timer.c deleted file mode 100644 index f05f00e78..000000000 --- a/lib/timer.c +++ /dev/null @@ -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 . - */ - -/** \file - * \brief Source: simple timer - */ - -#include - -#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); -} - -/* --------------------------------------------------------------------------------------------- */ diff --git a/lib/timer.h b/lib/timer.h deleted file mode 100644 index 4cc823260..000000000 --- a/lib/timer.h +++ /dev/null @@ -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 */ diff --git a/lib/util.c b/lib/util.c index 1a9bfd16f..6c65a59b1 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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; diff --git a/lib/util.h b/lib/util.h index 5280793c6..efe386bee 100644 --- a/lib/util.h +++ b/lib/util.h @@ -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 **************************************************/ diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 949fe04c5..d2211ea5b 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -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); } diff --git a/lib/vfs/gc.c b/lib/vfs/gc.c index 5090aaacb..d0bad1f91 100644 --- a/lib/vfs/gc.c +++ b/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) diff --git a/lib/vfs/xdirentry.h b/lib/vfs/xdirentry.h index 7b6410e74..56ce843a3 100644 --- a/lib/vfs/xdirentry.h +++ b/lib/vfs/xdirentry.h @@ -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 */ }; diff --git a/lib/widget/wtools.c b/lib/widget/wtools.c index 00cc50df7..5c5dc4487 100644 --- a/lib/widget/wtools.c +++ b/lib/widget/wtools.c @@ -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); diff --git a/lib/widget/wtools.h b/lib/widget/wtools.h index 3dbaef15f..cd0bc3253 100644 --- a/lib/widget/wtools.h +++ b/lib/widget/wtools.h @@ -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 */ diff --git a/src/filemanager/file.c b/src/filemanager/file.c index a43ebd17e..0ea75e4ae 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -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; diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index c43a2ae99..3af1c4315 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -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; diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index f5df9f7bf..007bda879 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -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); diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index 36461b260..539a7d87d 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -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; diff --git a/src/main.c b/src/main.c index 6db18b200..fb3426ffb 100644 --- a/src/main.c +++ b/src/main.c @@ -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; diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c index 5cd279f95..8f8f59543 100644 --- a/src/vfs/fish/fish.c +++ b/src/vfs/fish/fish.c @@ -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", diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index 8a841ac1a..4c02ba409 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -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); diff --git a/tests/lib/mc_realpath.c b/tests/lib/mc_realpath.c index 17f7c2fff..31415ac85 100644 --- a/tests/lib/mc_realpath.c +++ b/tests/lib/mc_realpath.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/config_string.c b/tests/lib/mcconfig/config_string.c index b000f1954..da479de59 100644 --- a/tests/lib/mcconfig/config_string.c +++ b/tests/lib/mcconfig/config_string.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/user_configs_path.c b/tests/lib/mcconfig/user_configs_path.c index b3e06ab17..75e483e7f 100644 --- a/tests/lib/mcconfig/user_configs_path.c +++ b/tests/lib/mcconfig/user_configs_path.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/canonicalize_pathname.c b/tests/lib/vfs/canonicalize_pathname.c index f070fa039..6364a404b 100644 --- a/tests/lib/vfs/canonicalize_pathname.c +++ b/tests/lib/vfs/canonicalize_pathname.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/current_dir.c b/tests/lib/vfs/current_dir.c index 1cb8a710e..398fc5440 100644 --- a/tests/lib/vfs/current_dir.c +++ b/tests/lib/vfs/current_dir.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_cmp.c b/tests/lib/vfs/path_cmp.c index 76be13bc8..0e19566c7 100644 --- a/tests/lib/vfs/path_cmp.c +++ b/tests/lib/vfs/path_cmp.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_len.c b/tests/lib/vfs/path_len.c index f9f40fa66..e68176dbc 100644 --- a/tests/lib/vfs/path_len.c +++ b/tests/lib/vfs/path_len.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_manipulations.c b/tests/lib/vfs/path_manipulations.c index 9bbdd8ae6..45f31e1f2 100644 --- a/tests/lib/vfs/path_manipulations.c +++ b/tests/lib/vfs/path_manipulations.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_recode.c b/tests/lib/vfs/path_recode.c index 1a832e7b5..f53094a3b 100644 --- a/tests/lib/vfs/path_recode.c +++ b/tests/lib/vfs/path_recode.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_serialize.c b/tests/lib/vfs/path_serialize.c index 0bd26f82a..8ae2c830b 100644 --- a/tests/lib/vfs/path_serialize.c +++ b/tests/lib/vfs/path_serialize.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/relative_cd.c b/tests/lib/vfs/relative_cd.c index dd131302f..bf5d62319 100644 --- a/tests/lib/vfs/relative_cd.c +++ b/tests/lib/vfs/relative_cd.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/tempdir.c b/tests/lib/vfs/tempdir.c index eaefa5fd1..8c5f3b359 100644 --- a/tests/lib/vfs/tempdir.c +++ b/tests/lib/vfs/tempdir.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_parse_ls_lga.c b/tests/lib/vfs/vfs_parse_ls_lga.c index 0847cc921..b1b203af5 100644 --- a/tests/lib/vfs/vfs_parse_ls_lga.c +++ b/tests/lib/vfs/vfs_parse_ls_lga.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_from_str_flags.c b/tests/lib/vfs/vfs_path_from_str_flags.c index de1a16472..5700c7f03 100644 --- a/tests/lib/vfs/vfs_path_from_str_flags.c +++ b/tests/lib/vfs/vfs_path_from_str_flags.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_string_convert.c b/tests/lib/vfs/vfs_path_string_convert.c index b081120c1..3c32471a5 100644 --- a/tests/lib/vfs/vfs_path_string_convert.c +++ b/tests/lib/vfs/vfs_path_string_convert.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_prefix_to_class.c b/tests/lib/vfs/vfs_prefix_to_class.c index 2a78a4171..5c7d79723 100644 --- a/tests/lib/vfs/vfs_prefix_to_class.c +++ b/tests/lib/vfs/vfs_prefix_to_class.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_s_get_path.c b/tests/lib/vfs/vfs_s_get_path.c index 44eea436c..0aa0037b2 100644 --- a/tests/lib/vfs/vfs_s_get_path.c +++ b/tests/lib/vfs/vfs_s_get_path.c @@ -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); } diff --git a/tests/lib/vfs/vfs_setup_cwd.c b/tests/lib/vfs/vfs_setup_cwd.c index abbaf4372..3d408f028 100644 --- a/tests/lib/vfs/vfs_setup_cwd.c +++ b/tests/lib/vfs/vfs_setup_cwd.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_split.c b/tests/lib/vfs/vfs_split.c index b0474e29a..289dbebf8 100644 --- a/tests/lib/vfs/vfs_split.c +++ b/tests/lib/vfs/vfs_split.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/editor/editcmd__edit_complete_word_cmd.c b/tests/src/editor/editcmd__edit_complete_word_cmd.c index 85f430cf8..37f933407 100644 --- a/tests/src/editor/editcmd__edit_complete_word_cmd.c +++ b/tests/src/editor/editcmd__edit_complete_word_cmd.c @@ -29,7 +29,6 @@ #include -#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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__common.c b/tests/src/execute__common.c index 4920ed718..d0ffa83df 100644 --- a/tests/src/execute__common.c +++ b/tests/src/execute__common.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__execute_get_external_cmd_opts_from_config.c b/tests/src/execute__execute_get_external_cmd_opts_from_config.c index 01fb3405d..379717d22 100644 --- a/tests/src/execute__execute_get_external_cmd_opts_from_config.c +++ b/tests/src/execute__execute_get_external_cmd_opts_from_config.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/do_cd_command.c b/tests/src/filemanager/do_cd_command.c index a55380eb8..8cc36ce0b 100644 --- a/tests/src/filemanager/do_cd_command.c +++ b/tests/src/filemanager/do_cd_command.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/exec_get_export_variables_ext.c b/tests/src/filemanager/exec_get_export_variables_ext.c index a7a9d98b5..b32b3bfcb 100644 --- a/tests/src/filemanager/exec_get_export_variables_ext.c +++ b/tests/src/filemanager/exec_get_export_variables_ext.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/filegui_is_wildcarded.c b/tests/src/filemanager/filegui_is_wildcarded.c index c26267355..b30734ff6 100644 --- a/tests/src/filemanager/filegui_is_wildcarded.c +++ b/tests/src/filemanager/filegui_is_wildcarded.c @@ -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); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/get_random_hint.c b/tests/src/filemanager/get_random_hint.c index c9a953227..85721bcf1 100644 --- a/tests/src/filemanager/get_random_hint.c +++ b/tests/src/filemanager/get_random_hint.c @@ -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); } /* --------------------------------------------------------------------------------------------- */