generic: replace internal with Katie definition checks or remove them completely

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-07-10 02:09:50 +03:00
parent 53fbf4a25d
commit 945ade0f19
22 changed files with 36 additions and 130 deletions

View file

@ -66,7 +66,7 @@
# define HAVE_ETCPASSWD
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#if !defined(__INSURE__)
# define ATTR_UNUSED __attribute__((unused))
# define ATTR_NORETURN __attribute__((noreturn))
# define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))

View file

@ -443,9 +443,7 @@ void KAccessApp::xkbBellNotify(XkbBellNotifyEvent *event)
if (_visibleBellInvert)
{
QPixmap screen = QPixmap::grabWindow(id, 0, 0, window.size.width, window.size.height);
#ifdef __GNUC__
#warning is this the best way to invert a pixmap?
#endif
// QPixmap invert(window.size.width, window.size.height);
QImage i = screen.toImage();
i.invertPixels();
@ -593,10 +591,8 @@ void KAccessApp::createDialogContents() {
KVBox *topcontents = new KVBox (dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
#ifdef __GNUC__
#warning "kde4 fixme"
#endif
//topcontents->setMargin(KDialog::marginHint());
//topcontents->setMargin(KDialog::marginHint());
QWidget *contents = new QWidget(topcontents);
QHBoxLayout * lay = new QHBoxLayout(contents);

View file

@ -672,9 +672,7 @@ void MouseSettings::load(KConfig *config)
handed = RIGHT_HANDED;
else if (key == "LeftHanded")
handed = LEFT_HANDED;
#ifdef __GNUC__
#warning was key == NULL how was this working? is key.isNull() what the coder meant?
#endif
else if (key.isNull())
handed = h;
reverseScrollPolarity = group.readEntry( "ReverseScrollPolarity", false);

View file

@ -230,17 +230,15 @@ void numlock_set_off()
void numlockx_change_numlock_state(Display* dpy_, int state)
{
#ifndef HAVE_XTEST
#ifdef __GNUC__
#warning "XTEST extension not found - numlock setting may not work reliably"
#endif
#warning "XTEST extension not found - numlock setting may not work reliably"
#endif
dpy = dpy_;
dpy = dpy_;
if( state ) {
numlock_set_on();
numlock_set_on();
}
else {
numlock_set_off();
numlock_set_off();
}
}

View file

@ -144,9 +144,7 @@ int XInputEventNotifier::registerForNewDeviceEvent(Display* display)
#else
#ifdef __GNUC__
#warning "Keyboard daemon is compiled without XInput, keyboard settings will be reset when new keyboard device is plugged in!"
#endif
int XInputEventNotifier::registerForNewDeviceEvent(Display* /*display*/)
{

View file

@ -22,35 +22,25 @@
#include "osdepinfo.h"
#include <sys/utsname.h>
OsDepInfo::OsDepInfo()
{
setDepInfo();
struct utsname unixInfo;
if(uname(&unixInfo)) {
return;
}
m_osVersion = QString(unixInfo.sysname) + ' ' + QString(unixInfo.release);
m_hostName = QString(unixInfo.nodename);
}
const QString OsDepInfo::hostName()
{
return m_hostName;
return m_hostName;
}
const QString OsDepInfo::osVersion()
{
return m_osVersion;
return m_osVersion;
}
#if defined(Q_OS_UNIX)
#include "osdepinfo_unix.cpp"
#else
#ifdef __GNUC__
#warning OsDepInfo setting info to blank
#warning Add OsDepInfo for your OS
#endif // __GNUC__
void OsDepInfo::setDepInfo()
{
m_osVersion.clear();
m_hostName.clear();
}
#endif // Q_OS_UNIX

View file

@ -34,8 +34,6 @@ class OsDepInfo
const QString osVersion();
private:
void setDepInfo();
QString m_hostName;
QString m_osVersion;
};

View file

@ -1,34 +0,0 @@
/*
* osdepinfo_unix.cpp
*
* Copyright (C) 2010 David Hubner <hubnerd@ntlworld.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "osdepinfo.h"
#include <sys/utsname.h>
void OsDepInfo::setDepInfo()
{
struct utsname unixInfo;
if(uname(&unixInfo)) return;
m_osVersion = QString(unixInfo.sysname) + ' ' + QString(unixInfo.release);
m_hostName = QString(unixInfo.nodename);
}

View file

@ -22,7 +22,7 @@ typedef quint64 t_memsize;
enum { /* entries for memoryInfos[] */
TOTAL_MEM = 0, /* total physical memory (without swaps) */
FREE_MEM, /* total free physical memory (without swaps) */
#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__)
#if !defined(Q_OS_SOLARIS) && !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD)
SHARED_MEM, /* shared memory size */
BUFFER_MEM, /* buffered memory size */
#else

View file

@ -10,11 +10,6 @@
/* Stop <sys/swap.h> from crapping out on 32-bit architectures. */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
#endif
#include <sys/stat.h>
#include <sys/swap.h>
#include <vm/anon.h>
@ -58,9 +53,7 @@ void KCMMemory::fetchValues() {
kdata = (kstat_named_t *) kstat_data_lookup( ksp, "freemem" );
if( kdata != NULL )
memoryInfos[FREE_MEM] = PAGETOK(kdata->value.ui32);
#ifdef __GNUC__
#warning "FIXME: memoryInfos[CACHED_MEM]"
#endif
memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; // cached memory in ram
kstat_close( kctl );

View file

@ -31,7 +31,7 @@ void PhysicalMemoryChart::paintEvent(QPaintEvent* /*event*/) {
t_memsize bufferMemory;
bufferMemory = 0;
#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__)
#if !defined(Q_OS_SOLARIS) && !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD)
bufferMemory = ZERO_IF_NO_INFO(memoryInfos[BUFFER_MEM]);
#endif
t_memsize cachedMemory = ZERO_IF_NO_INFO(memoryInfos[CACHED_MEM]);

View file

@ -34,16 +34,15 @@
#include <string>
#if defined(__INTEL_COMPILER)
#if defined(__MMX__)
# define HAVE_MMX
#else
# warning no MMX support
#endif
#if defined(__SSE2__)
# define HAVE_SSE2
#elif defined(__GNUC__)
# if defined(__MMX__)
# define HAVE_MMX
# endif
# if defined(__SSE2__) && __GNUC__ > 3
# define HAVE_SSE2
# endif
#else
# warning no SSE2 support
#endif
#ifdef HAVE_MMX

View file

@ -10,9 +10,6 @@ include_directories(
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#ifdef __SUNPRO_CC
#define __asm__ asm
#endif
int main() { __asm__(\"pxor %mm0, %mm0\") ; }"
X86_MMX_FOUND
)

View file

@ -31,7 +31,7 @@
#include "kcpuinfo.h"
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#if defined(__GNUC__)
# define HAVE_GNU_INLINE_ASM
#endif

View file

@ -254,10 +254,6 @@
Using 0 as the conversion flag sets all the default options.
*/
#if defined(Q_CC_DEC) && defined(__alpha) && (__DECCXX_VER-0 >= 50190001)
#pragma message disable narrowptr
#endif
#ifndef QT_NO_IMAGE_TEXT
class QImageDataMisc {
public:

View file

@ -41,7 +41,7 @@ extern int CheckSetupFlag;
* Delivers the message to the front end
*/
void output( const char *fmt, ...)
#ifdef __GNUC__
#if !defined(__INSURE__)
__attribute__ ( ( format ( printf, 1, 2 ) ) )
#endif
;
@ -50,7 +50,7 @@ void output( const char *fmt, ...)
Delivers the error message to the front end.
*/
void print_error( const char*, ... )
#ifdef __GNUC__
#if !defined(__INSURE__)
__attribute__ ( ( format ( printf, 1, 2 ) ) )
#endif
;
@ -59,7 +59,7 @@ void print_error( const char*, ... )
Writes the error message to the syslog daemon.
*/
void log_error( const char*, ... )
#ifdef __GNUC__
#if !defined(__INSURE__)
__attribute__ ( ( format ( printf, 1, 2 ) ) )
#endif
;

View file

@ -26,11 +26,6 @@
/* Stop <sys/swap.h> from crapping out on 32-bit architectures. */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
#endif
#include <sys/stat.h>
#include <sys/swap.h>
#include <vm/anon.h>

View file

@ -22,11 +22,6 @@
/* Stop <sys/procfs.h> from crapping out on 32-bit architectures. */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -48,16 +48,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <xcb/xfixes.h>
#endif
#if defined(__GNUC__)
# define KWIN_ALIGN(n) __attribute((aligned(n)))
# if defined(__SSE2__)
# define HAVE_SSE2
# endif
#elif defined(__INTEL_COMPILER)
# define KWIN_ALIGN(n) __declspec(align(n))
#if defined(__SSE2__)
# define HAVE_SSE2
#else
# define KWIN_ALIGN(n)
# warning no SSE2 support
#endif
#ifdef HAVE_SSE2
@ -1104,7 +1098,7 @@ void WindowQuadList::makeInterleavedArrays(unsigned int type, GLVertex2D *vertic
if (!(intptr_t(vertex) & 0xf)) {
for (int i = 0; i < count(); i++) {
const WindowQuad &quad = at(i);
KWIN_ALIGN(16) GLVertex2D v[4];
Q_DECL_ALIGN(16) GLVertex2D v[4];
for (int j = 0; j < 4; j++) {
const WindowVertex &wv = quad[j];
@ -1147,7 +1141,7 @@ void WindowQuadList::makeInterleavedArrays(unsigned int type, GLVertex2D *vertic
if (!(intptr_t(vertex) & 0xf)) {
for (int i = 0; i < count(); i++) {
const WindowQuad &quad = at(i);
KWIN_ALIGN(16) GLVertex2D v[4];
Q_DECL_ALIGN(16) GLVertex2D v[4];
for (int j = 0; j < 4; j++) {
const WindowVertex &wv = quad[j];

View file

@ -20,9 +20,7 @@
#include "processes_local_p.h"
#include "process.h"
#ifdef __GNUC__
#warning Totally bogus ProcessesLocal implementation
#endif
namespace KSysGuard
{

View file

@ -51,6 +51,8 @@
extern int sys_ioprio_set(int, int, int);
extern int sys_ioprio_get(int, int);
#warning FIXME hardcoded syscall numbers
#define HAVE_IONICE
/* Check if this system has ionice */
#if !defined(SYS_ioprio_get) || !defined(SYS_ioprio_set)
@ -68,9 +70,7 @@ extern int sys_ioprio_get(int, int);
#define __NR_ioprio_set 1274
#define __NR_ioprio_get 1275
#else
#ifdef __GNUC__
#warning "This architecture does not support IONICE. Disabling ionice feature."
#endif
#undef HAVE_IONICE
#endif
/* Map these to SYS_ioprio_get */

View file

@ -19,11 +19,6 @@
/* Stop <sys/procfs.h> from crapping out on 32-bit architectures. */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
#endif
#include "processes_local_p.h"
#include "process.h"