mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: compiler warnings fix
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
16292d7e3c
commit
885e632451
5 changed files with 21 additions and 39 deletions
|
@ -624,7 +624,7 @@ QByteArray KConfigIniBackend::stringToPrintable(const QByteArray& aString, Strin
|
|||
|
||||
QByteArray result; // Guesstimated that it's good to avoid data() initialization for a length of l*4
|
||||
result.resize(l * 4); // Maximum 4x as long as source string due to \x<ab> escape sequences
|
||||
register const char *s = aString.constData();
|
||||
const char *s = aString.constData();
|
||||
int i = 0;
|
||||
char *data = result.data();
|
||||
char *start = data;
|
||||
|
|
|
@ -57,31 +57,16 @@ KFileSystemType::Type determineFileSystemTypeImpl(const QByteArray& path)
|
|||
|
||||
#elif defined(Q_OS_LINUX) || defined(Q_OS_HURD)
|
||||
# include <sys/vfs.h>
|
||||
# ifdef QT_LINUXBASE
|
||||
// LSB 3.2 has statfs in sys/statfs.h, sys/vfs.h is just an empty dummy header
|
||||
# include <sys/statfs.h>
|
||||
# endif
|
||||
# ifndef NFS_SUPER_MAGIC
|
||||
# define NFS_SUPER_MAGIC 0x00006969
|
||||
# endif
|
||||
# ifndef AUTOFS_SUPER_MAGIC
|
||||
# define AUTOFS_SUPER_MAGIC 0x00000187
|
||||
# endif
|
||||
# include <linux/magic.h>
|
||||
// LSB 3.2 has statfs in sys/statfs.h, sys/vfs.h is just an empty dummy header
|
||||
# include <sys/statfs.h>
|
||||
|
||||
# ifndef AUTOFSNG_SUPER_MAGIC
|
||||
# define AUTOFSNG_SUPER_MAGIC 0x7d92b1a0
|
||||
# endif
|
||||
# ifndef MSDOS_SUPER_MAGIC
|
||||
# define MSDOS_SUPER_MAGIC 0x00004d44
|
||||
# endif
|
||||
# ifndef SMB_SUPER_MAGIC
|
||||
# define SMB_SUPER_MAGIC 0x0000517B
|
||||
#endif
|
||||
# ifndef FUSE_SUPER_MAGIC
|
||||
# define FUSE_SUPER_MAGIC 0x65735546
|
||||
# endif
|
||||
# ifndef RAMFS_MAGIC
|
||||
# define RAMFS_MAGIC 0x858458F6
|
||||
# endif
|
||||
|
||||
// Reverse-engineering without C++ code:
|
||||
// strace stat -f /mnt 2>&1|grep statfs|grep mnt, and look for f_type
|
||||
|
@ -93,21 +78,18 @@ KFileSystemType::Type determineFileSystemTypeImpl(const QByteArray& path)
|
|||
//kDebug() << path << errno << strerror(errno);
|
||||
return KFileSystemType::Unknown;
|
||||
}
|
||||
switch (buf.f_type) {
|
||||
case NFS_SUPER_MAGIC:
|
||||
case AUTOFS_SUPER_MAGIC:
|
||||
case AUTOFSNG_SUPER_MAGIC:
|
||||
case FUSE_SUPER_MAGIC: // TODO could be anything. Need to use statfs() to find out more.
|
||||
|
||||
// TODO could be anything. Need to use statfs() to find out more.
|
||||
if (buf.f_type == NFS_SUPER_MAGIC || buf.f_type == AUTOFS_SUPER_MAGIC || buf.f_type == FUSE_SUPER_MAGIC) {
|
||||
return KFileSystemType::Nfs;
|
||||
case SMB_SUPER_MAGIC:
|
||||
} else if (buf.f_type == SMB_SUPER_MAGIC) {
|
||||
return KFileSystemType::Smb;
|
||||
case MSDOS_SUPER_MAGIC:
|
||||
} else if (buf.f_type == MSDOS_SUPER_MAGIC) {
|
||||
return KFileSystemType::Fat;
|
||||
case RAMFS_MAGIC:
|
||||
return KFileSystemType::Ramfs;
|
||||
default:
|
||||
return KFileSystemType::Other;
|
||||
} else if (buf.f_type == RAMFS_MAGIC) {
|
||||
return KFileSystemType::Ramfs;
|
||||
}
|
||||
return KFileSystemType::Other;
|
||||
}
|
||||
|
||||
#elif defined(Q_OS_SOLARIS) || defined(Q_OS_IRIX) || defined(Q_OS_AIX) || defined(Q_OS_HPUX) \
|
||||
|
|
|
@ -847,7 +847,7 @@ static QString toPrettyPercentEncoding(const QString &input, bool forFragment)
|
|||
result.reserve(input.length());
|
||||
for (int i = 0; i < input.length(); ++i) {
|
||||
const QChar c = input.at(i);
|
||||
register ushort u = c.unicode();
|
||||
ushort u = c.unicode();
|
||||
if (u < 0x20
|
||||
|| (!forFragment && u == '?') // don't escape '?' in fragments, not needed and wrong (#173101)
|
||||
|| u == '#' || u == '%'
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
};
|
||||
|
||||
inline unsigned int
|
||||
EntitiesHash::hash_Entity (register const char *str, register unsigned int len)
|
||||
EntitiesHash::hash_Entity (const char *str, unsigned int len)
|
||||
{
|
||||
static const unsigned short asso_values[] =
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ EntitiesHash::hash_Entity (register const char *str, register unsigned int len)
|
|||
1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142,
|
||||
1142, 1142, 1142, 1142, 1142, 1142, 1142
|
||||
};
|
||||
register int hval = len;
|
||||
int hval = len;
|
||||
|
||||
switch (hval)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ EntitiesHash::hash_Entity (register const char *str, register unsigned int len)
|
|||
}
|
||||
|
||||
const struct entity *
|
||||
EntitiesHash::kde_findEntity (register const char *str, register unsigned int len)
|
||||
EntitiesHash::kde_findEntity (const char *str, unsigned int len)
|
||||
{
|
||||
enum
|
||||
{
|
||||
|
@ -836,15 +836,15 @@ EntitiesHash::kde_findEntity (register const char *str, register unsigned int le
|
|||
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = hash_Entity (str, len);
|
||||
int key = hash_Entity (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int index = lookup[key];
|
||||
int index = lookup[key];
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
register const char *s = wordlist_Entity[index].name;
|
||||
const char *s = wordlist_Entity[index].name;
|
||||
|
||||
if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
|
||||
return &wordlist_Entity[index];
|
||||
|
|
|
@ -360,7 +360,7 @@ KSycocaDict::save(QDataStream &str)
|
|||
// use "almost prime" number for sz (to calculate diversity) and later
|
||||
// for the table size of big tables
|
||||
// int sz = d->stringlist->count()*5-1;
|
||||
register unsigned int sz = count()*4 + 1;
|
||||
unsigned int sz = count()*4 + 1;
|
||||
while(!(((sz % 3) && (sz % 5) && (sz % 7) && (sz % 11) && (sz % 13))))
|
||||
sz+=2;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue