diff options
| author | 2014-11-21 14:34:32 +0000 | |
|---|---|---|
| committer | 2014-11-21 14:34:32 +0000 | |
| commit | 43e0468a233a49b1010f34c5ce888204fa4e9416 (patch) | |
| tree | b1f97b1b9fdfc72677b935d34e26c70fa7030feb /src/kvilib | |
| parent | Trivial typo (diff) | |
| download | KVIrc-43e0468a233a49b1010f34c5ce888204fa4e9416.tar.gz KVIrc-43e0468a233a49b1010f34c5ce888204fa4e9416.tar.bz2 KVIrc-43e0468a233a49b1010f34c5ce888204fa4e9416.zip | |
- massive trailing whitespace cleanup (yes, one of these "you can hate me for that" commits)
- apply patch by d00p: show the correct protocol version instead of just "SSLv3/TLSv1", thanks!
- fix compilation on qt 5.4 on windows
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6398 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/kvilib')
49 files changed, 187 insertions, 187 deletions
diff --git a/src/kvilib/config/kvi_debug.h b/src/kvilib/config/kvi_debug.h index 9422df0cd..650c138c1 100644 --- a/src/kvilib/config/kvi_debug.h +++ b/src/kvilib/config/kvi_debug.h @@ -41,7 +41,7 @@ #define kvi_debug(fmt,arg...) qDebug(fmt,##arg) #define kvi_warning(fmt,arg...) qWarning(fmt,##arg) - #define kvi_fatal(fmt,arg...) do { qFatal(fmt,##arg); abort(); } while(0) + #define kvi_fatal(fmt,arg...) do { qFatal(fmt,##arg); abort(); } while(0) #define KVI_PRETTY_FUNCTION __PRETTY_FUNCTION__ #else //!__GNUC__ @@ -50,7 +50,7 @@ #define kvi_debug(fmt,...) qDebug(fmt,__VA_ARGS__) #define kvi_warning(fmt,...) qWarning(fmt,__VA_ARGS__) - #define kvi_fatal(fmt,...) do { qFatal(fmt,__VA_ARGS__); abort(); } while(0) + #define kvi_fatal(fmt,...) do { qFatal(fmt,__VA_ARGS__); abort(); } while(0) #define KVI_PRETTY_FUNCTION __FUNCTION__ #endif //!__GNUC__ @@ -89,7 +89,7 @@ // But this doesn't work since the specification of the token pasting operator is // // "If a formal parameter in a macro definition is preceded or followed by the token-pasting operator, - // the formal parameter is immediately replaced by the __unexpanded__ actual argument. Macro expansion + // the formal parameter is immediately replaced by the __unexpanded__ actual argument. Macro expansion // is __not performed__ on the argument prior to replacement." // // So to actually have __LINE__ expanded we need another level of indirection @@ -107,7 +107,7 @@ #define KVI_TRACE_BLOCK(_szBlockDescription) \ KviDebugContext KVI_TRACE_HACK_TOKENPASTE_1(ctx,__LINE__)("%s - %s",__PRETTY_FUNCTION__,_szBlockDescription) - + #define KVI_TRACE(_szFmt,arg...) KviDebugContext::trace(_szFmt,##arg) #else @@ -136,8 +136,8 @@ #define KVI_TRACE(_szFmt,arg...) do { } while(0) #else #define KVI_TRACE(_szFmt,...) do { } while(0) - #endif - + #endif + #endif //!COMPILE_DEBUG_MODE diff --git a/src/kvilib/config/kvi_fileextensions.h b/src/kvilib/config/kvi_fileextensions.h index 3443f6bd9..a2b4dccb8 100644 --- a/src/kvilib/config/kvi_fileextensions.h +++ b/src/kvilib/config/kvi_fileextensions.h @@ -64,7 +64,7 @@ #define KVI_FILTER_INI "*.ini|INI File (*.ini)" #define KVI_FILTER_IMAGE "*.png *.jpg *.jpeg *.bmp *.gif *.xpm|Image File (*.png *.jpg *.jpeg *.bmp *.gif *.xpm)" //#define KVI_FILTER_UI "*.ui|User Interface File (*.ui)" -#else +#else #define KVI_FILTER_CONFIG "KVIrc Config (*.kvc)" #define KVI_FILTER_SCRIPT "KVIrc Script (*.kvs)" #define KVI_FILTER_THEME "KVIrc Theme (*.kvt)" diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index 324e5b216..83a010944 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -71,7 +71,7 @@ #define KVIRC_API __declspec(dllimport) __attribute__((visibility("default"))) #define KVIRC_API_TYPEDEF __declspec(dllimport) #endif - + // note: unofficial cmake ports defines OS2 #elif defined(OS2) @@ -124,7 +124,7 @@ // we failback on unix/linux variants #define KVILIB_API __attribute__((visibility("default"))) #define KVILIB_API_TYPEDEF - + #define KVIRC_API __attribute__((visibility("default"))) #define KVIRC_API_TYPEDEF diff --git a/src/kvilib/core/KviCString.h b/src/kvilib/core/KviCString.h index 9ec060938..5c6570c25 100644 --- a/src/kvilib/core/KviCString.h +++ b/src/kvilib/core/KviCString.h @@ -223,7 +223,7 @@ public: // Safe sprintf. This one will never write past the end of the string // It can handle only %s %d %u and %c format flags. KviCString & sprintf(const char *fmt,...); - + KviCString & vsprintf(const char *fmt,kvi_va_list list); // append functions diff --git a/src/kvilib/core/KviHeapObject.h b/src/kvilib/core/KviHeapObject.h index 0d8b28547..fca302a55 100644 --- a/src/kvilib/core/KviHeapObject.h +++ b/src/kvilib/core/KviHeapObject.h @@ -73,7 +73,7 @@ { public: /** - * \brief Overloading of the new operator + * \brief Overloading of the new operator * * \param size_t size in bytes of the memory that has to be allocated * \return void * diff --git a/src/kvilib/core/KviMemory.cpp b/src/kvilib/core/KviMemory.cpp index bfdc840c5..a7de65f44 100644 --- a/src/kvilib/core/KviMemory.cpp +++ b/src/kvilib/core/KviMemory.cpp @@ -420,7 +420,7 @@ namespace KviMemory // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // //============================================================================= - + //============================================================================= // // Inline assembly implementations of the commonly used string functions @@ -428,7 +428,7 @@ namespace KviMemory // only by gcc // //============================================================================= - + inline bool kvi_strEqualCS(const char * pcStr1, const char * pcStr2) { // An instruction pattern is really useful in this case. @@ -454,7 +454,7 @@ namespace KviMemory ); return bEax; } - + inline bool kvi_strEqualCSN(const char * pcStr1, const char * pcStr2, int iLen) { register bool bEax; @@ -480,7 +480,7 @@ namespace KviMemory ); return bEax; } - + // OPTIMIZATION // The following two functions are used to compare a variable string with one in that // only A-Z<->a-z case insensivity is significant. @@ -489,7 +489,7 @@ namespace KviMemory // will always give the correct result // These will NOT work with localizable characters: // 'a' with umlaut will be not equal to 'A' with umlaut - + inline bool kvi_strEqualNoLocaleCI(const char * pcStr1, const char * pcStr2) { // Trivial implementation @@ -529,10 +529,10 @@ namespace KviMemory ); return bEax; } - + inline bool kvi_strEqualNoLocaleCIN(const char * pcStr1, const char * pcStr2, int iLen) { - + register int iReg; register bool bEax; __asm__ __volatile__ ( @@ -585,7 +585,7 @@ namespace KviMemory ); return iEcx; } - + #endif //0 diff --git a/src/kvilib/core/KviMemory.h b/src/kvilib/core/KviMemory.h index 52baf99a6..bb87a635e 100644 --- a/src/kvilib/core/KviMemory.h +++ b/src/kvilib/core/KviMemory.h @@ -142,7 +142,7 @@ namespace KviMemory { memmove(dst_ptr,src_ptr,len); } - + /** * \brief Initializes len bytes of memory starting from dst_ptr to c * diff --git a/src/kvilib/core/KviQString.cpp b/src/kvilib/core/KviQString.cpp index 1da945784..e30f3bb3b 100644 --- a/src/kvilib/core/KviQString.cpp +++ b/src/kvilib/core/KviQString.cpp @@ -52,7 +52,7 @@ namespace KviQString { // The global empty (and null) string const QString Empty; - + static char cHexDigits[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; bool equalCSN(const QString & sz1, const QString & sz2, unsigned int uLen) @@ -565,7 +565,7 @@ namespace KviQString szSrc.remove(szSrc.length() - iRemove,iRemove); } } - + void stripLeft(QString & szSrc, const QChar & c) { int iRemove = 0; @@ -951,7 +951,7 @@ namespace KviQString { return false; } - + const QChar * pSavePos1 = 0; const QChar * pSavePos2 = pM2; while(pM1->unicode()) @@ -1093,7 +1093,7 @@ namespace KviQString if(iIdx == -1) return; szSrc.truncate(bIncluded ? iIdx : iIdx + 1); } - + void cutFromFirst(QString & szSrc, const QString & szFind, bool bIncluded) { int iIdx = szSrc.indexOf(szFind); @@ -1108,7 +1108,7 @@ namespace KviQString if(iIdx == -1) return; szSrc.truncate(bIncluded ? iIdx : iIdx + 1); } - + void cutFromLast(QString & szSrc, const QString & szFind, bool bIncluded) { int iIdx = szSrc.lastIndexOf(szFind); @@ -1126,7 +1126,7 @@ namespace KviQString } szSrc.remove(0,bIncluded ? iIdx + 1 : iIdx); } - + void cutToFirst(QString & szSrc, const QString & szFind, bool bIncluded, bool bClearIfNotFound) { int iIdx = szSrc.indexOf(szFind); @@ -1148,7 +1148,7 @@ namespace KviQString } szSrc.remove(0,bIncluded ? iIdx + 1 : iIdx); } - + void cutToLast(QString & szSrc, const QString & szFind, bool bIncluded, bool bClearIfNotFound) { int iIdx = szSrc.lastIndexOf(szFind); @@ -1167,7 +1167,7 @@ namespace KviQString return bReturnFullStringIfNotFound ? szSrc : QString(); return szSrc.left(bIncluded ? iIdx + 1 : iIdx); } - + QString leftToFirst(QString & szSrc, const QString & szFind, bool bIncluded, bool bReturnFullStringIfNotFound) { int iIdx = szSrc.indexOf(szFind); @@ -1183,7 +1183,7 @@ namespace KviQString return bReturnFullStringIfNotFound ? szSrc : QString(); return szSrc.left(bIncluded ? iIdx + 1 : iIdx); } - + QString leftToLast(QString & szSrc, const QString & szFind, bool bIncluded, bool bReturnFullStringIfNotFound) { int iIdx = szSrc.lastIndexOf(szFind); diff --git a/src/kvilib/core/KviQString.h b/src/kvilib/core/KviQString.h index 7e62ce0dd..e3057a493 100644 --- a/src/kvilib/core/KviQString.h +++ b/src/kvilib/core/KviQString.h @@ -63,7 +63,7 @@ namespace KviQString * \brief A global empty string (note that this is ALSO NULL under Qt 3.x) */ extern KVILIB_API const QString Empty; - + /** * \brief Returns a readable size in byte's multiples * @@ -72,7 +72,7 @@ namespace KviQString * \return QString */ extern KVILIB_API QString makeSizeReadable(quint64 size); - + /** * \brief Compares two strings with case sensitive * @@ -82,7 +82,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCS(const QString & sz1, const QString & sz2); - + /** * \brief Compares two strings with case sensitive * @@ -92,7 +92,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCS(const QString & sz1, const char * pc2); - + /** * \brief Compares two strings with case insensitive * @@ -102,7 +102,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCI(const QString & sz1, const QString & sz2); - + /** * \brief Compares two strings with case insensitive * @@ -112,7 +112,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCI(const QString & sz1, const char * pc2); - + /** * \brief Compares two strings with case insensitive * @@ -156,7 +156,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCIN(const QString & sz1, const QString & sz2, unsigned int uLen); - + /** * \brief Compares two strings with case insensitive up to N chars * @@ -167,7 +167,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCIN(const QString & sz1, const char * pc2, unsigned int uLen); - + /** * \brief Compares two strings with case insensitive up to N chars * @@ -179,7 +179,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool equalCIN(const QString & sz1, const QChar * pC2, unsigned int uLen); - + /** * \brief Compares two strings with case insensitive * @@ -194,7 +194,7 @@ namespace KviQString */ extern KVILIB_API int cmpCI(const QString & sz1, const QString & sz2, bool bNonAlphaGreater = false); // sz1.compare(sz2,Qt::CaseInsensitive) - + /** * \brief Compares two strings with case insensitive up to N chars * @@ -208,7 +208,7 @@ namespace KviQString * \return int */ extern KVILIB_API int cmpCIN(const QString & sz1, const QString & sz2, unsigned int uLen); - + /** * \brief Ensures the last char of a string is the given char * @@ -226,7 +226,7 @@ namespace KviQString * \return bool */ extern KVILIB_API bool matchWildExpressions(const QString & szM1, const QString & szM2); - + /** * \brief Matches two string containging wildcards (* and ?) or regular expressions * \param szExp The regular expression to match @@ -246,14 +246,14 @@ namespace KviQString * \return void */ extern KVILIB_API void vsprintf(QString & szSrc, const QString & szFmt, kvi_va_list list); - + /** * \brief Trims all the whitespaces at the end of the given string * \param szSrc The source string * \return void */ extern KVILIB_API void stripRightWhiteSpace(QString & szSrc); - + /** * \brief Trims all c chars at the start of the given string * \param szSrc The source string @@ -261,7 +261,7 @@ namespace KviQString * \return void */ extern KVILIB_API void stripLeft(QString & szSrc, const QChar & c); - + /** * \brief Trims all c chars at the end of the given string * \param szSrc The source string @@ -269,7 +269,7 @@ namespace KviQString * \return void */ extern KVILIB_API void stripRight(QString & szSrc, const QChar & c); - + /** * \brief Appends a formatted string * \param szSrc The source string @@ -278,7 +278,7 @@ namespace KviQString * \return void */ extern KVILIB_API void appendFormatted(QString & szSrc, const QString & szFmt, ...); - + /** * \brief Appends the given number to the source string * \param szSrc The source string @@ -286,7 +286,7 @@ namespace KviQString * \return void */ extern KVILIB_API void appendNumber(QString & szSrc, double dReal); - + /** * \brief Appends the given number to the source string * \param szSrc The source string @@ -294,7 +294,7 @@ namespace KviQString * \return void */ extern KVILIB_API void appendNumber(QString & szSrc, kvi_i64_t iInteger); - + /** * \brief Appends the given number to the source string * \param szSrc The source string @@ -302,7 +302,7 @@ namespace KviQString * \return void */ extern KVILIB_API void appendNumber(QString & szSrc, int iInteger); - + /** * \brief Appends the given number to the source string * \param szSrc The source string @@ -310,7 +310,7 @@ namespace KviQString * \return void */ extern KVILIB_API void appendNumber(QString & szSrc, unsigned int uInteger); - + /** * \brief Appends the given number to the source string * \param szSrc The source string @@ -329,7 +329,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutFromFirst(QString & szSrc, const QChar & c, bool bIncluded = true); - + /** * \brief Cuts the string after the first occurrence of the given char * @@ -340,7 +340,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutFromFirst(QString & szSrc, const QString & szFind, bool bIncluded = true); - + /** * \brief Cuts the string after the last occurrence of the given char * @@ -351,7 +351,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutFromLast(QString & szSrc, const QChar & c, bool bIncluded = true); - + /** * \brief Cuts the string after the last occurrence of the given char * @@ -362,7 +362,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutFromLast(QString & szSrc, const QString & szFind, bool bIncluded = true); - + /** * \brief Cuts the string until the first occurrence of the given char is found * @@ -374,7 +374,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutToFirst(QString & szSrc, const QChar & c, bool bIncluded = true, bool bClearIfNotFound = false); - + /** * \brief Cuts the string until the first occurrence of the given char is found * @@ -386,7 +386,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutToFirst(QString & szSrc, const QString & szFind, bool bIncluded = true, bool bClearIfNotFound = false); - + /** * \brief Cuts the string until the last occurrence of the given char is found * @@ -398,7 +398,7 @@ namespace KviQString * \return void */ extern KVILIB_API void cutToLast(QString & szSrc, const QChar & c, bool bIncluded = true, bool bClearIfNotFound = false); - + /** * \brief Cuts the string until the last occurrence of the given char is found * @@ -424,7 +424,7 @@ namespace KviQString * \return void */ extern KVILIB_API QString leftToFirst(QString & szSrc, const QChar & c, bool bIncluded = true, bool bReturnFullStringIfNotFound = true); - + /** * \brief Returns the string up to the first occurrence of the given string * @@ -438,7 +438,7 @@ namespace KviQString * \return void */ extern KVILIB_API QString leftToFirst(QString & szSrc, const QString & szFind, bool bIncluded = true, bool bReturnFullStringIfNotFound = true); - + /** * \brief Returns the string up to the last occurrence of the given char * @@ -452,7 +452,7 @@ namespace KviQString * \return void */ extern KVILIB_API QString leftToLast(QString & szSrc, const QChar & c, bool bIncluded = true, bool bReturnFullStringIfNotFound = true); - + /** * \brief Returns the string up to the last occurrence of the given string * @@ -473,14 +473,14 @@ namespace KviQString * \return QString */ extern KVILIB_API QString upperISO88591(const QString & szSrc); - + /** * \brief Returns an ISO-8859-1 lower case string * \param szSrc The source string * \return QString */ extern KVILIB_API QString lowerISO88591(const QString & szSrc); - + /** * \brief Returns a token from a string * \param szSrc The source string diff --git a/src/kvilib/ext/KviAnimatedPixmapCache.h b/src/kvilib/ext/KviAnimatedPixmapCache.h index 60cc9eb17..9a35069d7 100644 --- a/src/kvilib/ext/KviAnimatedPixmapCache.h +++ b/src/kvilib/ext/KviAnimatedPixmapCache.h @@ -148,9 +148,9 @@ public: { m_pInstance->internalFree(data); } - + static QPixmap* dummyPixmap(); - + static void notifyDelete(KviAnimatedPixmapInterface* receiver) { m_pInstance->internalNotifyDelete(receiver); diff --git a/src/kvilib/ext/KviCommandFormatter.cpp b/src/kvilib/ext/KviCommandFormatter.cpp index dc7b2816b..31377928a 100644 --- a/src/kvilib/ext/KviCommandFormatter.cpp +++ b/src/kvilib/ext/KviCommandFormatter.cpp @@ -32,7 +32,7 @@ namespace KviCommandFormatter { if(!(*pszArray)) return false; // can't have more leading chars - + bool bGotIt = false; while(*pszArray) { diff --git a/src/kvilib/ext/KviCryptEngine.h b/src/kvilib/ext/KviCryptEngine.h index 5b01b4de5..cef18bd51 100644 --- a/src/kvilib/ext/KviCryptEngine.h +++ b/src/kvilib/ext/KviCryptEngine.h @@ -64,13 +64,13 @@ class KviCString; WantEncryptKey = 4, WantDecryptKey = 8 }; - + enum EncryptResult { Encrypted, Encoded, EncryptError }; - + enum DecryptResult { DecryptOkWasEncrypted, DecryptOkWasEncoded, diff --git a/src/kvilib/ext/KviDebugContext.cpp b/src/kvilib/ext/KviDebugContext.cpp index 00a8be75e..571c36dca 100644 --- a/src/kvilib/ext/KviDebugContext.cpp +++ b/src/kvilib/ext/KviDebugContext.cpp @@ -22,14 +22,14 @@ KviDebugContext::KviDebugContext(const char * pcContext, ...) m_szContext.vsprintf(pcContext,list); kvi_va_end(list); - + static KviCString szEnterMark = ">> %s"; - + KviCString szPrefix = g_szIndentPrefix; szPrefix.append(szEnterMark); - + qDebug(szPrefix.ptr(),m_szContext.ptr()); - + g_szIndentPrefix.append(" "); } @@ -56,11 +56,11 @@ void KviDebugContext::trace(const char * pcFmt, ...) szOut.vsprintf(pcFmt,list); kvi_va_end(list); - + static KviCString szEnterMark = "-- %s"; - + KviCString szPrefix = g_szIndentPrefix; szPrefix.append(szEnterMark); - + qDebug(szPrefix.ptr(),szOut.ptr()); } diff --git a/src/kvilib/ext/KviDebugContext.h b/src/kvilib/ext/KviDebugContext.h index ecf1e6ade..feccc1af7 100644 --- a/src/kvilib/ext/KviDebugContext.h +++ b/src/kvilib/ext/KviDebugContext.h @@ -59,7 +59,7 @@ private: KviCString m_szContext; public: /** - * \brief + * \brief * \param pcFmt The format list argument * \param ... The succeding arguments * \return void diff --git a/src/kvilib/ext/KviOggTheoraDecoder.cpp b/src/kvilib/ext/KviOggTheoraDecoder.cpp index 83da7e571..914c5f060 100644 --- a/src/kvilib/ext/KviOggTheoraDecoder.cpp +++ b/src/kvilib/ext/KviOggTheoraDecoder.cpp @@ -112,7 +112,7 @@ void KviOggTheoraDecoder::addData(KviDataBuffer * stream) // qDebug("adddata signal %p stream size %d",m_pVideoSignal, stream->size() ); if(stream->size()==0)return; /* Ogg file open; parse the headers */ - + if(!stateflag) { @@ -209,7 +209,7 @@ void KviOggTheoraDecoder::addData(KviDataBuffer * stream) geometry.frame_h = ti.frame_height; geometry.pic_x = ti.pic_x; geometry.pic_y = ti.pic_y; - + px_fmt=ti.pixel_fmt; switch(ti.pixel_fmt) { @@ -326,7 +326,7 @@ void KviOggTheoraDecoder::video_write(void) out[j*4+2] = OC_CLAMP255(r); out[j*4+3] = 255; //alpha } - + } int size = sizeof(char) * geometry.pic_w * geometry.pic_h * ARGB32_BPP; diff --git a/src/kvilib/ext/KviOggTheoraEncoder.cpp b/src/kvilib/ext/KviOggTheoraEncoder.cpp index e508de56c..df2bcafca 100644 --- a/src/kvilib/ext/KviOggTheoraEncoder.cpp +++ b/src/kvilib/ext/KviOggTheoraEncoder.cpp @@ -142,7 +142,7 @@ KviOggTheoraEncoder::KviOggTheoraEncoder(KviDataBuffer * stream, int iWidth, int } // write the bitstream header packets with proper page interleave th_comment_init(&tc); - + // Repeatedly call th_encode_flushheader() to retrieve all the header packets. // first packet will get its own page automatically if(th_encode_flushheader(td,&tc,&op)<=0){ @@ -223,7 +223,7 @@ void KviOggTheoraEncoder::addVideoFrame(QRgb * rgb32, int) rgb32toyuv444(rgb32, videoYuv, geometry.pic_w, geometry.pic_h); // qDebug("addFrame p%p size%d yuv%p",rgb32,videoSize,videoYuv); - + ogg_page videopage; // is there a video page flushed? If not, fetch one if possible diff --git a/src/kvilib/ext/KviOggTheoraEncoder.h b/src/kvilib/ext/KviOggTheoraEncoder.h index f28ea8bff..a0310f3fe 100644 --- a/src/kvilib/ext/KviOggTheoraEncoder.h +++ b/src/kvilib/ext/KviOggTheoraEncoder.h @@ -103,7 +103,7 @@ private: public: /** * \brief Appends a video frame to the stream - * \param rgb32 video frame as a matrix of rgb32 pixels + * \param rgb32 video frame as a matrix of rgb32 pixels * \param videoSize size of the video frame * \return void */ diff --git a/src/kvilib/ext/KviRegisteredChannelDataBase.cpp b/src/kvilib/ext/KviRegisteredChannelDataBase.cpp index 83d6e4b4c..9c4e085d5 100644 --- a/src/kvilib/ext/KviRegisteredChannelDataBase.cpp +++ b/src/kvilib/ext/KviRegisteredChannelDataBase.cpp @@ -80,7 +80,7 @@ void KviRegisteredChannelDataBase::save(const QString &filename) QHash<QString,QString> * pPropertyDict = c->propertyDict(); KVI_ASSERT(pPropertyDict); - + for(QHash<QString,QString>::Iterator it2 = pPropertyDict->begin();it2 != pPropertyDict->end();++it2) cfg.writeEntry(it2.key(),it2.value()); } @@ -150,7 +150,7 @@ void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c) // merge properties QHash<QString,QString> * pPropertyDict = old->propertyDict(); KVI_ASSERT(pPropertyDict); - + for(QHash<QString,QString>::Iterator it = pPropertyDict->begin();it != pPropertyDict->end();++it) { if(!c->property(it.key()).isEmpty()) @@ -182,6 +182,6 @@ void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c) } idx++; } - + l->append(c); } diff --git a/src/kvilib/file/KviFile.h b/src/kvilib/file/KviFile.h index cddeee7e5..a60c1aeb1 100644 --- a/src/kvilib/file/KviFile.h +++ b/src/kvilib/file/KviFile.h @@ -57,14 +57,14 @@ public: * \return KviFile */ KviFile(); - + /** * \brief Constructs file object * \param szName The name of the file * \return KviFile */ KviFile(const QString & szName); - + /** * \brief Destroys file object */ @@ -165,7 +165,7 @@ public: * \return bool */ bool save(KviPointerList<KviCString> * pData); - + /** * \brief Loads a file * \param file The file to load diff --git a/src/kvilib/file/KviFileUtils.cpp b/src/kvilib/file/KviFileUtils.cpp index 690a31e50..3d0f762c6 100644 --- a/src/kvilib/file/KviFileUtils.cpp +++ b/src/kvilib/file/KviFileUtils.cpp @@ -39,7 +39,7 @@ namespace KviFileUtils { static char cHexChars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - + /* WORKING CODE BUT UNUSED FOR NOW bool readLine(QFile * f,QString &szBuffer,bool bClearBuffer) @@ -260,14 +260,14 @@ namespace KviFileUtils // just to be sure check that we're not deleting .. if(KviQString::equalCS(inf.fileName(),"..") || KviQString::equalCS(inf.fileName(),".")) continue; - + if(inf.isDir()) { if(!deleteDir(inf.absoluteFilePath())) return false; continue; } - + if(!KviFileUtils::removeFile(inf.absoluteFilePath())) { qDebug("Failed to remove file %s",inf.absoluteFilePath().toUtf8().data()); diff --git a/src/kvilib/irc/KviAvatarCache.h b/src/kvilib/irc/KviAvatarCache.h index 0b0c50d02..9b04b60d1 100644 --- a/src/kvilib/irc/KviAvatarCache.h +++ b/src/kvilib/irc/KviAvatarCache.h @@ -80,7 +80,7 @@ public: * \return void */ static void done(); - + /** * \brief Returns the instance of the avatar cache * \return KviAvatarCache * @@ -111,13 +111,13 @@ public: * \return const QString & */ const QString & lookup(const KviIrcMask & mask, const QString & szNetwork); - + /** * \brief Deletes the cache * \return void */ void cleanup(); - + /** * \brief Loads the cache * \param szFileName The cache filename diff --git a/src/kvilib/irc/KviControlCodes.cpp b/src/kvilib/irc/KviControlCodes.cpp index b28a5a1cb..aea98782f 100644 --- a/src/kvilib/irc/KviControlCodes.cpp +++ b/src/kvilib/irc/KviControlCodes.cpp @@ -82,7 +82,7 @@ namespace KviControlCodes szRet += szData.mid(iBegin,i - iBegin); return szRet; } - + const kvi_wchar_t * getColorBytesW(const kvi_wchar_t * pwData, unsigned char * pcByte1, unsigned char * pcByte2) { // diff --git a/src/kvilib/irc/KviControlCodes.h b/src/kvilib/irc/KviControlCodes.h index 818bf5680..07542a4cc 100644 --- a/src/kvilib/irc/KviControlCodes.h +++ b/src/kvilib/irc/KviControlCodes.h @@ -36,7 +36,7 @@ * \file KviControlCodes.h * \author Szymon Stefanek * \brief This file holds the text control codes -* +* * It was originally named KviMircCntrl */ @@ -55,7 +55,7 @@ // created when looking for a good placement for the CRYPT escape char in KVirc. // I guess that the best chars to be used were FS,GS,RS,US,DC1,DC2,DC3,DC4...they have the "less defined" // meaning as ASCII control chars. -// mmmh... :) +// mmmh... :) // ASCII IRC Meaning // 000 NUL Null (Cannot be assigned) @@ -172,7 +172,7 @@ namespace KviControlCodes */ KVILIB_API QString stripControlBytes(const QString & szData); - + KVILIB_API const kvi_wchar_t * getColorBytesW(const kvi_wchar_t * pwData, unsigned char * pcByte1, unsigned char * pcByte2); KVILIB_API unsigned int getUnicodeColorBytes(const QString & szData, unsigned int iChar, unsigned char * pcByte1, unsigned char * pcByte2); diff --git a/src/kvilib/irc/KviIdentityProfile.cpp b/src/kvilib/irc/KviIdentityProfile.cpp index 467cfa3b0..2f5d1d949 100644 --- a/src/kvilib/irc/KviIdentityProfile.cpp +++ b/src/kvilib/irc/KviIdentityProfile.cpp @@ -89,6 +89,6 @@ bool KviIdentityProfile::load(KviConfigurationFile * pCfg, const QString & szPre szTmp = QString("%1RealName").arg(szPrefix); m_szRealName = pCfg->readEntry(szTmp); - + return true; } diff --git a/src/kvilib/irc/KviIrcMask.cpp b/src/kvilib/irc/KviIrcMask.cpp index 454434871..5ef127f67 100644 --- a/src/kvilib/irc/KviIrcMask.cpp +++ b/src/kvilib/irc/KviIrcMask.cpp @@ -354,7 +354,7 @@ bool KviIrcMask::matchWildString(const QString & szExp, const QString & szStr) c if(!pPtr) return 0; - + while(pPtr->unicode()) { if((pPtr->unicode() == '[') || (pPtr->unicode() == ']')) @@ -371,7 +371,7 @@ bool KviIrcMask::matchWildString(const QString & szExp, const QString & szStr) c return re.exactMatch(szStr); } - + int KviIrcMask::getIpDomainMaskLen() const { int iLen = m_szHost.length(); diff --git a/src/kvilib/irc/KviIrcMask.h b/src/kvilib/irc/KviIrcMask.h index 4498bd909..c4ed69920 100644 --- a/src/kvilib/irc/KviIrcMask.h +++ b/src/kvilib/irc/KviIrcMask.h @@ -202,7 +202,7 @@ public: * * If the host or username are not known, the mask may contain less * information than requested. - * + * * Mask types: * 0: nick!user@\machine.host.top (nick!user@\XXX.XXX.XXX.XXX) (default) * 1: nick!user@*.host.top (nick!user@\XXX.XXX.XXX.*) @@ -226,7 +226,7 @@ public: * 19: *!~user@*.host.top (*!~user@\XXX.XXX.*) * 20: nick!*user@*.host.top (nick!*user@\XXX.XXX.*) * 21: *!*user@*.host.top (*!user@*XXX.XXX.*) - * + * * Smart versions of the masks 17-21 that try take care of masked ip addresses * in the form xxx.xxx.INVALID-TOP-MASK * 22: nick!~user@*.host.top (nick!~user@\XXX.XXX.*) @@ -234,10 +234,10 @@ public: * 24: *!~user@*.host.top (*!~user@\XXX.XXX.*) * 25: nick!*user@*.host.top (nick!*user@\XXX.XXX.*) * 26: *!*user@*.host.top (*!user@*XXX.XXX.*) - * + * * If some data is missing, these types may change: * For example, if hostname is missing, the mask type 3 or 4 may be reduced to type 5 - * + * * ident is fun.. ahem * prefixes used: * none I line with ident diff --git a/src/kvilib/irc/KviIrcNetwork.h b/src/kvilib/irc/KviIrcNetwork.h index 82fdba182..6252faad8 100644 --- a/src/kvilib/irc/KviIrcNetwork.h +++ b/src/kvilib/irc/KviIrcNetwork.h @@ -186,7 +186,7 @@ public: * \return KviNickServRuleSet * */ inline KviNickServRuleSet * nickServRuleSet(){ return m_pNickServRuleSet; }; - + /** * \brief Sets the rules for NickServ * \param pSet The rule set where to add rules @@ -282,7 +282,7 @@ public: * \return void */ inline void setPassword(const QString & szPass){ m_szPass = szPass; }; - + /** * \brief Sets the list of channels to mark for autojoin * \param pNewChannelList The channel list diff --git a/src/kvilib/irc/KviIrcServer.h b/src/kvilib/irc/KviIrcServer.h index 6f38c080b..497838ed7 100644 --- a/src/kvilib/irc/KviIrcServer.h +++ b/src/kvilib/irc/KviIrcServer.h @@ -437,7 +437,7 @@ public: /** * \brief Applies the filter to the server - * + * * A link filter resides between the low-level socket, which send/receive blocks * of bytes, and the connection which talk using IRC messages. * The filter can remap blocks of bytes in any direction diff --git a/src/kvilib/irc/KviIrcUserEntry.cpp b/src/kvilib/irc/KviIrcUserEntry.cpp index 1ca4cecae..73296f731 100644 --- a/src/kvilib/irc/KviIrcUserEntry.cpp +++ b/src/kvilib/irc/KviIrcUserEntry.cpp @@ -75,7 +75,7 @@ void KviIrcUserEntry::setRealName(const QString & szReal) m_szRealName.remove(0,3); } } - + /* * smart nick color code: min length=5, max length=7 * 1 - ^K, 2 - digit, 3 - coma, 4 - digit, 5 - KVI_TEXT_RESET, 6 - start of realname. diff --git a/src/kvilib/irc/KviIrcUserEntry.h b/src/kvilib/irc/KviIrcUserEntry.h index c5983727d..40207a0f1 100644 --- a/src/kvilib/irc/KviIrcUserEntry.h +++ b/src/kvilib/irc/KviIrcUserEntry.h @@ -89,7 +89,7 @@ protected: int m_iHops; Gender m_eGender; QString m_szUserFlags; - + bool m_bAway; bool m_bIrcOp; @@ -204,7 +204,7 @@ public: * \return void */ void setUserFlags(const QString & szFlags){ m_szUserFlags = szFlags; }; - + /** * \brief Returns true if the user is marked as a bot * \return bool diff --git a/src/kvilib/irc/KviNickServRuleSet.cpp b/src/kvilib/irc/KviNickServRuleSet.cpp index aaaa4c92c..c0a42cffe 100644 --- a/src/kvilib/irc/KviNickServRuleSet.cpp +++ b/src/kvilib/irc/KviNickServRuleSet.cpp @@ -200,12 +200,12 @@ KviNickServRuleSet * KviNickServRuleSet::createInstance() KviNickServRule * KviNickServRuleSet::matchRule(const QString & szNick, const KviIrcMask * pNickServ, const QString & szMsg, const QString & szServer) { if(!m_pRules) return 0; - + for(KviNickServRule *r = m_pRules->first();r;r = m_pRules->next()) { if(!KviQString::matchString(r->registeredNick(),szNick,false,true)) continue; - + if(!szServer.isEmpty()) { QRegExp res(r->serverMask(),Qt::CaseInsensitive,QRegExp::Wildcard); diff --git a/src/kvilib/irc/KviUserIdentity.h b/src/kvilib/irc/KviUserIdentity.h index e5562d92b..5b5a727a2 100644 --- a/src/kvilib/irc/KviUserIdentity.h +++ b/src/kvilib/irc/KviUserIdentity.h @@ -57,28 +57,28 @@ protected: QString m_szId; // the identity set name QString m_szNickName; - + QString m_szAltNickName1; QString m_szAltNickName2; QString m_szAltNickName3; - + QString m_szUserName; QString m_szRealName; QString m_szPassword; - + KviPixmap m_pixAvatar; - + QString m_szPartMessage; QString m_szQuitMessage; - + QString m_szAge; QString m_szGender; QString m_szLocation; QString m_szLanguages; QString m_szOtherInfo; - + QString m_szUserMode; - + QString m_szOnConnectCommand; QString m_szOnLoginCommand; public: diff --git a/src/kvilib/irc/KviUserIdentityManager.h b/src/kvilib/irc/KviUserIdentityManager.h index f6beb9620..8f59c3818 100644 --- a/src/kvilib/irc/KviUserIdentityManager.h +++ b/src/kvilib/irc/KviUserIdentityManager.h @@ -104,7 +104,7 @@ public: * \return void */ void setDefaultIdentity(const QString & szIdentityId){ m_szDefaultIdentity = szIdentityId; }; - + /** * \brief Creates a new working copy * \return KviUserIdentityManager * diff --git a/src/kvilib/locale/KviLocale.cpp b/src/kvilib/locale/KviLocale.cpp index f30c2c7ef..5f52f43e3 100644 --- a/src/kvilib/locale/KviLocale.cpp +++ b/src/kvilib/locale/KviLocale.cpp @@ -298,7 +298,7 @@ protected: static KviPointerHashTable<const char *,KviSmartTextCodec> * g_pSmartCodecDict = 0; -static const char * encoding_groups[] = +static const char * encoding_groups[] = { "Unicode", "West European", @@ -364,7 +364,7 @@ static KviLocale::EncodingDescription supported_encodings[] = { "TSCII" , 0 , 0 , 7, "Tamil" }, { "CP-949" , 0 , 0 , 7, "Korean Codepage" }, #endif - + // smart codecs that send in the local charset // West European { "ISO-8859-1 [UTF-8]" , 1 , 0 , 1, "Western, Latin-1 - Unicode" }, @@ -516,7 +516,7 @@ KviLocale::KviLocale(QApplication * pApp, const QString & szLocaleDir, const QSt { // ensure Qt will use the right locale when formatting dates, numbers, .. // Note: Qt will use the system() locale anyway, we need to construct an empty QLocale() - // to get it use our specified locale. + // to get it use our specified locale. QLocale::setDefault(QLocale(QString::fromLatin1(g_szLang.ptr(), g_szLang.len()))); QString szBuffer; @@ -752,7 +752,7 @@ const QString & KviLocale::translateToQString(const char * pcText, const char * { if(!pcContext) return g_pMainCatalogue->translateToQString(pcText); - + KviMessageCatalogue * pCatalogue = g_pCatalogueDict->find(pcContext); if(!pCatalogue) { diff --git a/src/kvilib/locale/KviLocale.h b/src/kvilib/locale/KviLocale.h index 6117709bb..44ba804c1 100644 --- a/src/kvilib/locale/KviLocale.h +++ b/src/kvilib/locale/KviLocale.h @@ -157,7 +157,7 @@ public: /** * \brief Finds the catalogue - * + * * This function attempts to determine the current locale and then load the * corresponding translation file from the KVIrc locale directory. * Returns true if the locale was correctly set; i.e. the locale is C or POSIX diff --git a/src/kvilib/locale/KviMessageCatalogue.h b/src/kvilib/locale/KviMessageCatalogue.h index 6c0f4ac73..2d237b442 100644 --- a/src/kvilib/locale/KviMessageCatalogue.h +++ b/src/kvilib/locale/KviMessageCatalogue.h @@ -61,8 +61,8 @@ protected: QTextCodec * m_pTextCodec; public: /** - * \brief - * \param szName + * \brief + * \param szName * \return bool */ bool load(const QString & szName); diff --git a/src/kvilib/locale/KviTranslationEntry.h b/src/kvilib/locale/KviTranslationEntry.h index fb0b9754d..a2ead8f9d 100644 --- a/src/kvilib/locale/KviTranslationEntry.h +++ b/src/kvilib/locale/KviTranslationEntry.h @@ -30,7 +30,7 @@ * \file KviTranslationEntry.h * \author Szymon Stefanek * \brief Holds the translation strings -* +* * This file was originally part of KviLocale.h */ diff --git a/src/kvilib/locale/KviTranslator.h b/src/kvilib/locale/KviTranslator.h index 8187b1b92..572106be9 100644 --- a/src/kvilib/locale/KviTranslator.h +++ b/src/kvilib/locale/KviTranslator.h @@ -30,7 +30,7 @@ * \file KviTranslator.h * \author Szymon Stefanek * \brief KVIrc translator class -* +* * This file was originally part of KviLocale.h */ diff --git a/src/kvilib/net/KviDnsResolver.cpp b/src/kvilib/net/KviDnsResolver.cpp index c4faad049..a6b53b6f2 100644 --- a/src/kvilib/net/KviDnsResolver.cpp +++ b/src/kvilib/net/KviDnsResolver.cpp @@ -373,9 +373,9 @@ KviDnsResolver::~KviDnsResolver() qDebug("Failed to wait for the slave dns thread: we're probably going to crash!"); delete m_pSlaveThread; // will eventually terminate it (but it will also block us!!!) } - + //QApplication::removePostedEvents(this); // the Qt doc says that we shouldn't need this - + if(m_pDnsResult) delete m_pDnsResult; if(m_pAuxData) diff --git a/src/kvilib/net/KviDnsResolver.h b/src/kvilib/net/KviDnsResolver.h index d9a753ea4..57efee557 100644 --- a/src/kvilib/net/KviDnsResolver.h +++ b/src/kvilib/net/KviDnsResolver.h @@ -59,7 +59,7 @@ public: { return m_pHostnameList; } - + KviPointerList<QString> * ipAddressList() { return m_pIpAddressList; @@ -164,7 +164,7 @@ public: { KVI_ASSERT(pResult); } - + virtual ~KviDnsResolverThreadEvent() { if(m_pResult) diff --git a/src/kvilib/net/KviHttpRequest.cpp b/src/kvilib/net/KviHttpRequest.cpp index 98bf7b91a..d85e4d7f6 100644 --- a/src/kvilib/net/KviHttpRequest.cpp +++ b/src/kvilib/net/KviHttpRequest.cpp @@ -77,7 +77,7 @@ KviHttpRequest::KviHttpRequest() KviHttpRequest::~KviHttpRequest() { resetInternalStatus(); - + KVI_ASSERT(!(m_p->pSocket)); KVI_ASSERT(!(m_p->pFile)); @@ -212,12 +212,12 @@ void KviHttpRequest::closeSocket() m_p->pSocket->abort(); m_p->pSocket->close(); - + // This can be called from a socket handler slot m_p->pSocket->deleteLater(); - + //delete m_p->pSocket; - + m_p->pSocket = NULL; } @@ -272,9 +272,9 @@ void KviHttpRequest::slotSocketConnected() ); KviCString szMethod; - + bool bIsPost = false; - + if(m_eProcessingType == HeadersOnly) szMethod = "HEAD"; else if(m_szPostData.isEmpty()) @@ -349,7 +349,7 @@ void KviHttpRequest::slotSocketReadDataReady() } // FIXME: Avoid double-buffering here! - + KviDataBuffer oBuffer(iBytes); int iRead = m_p->pSocket->read((char *)(oBuffer.data()),iBytes); @@ -361,7 +361,7 @@ void KviHttpRequest::slotSocketReadDataReady() slotSocketDisconnected(); return; } - + // FIXME // well... otherwise just wait. // FIXME ? @@ -438,7 +438,7 @@ bool KviHttpRequest::doConnect() delete m_p->pConnectTimeoutTimer; m_p->pConnectTimeoutTimer = NULL; } - + m_p->pConnectTimeoutTimer = new QTimer(); m_p->pConnectTimeoutTimer->setSingleShot(true); QObject::connect(m_p->pConnectTimeoutTimer,SIGNAL(timeout()),this,SLOT(slotConnectionTimedOut())); @@ -459,7 +459,7 @@ bool KviHttpRequest::doConnect() ); */ - + return true; } @@ -727,9 +727,9 @@ bool KviHttpRequest::processHeader(KviCString &szHeader) { // this is not "OK" and not "Partial content" // Error, redirect or something confusing - + // FIXME: Handle 30x codes by re-issuing the request with the new URI ? - + if(m_eProcessingType != HeadersOnly) { // this is an error then diff --git a/src/kvilib/net/KviNetUtils.h b/src/kvilib/net/KviNetUtils.h index 13f62b84e..111edfc1c 100644 --- a/src/kvilib/net/KviNetUtils.h +++ b/src/kvilib/net/KviNetUtils.h @@ -37,12 +37,12 @@ //#include <tpipv6.h> #define in6_addr in_addr6 #endif - #else + #else #ifdef WIN2K #include <wspiapi.h> #else #include <ws2tcpip.h> - #endif + #endif #endif #else #include <sys/types.h> diff --git a/src/kvilib/net/KviSASL.cpp b/src/kvilib/net/KviSASL.cpp index e346d2df3..407ab5122 100644 --- a/src/kvilib/net/KviSASL.cpp +++ b/src/kvilib/net/KviSASL.cpp @@ -165,7 +165,7 @@ namespace KviSASL * 4) our password, crypted using blowfish in ecb mode and the dh secret as the blowfish key * Then, the answer is to be base64 encoded. */ - + int answerLen = 2 + pKlen + baNick.size() + 1 + passLen; char * answer = (char *) malloc(answerLen); char * answer2 = answer; diff --git a/src/kvilib/net/KviSASL.h b/src/kvilib/net/KviSASL.h index 861709280..f21b22df2 100644 --- a/src/kvilib/net/KviSASL.h +++ b/src/kvilib/net/KviSASL.h @@ -42,7 +42,7 @@ namespace KviSASL * \param szOut A KviCString that will be filled with the authentication message * \param baNick The username * \param baPass The password - * \return bool + * \return bool */ extern KVILIB_API bool plainMethod(KviCString & szIn, KviCString & szOut, QByteArray & baNick, QByteArray & baPass); diff --git a/src/kvilib/net/KviSSL.cpp b/src/kvilib/net/KviSSL.cpp index 9d9b91dd9..0a370e7bc 100644 --- a/src/kvilib/net/KviSSL.cpp +++ b/src/kvilib/net/KviSSL.cpp @@ -355,8 +355,8 @@ bool KviSSL::initContext(Method m) { // we have to request the peer certificate, else only the client can see the peer identity, not the server SSL_CTX_set_verify(m_pSSLCtx, SSL_VERIFY_PEER, verify_clientCallback); - } - + } + // we want all ciphers to be available here, except insecure ones, orderer by strength; // ADH are moved to the end since they are less secure, but they don't need a certificate // (so we can use secure dcc without a cert) @@ -547,7 +547,7 @@ KviSSLCipherInfo * KviSSL::getCurrentCipherInfo() SSL_CIPHER * c = SSL_get_current_cipher(m_pSSL); #endif if(!c)return 0; - return new KviSSLCipherInfo(c); + return new KviSSLCipherInfo(c, m_pSSL); } @@ -621,7 +621,7 @@ bool KviSSLCertificate::fingerprintIsValid() EVP_PKEY * pkey = X509_get_pubkey(m_pX509); int rv = X509_verify(m_pX509, pkey); - + // careful: https://support.ntp.org/bugs/show_bug.cgi?id=1127 // quote: X509_verify is a call to ASN1_item_verify which can return both 0 and -1 for error cases. // In particular it can return -1 when the message digest type is not known, or memory allocation failed. @@ -632,33 +632,33 @@ int KviSSLCertificate::fingerprintDigestId() { if(!m_pX509) return -1; - + int NID = OBJ_obj2nid(m_pX509->sig_alg->algorithm); - if (NID == NID_undef) + if (NID == NID_undef) { // unknow digest function: it means the signature can't be verified: the certificate can't be trusted return 0; } - + const EVP_MD * mdType = NULL; mdType = EVP_get_digestbyname(OBJ_nid2sn(NID)); - - if (mdType == NULL) + + if (mdType == NULL) { // Unknown digest return 0; } - + return mdType->type; } const char * KviSSLCertificate::fingerprintDigestStr() { int iDigestType = fingerprintDigestId(); - + if(iDigestType == 0) return ""; - + return OBJ_nid2ln(iDigestType); } @@ -674,10 +674,10 @@ const char * KviSSLCertificate::fingerprintContents(QString digestName) } else { pDigestName = digestName.toUtf8().data(); } - + if(getFingerprint(bufferData, &bufferLen, pDigestName) != 0) return ""; - + QByteArray digestByteArray = QByteArray::fromRawData((char *) bufferData, bufferLen); return digestByteArray.toHex().data(); } @@ -688,21 +688,21 @@ int KviSSLCertificate::getFingerprint(unsigned char * bufferData, unsigned int * // doesn't collide with the one from openssl if(!m_pX509) return -99; - + const EVP_MD * mdType = NULL; mdType = EVP_get_digestbyname(digestName); - - if (mdType == NULL) + + if (mdType == NULL) { // Unknown digest return -98; } - + if (!X509_digest(m_pX509, mdType, bufferData, bufferLen)) { return -97; } - + return 0; } @@ -829,12 +829,12 @@ const char * KviSSLCertificate::verify() */ #if OPENSSL_VERSION_NUMBER >= 0x10000000L -KviSSLCipherInfo::KviSSLCipherInfo(const SSL_CIPHER * c) +KviSSLCipherInfo::KviSSLCipherInfo(const SSL_CIPHER * c, const SSL * s) #else -KviSSLCipherInfo::KviSSLCipherInfo(SSL_CIPHER * c) +KviSSLCipherInfo::KviSSLCipherInfo(SSL_CIPHER * c, SSL * s) #endif { - m_szVersion = SSL_CIPHER_get_version(c); + m_szVersion = SSL_get_version(s); m_iNumBitsUsed = SSL_CIPHER_get_bits(c,&m_iNumBits); m_szName = SSL_CIPHER_get_name(c); char buf[1024]; diff --git a/src/kvilib/net/KviSSL.h b/src/kvilib/net/KviSSL.h index 93b347bdb..07ae94e15 100644 --- a/src/kvilib/net/KviSSL.h +++ b/src/kvilib/net/KviSSL.h @@ -33,13 +33,13 @@ #include "KviPointerHashTable.h" -// Apple deprecated openssl since osx 10.7: +// Apple deprecated openssl since osx 10.7: #ifdef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #endif - + #include <openssl/ssl.h> @@ -94,7 +94,7 @@ public: int serialNumber(){ return m_iSerialNumber; }; int version(){ return m_iVersion; }; - + bool fingerprintIsValid(); int fingerprintDigestId(); const char * fingerprintDigestStr(); @@ -115,9 +115,9 @@ class KVILIB_API KviSSLCipherInfo { public: #if OPENSSL_VERSION_NUMBER >= 0x10000000L - KviSSLCipherInfo(const SSL_CIPHER * c); + KviSSLCipherInfo(const SSL_CIPHER * c, const SSL * s); #else - KviSSLCipherInfo(SSL_CIPHER * c); + KviSSLCipherInfo(SSL_CIPHER * c, SSL * s); #endif ~KviSSLCipherInfo(); protected: diff --git a/src/kvilib/net/kvi_socket.h b/src/kvilib/net/kvi_socket.h index 0c68bbe9e..55205f25d 100644 --- a/src/kvilib/net/kvi_socket.h +++ b/src/kvilib/net/kvi_socket.h @@ -63,7 +63,7 @@ #define KVI_PROTECTION_LEVEL_DEFAULT PROTECTION_LEVEL_DEFAULT #define KVI_PROTECTION_LEVEL_UNRESTRICTED PROTECTION_LEVEL_UNRESTRICTED #define KVI_IPPROTO_IPV6 IPPROTO_IPV6 - + #else //!(defined(COMPILE_ON_WINDOWS) || (defined(COMPILE_ON_MINGW) && !defined(OS2)) #include <sys/time.h> diff --git a/src/kvilib/system/KviByteOrder.h b/src/kvilib/system/KviByteOrder.h index 53d6df8d9..54ebb2c9a 100644 --- a/src/kvilib/system/KviByteOrder.h +++ b/src/kvilib/system/KviByteOrder.h @@ -50,7 +50,7 @@ namespace KviByteOrder ((i >> 40) & 0xff00) | /* b to g */ (i >> 56)); /* a to h */ } - + /** * \brief Swaps the endianess of a kvi_u32_t * @@ -62,7 +62,7 @@ namespace KviByteOrder // abcd to dcba return ((i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24)); } - + /** * \brief Swaps the endianess of a kvi_u16_t * @@ -74,7 +74,7 @@ namespace KviByteOrder // ab to ba return ((i << 8) | (i >> 8)); } - + // // Byte Orders Reminder @@ -94,7 +94,7 @@ namespace KviByteOrder { return swap16(u); } - + inline kvi_u32_t localCpuToLittleEndian32(kvi_u32_t u) { return swap32(u); @@ -124,7 +124,7 @@ namespace KviByteOrder { return u; } - + inline kvi_u32_t localCpuToBigEndian32(kvi_u32_t u) { return u; @@ -154,7 +154,7 @@ namespace KviByteOrder { return u; } - + inline kvi_u32_t localCpuToNetworkByteOrder32(kvi_u32_t u) { return u; @@ -191,7 +191,7 @@ namespace KviByteOrder { return u; } - + inline kvi_u32_t localCpuToLittleEndian32(kvi_u32_t u) { return u; @@ -221,7 +221,7 @@ namespace KviByteOrder { return swap16(u); } - + inline kvi_u32_t localCpuToBigEndian32(kvi_u32_t u) { return swap32(u); @@ -253,7 +253,7 @@ namespace KviByteOrder { return swap16(u); } - + inline kvi_u32_t localCpuToNetworkByteOrder32(kvi_u32_t u) { return swap32(u); diff --git a/src/kvilib/system/KviEnvironment.h b/src/kvilib/system/KviEnvironment.h index 4e70b0238..1d9e36459 100644 --- a/src/kvilib/system/KviEnvironment.h +++ b/src/kvilib/system/KviEnvironment.h @@ -58,7 +58,7 @@ namespace KviEnvironment { SetEnvironmentVariable(szName,szValue); } - + inline void unsetVariable(const char * name) { SetEnvironmentVariable(name,NULL); |
