summaryrefslogtreecommitdiffstats
path: root/src/tools/qfile_unix.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-07-09 23:09:59 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-07-09 23:09:59 +0900
commit83991febd2b98788a0a018e187de0dfb7d95b500 (patch)
treeec363502a3d11082cc54d17b7969f8ba605e1f01 /src/tools/qfile_unix.cpp
parent48ea22d00b58a37508567756b2955582cd9efe5a (diff)
downloadtqt3-83991febd2b98788a0a018e187de0dfb7d95b500.tar.gz
tqt3-83991febd2b98788a0a018e187de0dfb7d95b500.zip
Remove Qt4 related stuff
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/tools/qfile_unix.cpp')
-rw-r--r--src/tools/qfile_unix.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/tools/qfile_unix.cpp b/src/tools/qfile_unix.cpp
index e54ee6b97..f28899483 100644
--- a/src/tools/qfile_unix.cpp
+++ b/src/tools/qfile_unix.cpp
@@ -278,7 +278,7 @@ bool TQFile::open( int m )
length = INT_MAX;
ioIndex = 0;
} else {
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
length = st.st_size > UINT_MAX ? UINT_MAX : (Offset)st.st_size;
#else
length = (Offset)st.st_size;
@@ -352,13 +352,9 @@ bool TQFile::open( int m, FILE *f )
struct stat st;
::fstat( fileno(fh), &st );
#if defined(QT_LARGEFILE_SUPPORT)
-#if !defined(QT_ABI_QT4)
off_t tmp = ftello( fh );
ioIndex = tmp > UINT_MAX ? UINT_MAX : (Offset)tmp;
#else
- ioIndex = (Offset)ftello( fh );
-#endif
-#else
ioIndex = (Offset)ftell( fh );
#endif
if ( (st.st_mode & S_IFMT) != S_IFREG || f == stdin ) { //stdin is non seekable
@@ -367,7 +363,7 @@ bool TQFile::open( int m, FILE *f )
length = INT_MAX;
ioIndex = 0;
} else {
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
length = st.st_size > UINT_MAX ? UINT_MAX : (Offset)st.st_size;
#else
length = (Offset)st.st_size;
@@ -423,7 +419,7 @@ bool TQFile::open( int m, int f )
ext_f = TRUE;
struct stat st;
::fstat( fd, &st );
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
off_t tmp = ::lseek(fd, 0, SEEK_CUR);
ioIndex = tmp > UINT_MAX ? UINT_MAX : (Offset)tmp;
#else
@@ -435,7 +431,7 @@ bool TQFile::open( int m, int f )
length = INT_MAX;
ioIndex = 0;
} else {
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
length = st.st_size > UINT_MAX ? UINT_MAX : (Offset)st.st_size;
#else
length = (Offset)st.st_size;
@@ -472,7 +468,7 @@ TQIODevice::Offset TQFile::size() const
}
if ( ret == -1 )
return 0;
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
return (uint)st.st_size > UINT_MAX ? UINT_MAX : (Offset)st.st_size;
#else
return st.st_size;
@@ -527,19 +523,15 @@ bool TQFile::at( Offset pos )
#endif
}
if ( ok )
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
ioIndex = pos > UINT_MAX ? UINT_MAX : (Offset)pos;
#else
ioIndex = (Offset)pos;
#endif
#if defined(QT_CHECK_RANGE)
else
-#if defined(QT_ABI_QT4)
- tqWarning( "TQFile::at: Cannot set file position %lld", pos );
-#else
tqWarning( "TQFile::at: Cannot set file position %lu", pos );
#endif
-#endif
return ok;
}
@@ -654,7 +646,7 @@ TQ_LONG TQFile::writeBlock( const char *p, TQ_ULONG len )
setErrorStringErrno( errno );
if ( !isSequentialAccess() ) {
if ( isRaw() ) { // recalc file position
-#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_QT4)
+#if defined(QT_LARGEFILE_SUPPORT)
off_t tmp = ::lseek( fd, 0, SEEK_CUR );
ioIndex = tmp > UINT_MAX ? UINT_MAX : (Offset)tmp;
#else
@@ -662,13 +654,9 @@ TQ_LONG TQFile::writeBlock( const char *p, TQ_ULONG len )
#endif
} else {
#if defined(QT_LARGEFILE_SUPPORT)
-#if !defined(QT_ABI_QT4)
off_t tmp = (Offset)::fseeko( fh, 0, SEEK_CUR );
ioIndex = tmp > UINT_MAX ? UINT_MAX : (Offset)tmp;
#else
- ioIndex = (Offset)::fseeko( fh, 0, SEEK_CUR );
-#endif
-#else
ioIndex = (Offset)::fseek( fh, 0, SEEK_CUR );
#endif
}