Some generic fixes required for future cmake conversion

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/74/head
Michele Calgaro 6 days ago
parent c4566646d9
commit a09cecfffd
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -87,12 +87,6 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `getenv' function. */
#undef HAVE_GETENV
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
@ -111,9 +105,6 @@
/* Define to 1 if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H

@ -76,12 +76,6 @@
/* define if you have the SIOCGIFADDR ioctl and the related headers */
/* #undef COMPILE_GET_INTERFACE_ADDRESS */
/* define if you have the getenv function */
/* #undef HAVE_GETENV */
/* define if you have the strerror function */
#define HAVE_STRERROR 1
/* define if you have the inet_aton function */
/* #define HAVE_INET_ATON 1 */
@ -94,9 +88,6 @@
/* define if you have the inet_ntop function */
/* #undef HAVE_INET_NTOP */
/* define if you have the getnameinfo function */
#define HAVE_GETNAMEINFO
/* define if you have the getaddrinfo function */
#define HAVE_GETADDRINFO
@ -115,9 +106,6 @@
/* define this if you want to disable the inter-process communication support */
/* #undef COMPILE_NO_IPC */
/* Define if you have the `getenv' function. */
/* #undef HAVE_GETENV */
/* Define if you have the <linux/soundcard.h> header file. */
/* #undef HAVE_LINUX_SOUNDCARD_H */

@ -36,10 +36,7 @@
#endif
#include <errno.h>
#ifdef HAVE_STRERROR
#include <string.h> // for strerror()
#endif
#include <string.h>
// FIXME: This stuff should basically die and be eventually replaced with some
// helper functions for handling ONLY system errors.
@ -177,9 +174,7 @@ namespace KviError
{
if((iErrorCode < KVI_NUM_ERRORS) && (iErrorCode >= 0))
return g_errorTable[iErrorCode];
#ifdef HAVE_STRERROR
if(iErrorCode < 0)return strerror(-iErrorCode);
#endif
return g_errorTable[KviError_unknownError];
}

@ -220,9 +220,6 @@ void KviDnsThread::run()
#else //!COMPILE_ON_WINDOWS || COMPILE_IPV6_SUPPORT
int retVal;
//#ifdef HAVE_GETNAMEINFO
struct sockaddr_in ipv4Addr;
#ifdef COMPILE_IPV6_SUPPORT
@ -236,8 +233,6 @@ void KviDnsThread::run()
if(!bIsIpV4Ip)bIsIpV6Ip = KviNetUtils::stringIpToBinaryIp_V6(m_szQuery,(struct in6_addr *)&(ipv6Addr.sin6_addr));
#endif
//#ifdef HAVE_GETNAMEINFO
#ifdef COMPILE_IPV6_SUPPORT
if(bIsIpV4Ip || bIsIpV6Ip)
{
@ -271,12 +266,7 @@ void KviDnsThread::run()
}
} else {
//#endif //HAVE_GETNAMEINFO
//#ifdef COMPILE_IPV6_SUPPORT
// struct in6_addr in6Addr;
//#endif
struct addrinfo * pRet = 0;
struct addrinfo * pNext;
struct addrinfo hints;
@ -334,10 +324,7 @@ void KviDnsThread::run()
}
}
if(pRet)freeaddrinfo(pRet);
//#ifdef HAVE_GETNAMEINFO
}
//#endif //HAVE_GETNAMEINFO
#endif // !COMPILE_ON_WINDOWS

@ -23,8 +23,6 @@
//=============================================================================
#define __KVILIB__
#define _KVI_ENV_CPP_
#include "kvi_env.h"
#include "kvi_string.h"
#include "kvi_malloc.h"

@ -37,21 +37,15 @@
inline char * kvi_getenv(const char * name)
{
#ifdef HAVE_GETENV
return getenv(name);
#else
return 0;
#endif
}
#ifdef COMPILE_ON_WINDOWS
#define kvi_setenv(__name,__value) SetEnvironmentVariable(__name,__value)
#define kvi_unsetenv(__name) SetEnvironmentVariable(__name,NULL)
#else
#ifndef _KVI_ENV_CPP_
KVILIB_API extern bool kvi_setenv(const char * name,const char * value);
KVILIB_API extern void kvi_unsetenv(const char * name);
#endif
KVILIB_API extern bool kvi_setenv(const char * name,const char * value);
KVILIB_API extern void kvi_unsetenv(const char * name);
#endif

@ -558,12 +558,10 @@ void KviApp::findGlobalKvircDirectory()
{
m_szGlobalKvircDir = locate("appdata","");
if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return;
#ifdef HAVE_GETENV
//TDEDIR sanity check...
m_szGlobalKvircDir = getenv("TDEDIR");
m_szGlobalKvircDir+="/share/apps/kvirc/";
if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return;
#endif
//TDEDIR sanity check...
m_szGlobalKvircDir = getenv("TDEDIR");
m_szGlobalKvircDir+="/share/apps/kvirc/";
if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return;
}
// FAILED ? Check the usual way...
#endif //COMPILE_TDE_SUPPORT

@ -134,7 +134,7 @@ void Index::setupDocumentList()
void Index::insertInDict( const TQString &str, int docNum )
{
if ( strcmp( str, "amp" ) == 0 || strcmp( str, "nbsp" ) == 0 )
if ( str == "amp" || str == "nbsp" )
return;
Entry *e = 0;
if ( dict.count() )

@ -396,7 +396,9 @@ int get_id3(mp3info *mp3)
{
retcode |= 4;
} else {
fread(fbuf,1,3,mp3->file); fbuf[3] = '\0';
// silence warning about ignoring return value of fread
[[maybe_unused]] size_t _unused = 0;
_unused = fread(fbuf,1,3,mp3->file); fbuf[3] = '\0';
mp3->id3.genre[0]=255;
if(!strcmp((const char *)"TAG",(const char *)fbuf))
@ -404,16 +406,16 @@ int get_id3(mp3info *mp3)
mp3->id3_isvalid=1;
mp3->datasize -= 128;
fseek(mp3->file, -125, SEEK_END);
fread(mp3->id3.title,1,30,mp3->file); mp3->id3.title[30] = '\0';
fread(mp3->id3.artist,1,30,mp3->file); mp3->id3.artist[30] = '\0';
fread(mp3->id3.album,1,30,mp3->file); mp3->id3.album[30] = '\0';
fread(mp3->id3.year,1,4,mp3->file); mp3->id3.year[4] = '\0';
fread(mp3->id3.comment,1,30,mp3->file); mp3->id3.comment[30] = '\0';
_unused = fread(mp3->id3.title,1,30,mp3->file); mp3->id3.title[30] = '\0';
_unused = fread(mp3->id3.artist,1,30,mp3->file); mp3->id3.artist[30] = '\0';
_unused = fread(mp3->id3.album,1,30,mp3->file); mp3->id3.album[30] = '\0';
_unused = fread(mp3->id3.year,1,4,mp3->file); mp3->id3.year[4] = '\0';
_unused = fread(mp3->id3.comment,1,30,mp3->file); mp3->id3.comment[30] = '\0';
if(mp3->id3.comment[28] == '\0')
{
mp3->id3.track[0] = mp3->id3.comment[29];
}
fread(mp3->id3.genre,1,1,mp3->file);
_unused = fread(mp3->id3.genre,1,1,mp3->file);
unpad(mp3->id3.title);
unpad(mp3->id3.artist);
unpad(mp3->id3.album);

@ -614,7 +614,8 @@ void KviMessageColorsOptionsWidget::load()
//tqDebug("SYMLINKING %s to %s",szGlobal.ptr(),szLocal.ptr());
//tqDebug("SYMLINK RETURNS %d (%d)",::symlink(szGlobal.ptr(),szLocal.ptr()));
//tqDebug("ERRNO (%d)",errno);
symlink(szGlobal,szLocal);
// "int _ = " used to silence warning from compiler about unchecked returned values
int _ = symlink(szGlobal,szLocal);
// FIXME: Do it also on windows...
#endif

@ -30,6 +30,7 @@
#include "kvi_modulemanager.h"
#include "kvi_pointerlist.h"
#include "kvi_string.h"
#include "kvi_tal_tooltip.h"
#include <tqlabel.h>
#include <tqpushbutton.h>

@ -217,14 +217,16 @@ __DATA__
/* Replace: 0 */
#endif
#ifdef HASATTRIBUTE
# if defined(__GNUC__) && defined(__cplusplus)
# define PERL_UNUSED_DECL
#ifndef PERL_UNUSED_DECL
# ifdef HASATTRIBUTE
# if defined(__GNUC__) && defined(__cplusplus)
# define PERL_UNUSED_DECL
# else
# define PERL_UNUSED_DECL __attribute__((unused))
# endif
# else
# define PERL_UNUSED_DECL __attribute__((unused))
# define PERL_UNUSED_DECL
# endif
#else
# define PERL_UNUSED_DECL
#endif
#ifndef dNOOP

@ -1001,7 +1001,8 @@ void KviSetupWizard::accept()
// Make local->global link
TQString localPath = TQString("%1/global").arg(g_pApp->m_szLocalKvircDir);
unlink(TQTextCodec::codecForLocale()->fromUnicode(localPath).data());
symlink(TQTextCodec::codecForLocale()->fromUnicode(g_pApp->m_szGlobalKvircDir).data(),TQTextCodec::codecForLocale()->fromUnicode(localPath).data());
// "int _ = " used to silence warning from compiler about unchecked returned values
int _ = symlink(TQTextCodec::codecForLocale()->fromUnicode(g_pApp->m_szGlobalKvircDir).data(),TQTextCodec::codecForLocale()->fromUnicode(localPath).data());
#endif
#ifdef COMPILE_TDE_SUPPORT

@ -25,16 +25,14 @@
//
//=============================================================================
#ifdef COMPILE_TDE_SUPPORT
#include "kvi_app.h"
#include "kvi_settings.h"
#include "dcopclient.h" // <-- this include should be hidden in kvilib
#ifdef COMPILE_TDE_SUPPORT
#include "tc_ktorrentdcopinterface.h"
#include "dcopclient.h" // <-- this include should be hidden in kvilib
#include "kvi_app.h"
#include "kvi_locale.h"
#include <tqtimer.h>
@ -58,8 +56,8 @@ TORR_IMPLEMENT_DESCRIPTOR(
tqDebug("%s (%s:%d): %s", __PRETTY_FUNCTION__, __FILE__, __LINE__, (const char*)msg); \
#define ERROR_MSG_RANGE(I, SIZE) \
KviTQString::sprintf(m_lastError, __tr2qs_ctx("Index out of range: %d [0-%d]!", "torrent"), I, (SIZE>0)?(SIZE-1):0); \
tqDebug("%s (%s:%d): Index out of range: %d [0-%d]!", __PRETTY_FUNCTION__ , __FILE__, __LINE__, I, (SIZE>0)?(SIZE-1):0);
KviTQString::sprintf(m_lastError, __tr2qs_ctx("Index out of range: %d [0-%ld]!", "torrent"), I, (SIZE>0)?(SIZE-1):0); \
tqDebug("%s (%s:%d): Index out of range: %d [0-%ld]!", __PRETTY_FUNCTION__ , __FILE__, __LINE__, I, (SIZE>0)?(SIZE-1):0);
#define ERROR_RET_BOOL \
{ \

Loading…
Cancel
Save