Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-07-26 16:40:44 +0400
committerAndrea Weikert <elubie@gmx.net>2009-07-26 16:40:44 +0400
commit569bb8f47d62f40004f87a4862d87b4b1937fecb (patch)
tree711a09a5f18a2503310e12f395f92a254a722d9b /source/blender/blenlib/intern
parent4e024a1e6e41640d2f70624bb15778dc6a6c6695 (diff)
2.5 filebrowser
Bugfixes: * crash when loading file that has filebrowser open * file size over 2GB/4GB? shows negative number Other: * tried to improve drawing speed a bit by only drawing the files actually shown and improving refresh behaviour a bit. Note: Solution I found so far is to use the non-standard _stat64, as far as I could see, WIN64 should work without that patch (Genscher, please check and if needed you can enable this too by removing the !defined(WIN64) ) This probably needs to be fixed in at least one other place (BLI_filesize), will look into this once this fix proves stable enough)
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/storage.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 7af383e2356..997d9b9c3f1 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -265,7 +265,13 @@ void BLI_builddir(char *dirname, char *relname)
while(dlink){
memset(&files[actnum], 0 , sizeof(struct direntry));
files[actnum].relname = dlink->name;
+// use 64 bit file size, only needed for WIN32, WIN64 should work fine with stat.
+// Excluding other than current MSVC compiler until able to test.
+#if defined(WIN32) && !defined(WIN64) && (_MSC_VER>=1500)
+ _stat64(dlink->name,&files[actnum].s);
+#else
stat(dlink->name,&files[actnum].s);
+#endif
files[actnum].type=files[actnum].s.st_mode;
files[actnum].flags = 0;
totnum++;
@@ -361,7 +367,7 @@ void BLI_adddirstrings()
* will buy us some time until files get bigger than 4GB or until
* everyone starts using __USE_FILE_OFFSET64 or equivalent.
*/
- st_size= (off_t)files[num].s.st_size;
+ st_size= files[num].s.st_size;
if (st_size > 1024*1024*1024) {
sprintf(files[num].size, "%.2f GB", ((double)st_size)/(1024*1024*1024));