diff options
author | Dan McGee <dan@archlinux.org> | 2007-04-26 19:03:24 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-04-26 19:03:24 -0400 |
commit | b39aba99f922d3e4451d6be09ea9201ea20ba102 (patch) | |
tree | ff13a3db19720cc895e9db4b9dc8572541b4fe6e /src/pacman/util.c | |
parent | 6a1dfdf2928dbdecc5b0f2f8a7648e7f5ea84341 (diff) |
Start of the newline fixes after switching over the output
* A few quick newline fixes, mostly related to sync operations.
* Moved get_update_timediff to callback.c as it is not used outside of
that file.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r-- | src/pacman/util.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c index 3c623cd4..8d7be69b 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -336,40 +336,4 @@ void display_targets(alpm_list_t *syncpkgs) FREELIST(targets); } -/* Silly little helper function, determines if the caller needs a visual update - * since the last time this function was called. - * This is made for the two progress bar functions, to prevent flicker - * - * first_call indicates if this is the first time it is called, for - * initialization purposes */ -float get_update_timediff(int first_call) -{ - float retval = 0.0; - static struct timeval last_time = {0}; - - /* on first call, simply set the last time and return */ - if(first_call) { - gettimeofday(&last_time, NULL); - } else { - struct timeval this_time; - float diff_sec, diff_usec; - - gettimeofday(&this_time, NULL); - diff_sec = this_time.tv_sec - last_time.tv_sec; - diff_usec = this_time.tv_usec - last_time.tv_usec; - - retval = diff_sec + (diff_usec / 1000000.0); - - /* return 0 and do not update last_time if interval was too short */ - if(retval < UPDATE_SPEED_SEC) { - retval = 0.0; - } else { - last_time = this_time; - /* printf("\nupdate retval: %f\n", retval); DEBUG*/ - } - } - - return(retval); -} - /* vim: set ts=2 sw=2 noet: */ |