summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-10-13 09:50:36 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-11-17 15:36:37 -0700
commit6e21d1d21a38a01eedf5f91b90d44709099e8a90 (patch)
tree502dae7bbf1ec9e3a3aab9c39274df8d67af4d80 /src/corelib/io
parent80cdd4e5bbe15ef3235b1269b3781f8e4b19a5fa (diff)
QStorageInfo: change private blockSize member to int
It's what the public API returns. There's little reason to use ulong, despite that being the type that struct statvfs uses (on Windows, that was 32-bit anyway). Saves 8 bytes on the size of the QStorageInfoPrivate class. Change-Id: I8f3ce163ccc5408cac39fffd178db8cfb9e5e4f6 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qstorageinfo_linux.cpp2
-rw-r--r--src/corelib/io/qstorageinfo_p.h2
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp2
-rw-r--r--src/corelib/io/qstorageinfo_win.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qstorageinfo_linux.cpp b/src/corelib/io/qstorageinfo_linux.cpp
index 40e3cafd5a..7475f3d416 100644
--- a/src/corelib/io/qstorageinfo_linux.cpp
+++ b/src/corelib/io/qstorageinfo_linux.cpp
@@ -170,7 +170,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesTotal = statfs_buf.f_blocks * statfs_buf.f_frsize;
bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
- blockSize = statfs_buf.f_bsize;
+ blockSize = int(statfs_buf.f_bsize);
#if defined(Q_OS_ANDROID)
#if defined(_STATFS_F_FLAGS)
diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h
index e133c20cb4..25106dacfb 100644
--- a/src/corelib/io/qstorageinfo_p.h
+++ b/src/corelib/io/qstorageinfo_p.h
@@ -96,7 +96,7 @@ public:
qint64 bytesTotal = -1;
qint64 bytesFree = -1;
qint64 bytesAvailable = -1;
- ulong blockSize = ulong(-1);
+ int blockSize = -1;
bool readOnly = false;
bool ready = false;
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 75d83a58d6..3c458ad30b 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -417,7 +417,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
#endif
- blockSize = statfs_buf.f_bsize;
+ blockSize = int(statfs_buf.f_bsize);
#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) || defined(Q_OS_RTEMS)
#if defined(_STATFS_F_FLAGS)
readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
diff --git a/src/corelib/io/qstorageinfo_win.cpp b/src/corelib/io/qstorageinfo_win.cpp
index 0d2d34898c..3ee1df9f3c 100644
--- a/src/corelib/io/qstorageinfo_win.cpp
+++ b/src/corelib/io/qstorageinfo_win.cpp
@@ -203,7 +203,7 @@ bool QStorageInfoPrivate::queryStorageProperty()
nullptr);
CloseHandle(handle);
if (result)
- blockSize = saad.BytesPerPhysicalSector;
+ blockSize = int(saad.BytesPerPhysicalSector);
return result;
}