From edc76b7b1792f482caa59c9266d27bc68c56af96 Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Thu, 2 Sep 2021 19:48:37 +0200 Subject: [PATCH] fix: more useless things --- src/render/gui/imgui/Dirent/dirent.h | 96 ---------------------------- 1 file changed, 96 deletions(-) diff --git a/src/render/gui/imgui/Dirent/dirent.h b/src/render/gui/imgui/Dirent/dirent.h index ca1d4c5..4ee88fd 100644 --- a/src/render/gui/imgui/Dirent/dirent.h +++ b/src/render/gui/imgui/Dirent/dirent.h @@ -287,16 +287,10 @@ static struct dirent *readdir (DIR *dirp); static int readdir_r( DIR *dirp, struct dirent *entry, struct dirent **result); -static int _wreaddir_r( - _WDIR *dirp, struct _wdirent *entry, struct _wdirent **result); static int closedir (DIR *dirp); static int _wclosedir (_WDIR *dirp); -static void _wrewinddir (_WDIR* dirp); - -static int alphasort (const struct dirent **a, const struct dirent **b); - /* For compatibility with Symbian */ #define wdirent _wdirent #define WDIR _WDIR @@ -440,69 +434,6 @@ _wopendir( return dirp; } -/* - * Read next directory entry. - * - * Returns zero on success. If end of directory stream is reached, then sets - * result to NULL and returns zero. - */ -static int -_wreaddir_r( - _WDIR *dirp, - struct _wdirent *entry, - struct _wdirent **result) -{ - WIN32_FIND_DATAW *datap; - - /* Read next directory entry */ - datap = dirent_next (dirp); - if (datap) { - size_t n; - DWORD attr; - - /* - * Copy file name as wide-character string. If the file name is too - * long to fit in to the destination buffer, then truncate file name - * to PATH_MAX characters and zero-terminate the buffer. - */ - n = 0; - while (n < PATH_MAX && datap->cFileName[n] != 0) { - entry->d_name[n] = datap->cFileName[n]; - n++; - } - entry->d_name[n] = 0; - - /* Length of file name excluding zero terminator */ - entry->d_namlen = n; - - /* File type */ - attr = datap->dwFileAttributes; - if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) { - entry->d_type = DT_CHR; - } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) { - entry->d_type = DT_DIR; - } else { - entry->d_type = DT_REG; - } - - /* Reset dummy fields */ - entry->d_ino = 0; - entry->d_off = 0; - entry->d_reclen = sizeof (struct _wdirent); - - /* Set result address */ - *result = entry; - - } else { - - /* Return NULL to indicate end of directory */ - *result = NULL; - - } - - return /*OK*/0; -} - /* * Close directory stream opened by opendir() function. This invalidates the * DIR structure as well as any directory entry read previously by @@ -541,25 +472,6 @@ _wclosedir( return ok; } -/* - * Rewind directory stream such that _wreaddir() returns the very first - * file name again. - */ -static void -_wrewinddir( - _WDIR* dirp) -{ - if (dirp) { - /* Release existing search handle */ - if (dirp->handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->handle); - } - - /* Open new search handle */ - dirent_first (dirp); - } -} - /* Get first directory entry (internal) */ static WIN32_FIND_DATAW* dirent_first( @@ -827,14 +739,6 @@ closedir( return ok; } -/* Alphabetical sorting */ -static int -alphasort( - const struct dirent **a, const struct dirent **b) -{ - return strcoll ((*a)->d_name, (*b)->d_name); -} - /* Convert multi-byte string to wide character string */ static int dirent_mbstowcs_s(