[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:52:51 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 6755df4861a9e42a1631701d1a4c067b877e454a
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 7 21:11:56 2001 +0000
I made a pass through the code and cleaned up all compiler warnings
reported by -Wall.
I also added some beginning of support for inlining functions.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 99a6b8c..d0b9397 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -464,8 +464,8 @@ void HTMLTitleElementImpl::setTitle()
s.compose();
s = KStringHandler::csqueeze( s.visual(), 128 );
- HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
// FIXME: need to uncomment this eventually
+ //HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
//if ( !d->view()->part()->parentPart() )
// emit d->view()->part()->setWindowCaption( s.visual() );
}
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 0b59bf0..608b68f 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -143,6 +143,10 @@ public:
m_viewprivate = vp;
};
+#ifdef _KWQ_
+ virtual ~KHTMLToolTip() {}
+#endif
+
protected:
virtual void maybeTip(const QPoint &);
@@ -1094,7 +1098,8 @@ void KHTMLView::addFormCompletionItem(const QString &name, const QString &value)
// dashes or spaces as those are likely credit card numbers or
// something similar
bool cc_number(true);
- for (int i = 0; i < value.length(); ++i)
+ // [kocienda] fixed signed/unsigned int comparison
+ for (unsigned int i = 0; i < value.length(); ++i)
{
QChar c(value[i]);
if (!c.isNumber() && c != '-' && !c.isSpace())
diff --git a/WebCore/khtml/rendering/render_hr.cpp b/WebCore/khtml/rendering/render_hr.cpp
index 7deea71..7b9829d 100644
--- a/WebCore/khtml/rendering/render_hr.cpp
+++ b/WebCore/khtml/rendering/render_hr.cpp
@@ -69,8 +69,9 @@ void RenderHR::print(QPainter *p, int _x, int _y, int _w, int _h, int _tx, int _
prev = prev->previousSibling();
if(prev && static_cast<RenderFlow *>(prev)->floatBottom() > prev->height() )
xp += static_cast<RenderFlow *>(prev)->leftOffset( prev->height() );
-
- int yp = _ty ;
+
+ // [kocienda] yp is unused because of #if 0 block
+ //int yp = _ty ;
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 5057090..20fee35 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -729,7 +729,8 @@ void RenderTable::calcFinalColMax(int c, ColInfo* col)
oldmin+=colMinWidth[o];
}
- int smin = col->min;
+ // [kocienda] smin in unused
+ //int smin = col->min;
int smax = col->max;
if (col->type == Percent)
@@ -1357,7 +1358,8 @@ void RenderTable::layoutRows(int yoff)
continue;
if ( c < totalCols - 1 && cell == cells[r][c+1] )
continue;
- if ( r < (int)totalRows - 1 && cell == cells[r+1][c] )
+ // [kocienda] fixed signed/unsigned comparison
+ if ( (int)r < (int)totalRows - 1 && cell == cells[r+1][c] )
continue;
cell->calcVerticalMargins();
@@ -1378,7 +1380,8 @@ void RenderTable::layoutRows(int yoff)
else if (h.isPercent())
{
Length ch = containingBlock()->style()->height();
- RenderObject *containing = containingBlock();
+ // [kocienda] containing is unused
+ //RenderObject *containing = containingBlock();
if (ch.isFixed())
th = h.width(ch.value);
else
@@ -1425,7 +1428,8 @@ void RenderTable::layoutRows(int yoff)
continue;
if ( c < totalCols - 1 && cell == cells[r][c+1] )
continue;
- if ( r < (int)totalRows - 1 && cell == cells[r+1][c] )
+ // [kocienda] fixed signed/unsigned comparison
+ if ( (int)r < (int)totalRows - 1 && cell == cells[r+1][c] )
continue;
if ( ( indx = c-cell->colSpan()+1 ) < 0 )
diff --git a/WebCore/kwq/KWQCString.mm b/WebCore/kwq/KWQCString.mm
index 2a0a3fc..9ca079e 100644
--- a/WebCore/kwq/KWQCString.mm
+++ b/WebCore/kwq/KWQCString.mm
@@ -97,7 +97,7 @@ int QCString::find(const char *s, int index=0, bool cs=TRUE) const
result = -1;
- if (!s || index >= size()) {
+ if (!s || index >= (int)size()) {
result = -1;
}
else if (!*s) {
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index 8889072..1ca6471 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -51,6 +51,8 @@ const QChar QChar::null;
// constructors, copy constructors, and destructors ----------------------------
+#ifndef _KWQ_QCHAR_INLINES_
+
QChar::QChar()
{
c = 0;
@@ -96,6 +98,8 @@ QChar::~QChar()
// do nothing because the single data member is a UniChar
}
+#endif // _KWQ_QCHAR_INLINES_
+
// member functions ------------------------------------------------------------
ushort QChar::unicode() const
@@ -231,6 +235,8 @@ int QChar::digitValue() const
// operators -------------------------------------------------------------------
+#ifndef _KWQ_QCHAR_INLINES_
+
bool operator==(QChar qc1, QChar qc2)
{
return qc1.c == qc2.c;
@@ -321,6 +327,8 @@ bool operator<(char ch, QChar qc)
return ch < qc.c;
}
+#endif // _KWQ_QCHAR_INLINES_
+
#else // USING_BORROWED_QSTRING
// This will help to keep the linker from complaining about empty archives
void KWQChar_Dummy() {}
diff --git a/WebCore/kwq/KWQColor.mm b/WebCore/kwq/KWQColor.mm
index 9c14854..4ebb909 100644
--- a/WebCore/kwq/KWQColor.mm
+++ b/WebCore/kwq/KWQColor.mm
@@ -374,8 +374,6 @@ void QColor::setHsv(int h, int s, int v)
QColor QColor::light(int factor) const
{
- NSColor *newColor;
-
if (factor <= 0) {
return QColor(*this);
}
@@ -407,8 +405,6 @@ QColor QColor::light(int factor) const
QColor QColor::dark(int factor) const
{
- NSColor *newColor;
-
if (factor <= 0) {
return QColor(*this);
}
@@ -493,7 +489,9 @@ QT_STATIC_CONST_IMPL QColor & Qt::darkYellow = stdcol[18];
void QColor::initGlobalColors()
{
- NSAutoreleasePool *colorPool = [[NSAutoreleasePool allocWithZone:NULL] init];
+ NSAutoreleasePool *colorPool;
+
+ colorPool = [[NSAutoreleasePool allocWithZone:NULL] init];
globals_init = TRUE;
diff --git a/WebCore/kwq/KWQFont.mm b/WebCore/kwq/KWQFont.mm
index 4ea26e4..4f00f67 100644
--- a/WebCore/kwq/KWQFont.mm
+++ b/WebCore/kwq/KWQFont.mm
@@ -132,10 +132,14 @@ int QFont::weight() const
bool QFont::setItalic(bool flag)
{
- if (flag)
+ if (flag) {
_setTrait (NSItalicFontMask);
- else
+ return TRUE;
+ }
+ else {
_setTrait (NSUnitalicFontMask);
+ return FALSE;
+ }
}
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index 3e08044..32343b4 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -145,7 +145,6 @@ static NSMutableDictionary *metricsCache = nil;
- (NSRect)rectForString:(NSString *)string
{
KWQLayoutFragment *cachedFragment, *fragment;
- NSTextStorage *textStorage;
if (fragmentCache == nil){
fragmentCache = [[NSMutableDictionary alloc] init];
diff --git a/WebCore/kwq/KWQFrame.mm b/WebCore/kwq/KWQFrame.mm
index 004eb5a..292156a 100644
--- a/WebCore/kwq/KWQFrame.mm
+++ b/WebCore/kwq/KWQFrame.mm
@@ -60,5 +60,6 @@ QFrame::QFrame(const QFrame &)
QFrame &QFrame::operator=(const QFrame &)
{
_logNeverImplemented();
+ return *this;
}
diff --git a/WebCore/kwq/KWQKCursor.mm b/WebCore/kwq/KWQKCursor.mm
index 9f093c0..d5dabc1 100644
--- a/WebCore/kwq/KWQKCursor.mm
+++ b/WebCore/kwq/KWQKCursor.mm
@@ -27,15 +27,15 @@
void KCursor::setAutoHideCursor(QWidget *w, bool enable) {}
-QCursor KCursor::arrowCursor() {}
-QCursor KCursor::crossCursor() {}
-QCursor KCursor::sizeAllCursor() {}
-QCursor KCursor::sizeHorCursor() {}
-QCursor KCursor::sizeVerCursor() {}
-QCursor KCursor::sizeBDiagCursor() {}
-QCursor KCursor::sizeFDiagCursor() {}
-QCursor KCursor::ibeamCursor() {}
-QCursor KCursor::waitCursor() {}
+QCursor KCursor::arrowCursor() { return QCursor(); }
+QCursor KCursor::crossCursor() { return QCursor(); }
+QCursor KCursor::sizeAllCursor() { return QCursor(); }
+QCursor KCursor::sizeHorCursor() { return QCursor(); }
+QCursor KCursor::sizeVerCursor() { return QCursor(); }
+QCursor KCursor::sizeBDiagCursor() { return QCursor(); }
+QCursor KCursor::sizeFDiagCursor() { return QCursor(); }
+QCursor KCursor::ibeamCursor() { return QCursor(); }
+QCursor KCursor::waitCursor() { return QCursor(); }
KCursor::KCursor()
diff --git a/WebCore/kwq/KWQKDebug.h b/WebCore/kwq/KWQKDebug.h
index b1e31f4..227aaa1 100644
--- a/WebCore/kwq/KWQKDebug.h
+++ b/WebCore/kwq/KWQKDebug.h
@@ -66,17 +66,17 @@ public:
kdbgstream &operator<<(const QCString &);
kdbgstream &operator<<(KDBGFUNC);
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
-
-private:
-
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
kdbgstream(const kdbgstream &);
#endif
+// protected -------------------------------------------------------------------
+// private ---------------------------------------------------------------------
+
+private:
+
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
diff --git a/WebCore/kwq/KWQKDebug.mm b/WebCore/kwq/KWQKDebug.mm
index edd680a..e225560 100644
--- a/WebCore/kwq/KWQKDebug.mm
+++ b/WebCore/kwq/KWQKDebug.mm
@@ -33,31 +33,37 @@ kdbgstream::kdbgstream(unsigned int area, unsigned int level, bool print=true)
kdbgstream &kdbgstream::operator<<(int)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const char *)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const void *)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const QString &)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const QCString &)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(KDBGFUNC)
{
+ return *this;
}
@@ -65,36 +71,43 @@ kdbgstream &kdbgstream::operator<<(KDBGFUNC)
kdbgstream kdDebug(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdWarning(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdWarning(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdError(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdError(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdFatal(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdFatal(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 2cf4d80..3ba0d46 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -28,7 +28,7 @@
#include <qfont.h>
#include <qtextcodec.h>
-#include <Foundation/Foundation.h>
+#import <Foundation/Foundation.h>
#include <job.h>
#include <jobclasses.h>
@@ -45,12 +45,15 @@
#include <kjs.h>
#include <kjs_dom.h>
#include <dom_doc.h>
+#include <qcursor.h>
#include <KWQKHTMLPart.h>
#import <WCURICache.h>
#import <WCURICacheData.h>
+#import <KWQView.h>
+
static bool cache_init = false;
static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -279,6 +282,8 @@ bool KHTMLPart::closeURL()
//d->m_doc = 0;
+
+ return true;
}
@@ -421,7 +426,7 @@ bool KHTMLPart::onlyLocalReferences() const
}
#ifdef _KWQ_TIMING
- static long totalWriteTime = 0;
+ static double totalWriteTime = 0;
#endif
@@ -509,7 +514,7 @@ void KHTMLPart::write(const char *str, int len)
if ( len == -1 )
len = strlen( str );
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
QString decoded = d->m_decoder->decode( str, len );
@@ -525,9 +530,9 @@ void KHTMLPart::write(const char *str, int len)
t->write( decoded, true );
#ifdef _KWQ_TIMING
- long thisTime = _GetMillisecondsSinceEpoch() - start;
+ double thisTime = CFAbsoluteTimeGetCurrent() - start;
totalWriteTime += thisTime;
- KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %d, milliseconds = %d, total = %d\n", len, thisTime, totalWriteTime);
+ KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %e, milliseconds = %e, total = %e\n", len, thisTime, totalWriteTime);
#endif
}
@@ -665,10 +670,12 @@ void KHTMLPart::setURLCursor( const QCursor &c )
_logNeverImplemented();
}
-
+// FIXME: this should be removed
+static const QCursor staticURLCursor = QCursor();
const QCursor& KHTMLPart::urlCursor() const
{
_logNeverImplemented();
+ return staticURLCursor;
}
@@ -707,6 +714,7 @@ QString KHTMLPart::selectedText() const
DOM::Range KHTMLPart::selection() const
{
_logNeverImplemented();
+ return DOM::Range();
}
@@ -946,7 +954,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// The mouse is over something
if ( url.length() )
{
- bool shiftPressed = ( _mouse->state() & ShiftButton );
+ // FIXME: this is unused
+ //bool shiftPressed = ( _mouse->state() & ShiftButton );
// Image map
if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -1067,7 +1076,6 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
{
- QMouseEvent *_mouse = event->qmouseEvent();
DOM::Node innerNode = event->innerNode();
d->m_mousePressNode = DOM::Node();
@@ -1080,7 +1088,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
// HACK! FIXME!
if (d->m_strSelectedURL != QString::null) {
- [((QWidget *)view())->getView() resetView];
+ [((KWQHTMLView *)((QWidget *)view())->getView()) resetView];
KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
openURL (clickedURL);
// [kocienda]: shield your eyes!
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 2cf4d80..3ba0d46 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -28,7 +28,7 @@
#include <qfont.h>
#include <qtextcodec.h>
-#include <Foundation/Foundation.h>
+#import <Foundation/Foundation.h>
#include <job.h>
#include <jobclasses.h>
@@ -45,12 +45,15 @@
#include <kjs.h>
#include <kjs_dom.h>
#include <dom_doc.h>
+#include <qcursor.h>
#include <KWQKHTMLPart.h>
#import <WCURICache.h>
#import <WCURICacheData.h>
+#import <KWQView.h>
+
static bool cache_init = false;
static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -279,6 +282,8 @@ bool KHTMLPart::closeURL()
//d->m_doc = 0;
+
+ return true;
}
@@ -421,7 +426,7 @@ bool KHTMLPart::onlyLocalReferences() const
}
#ifdef _KWQ_TIMING
- static long totalWriteTime = 0;
+ static double totalWriteTime = 0;
#endif
@@ -509,7 +514,7 @@ void KHTMLPart::write(const char *str, int len)
if ( len == -1 )
len = strlen( str );
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
QString decoded = d->m_decoder->decode( str, len );
@@ -525,9 +530,9 @@ void KHTMLPart::write(const char *str, int len)
t->write( decoded, true );
#ifdef _KWQ_TIMING
- long thisTime = _GetMillisecondsSinceEpoch() - start;
+ double thisTime = CFAbsoluteTimeGetCurrent() - start;
totalWriteTime += thisTime;
- KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %d, milliseconds = %d, total = %d\n", len, thisTime, totalWriteTime);
+ KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %e, milliseconds = %e, total = %e\n", len, thisTime, totalWriteTime);
#endif
}
@@ -665,10 +670,12 @@ void KHTMLPart::setURLCursor( const QCursor &c )
_logNeverImplemented();
}
-
+// FIXME: this should be removed
+static const QCursor staticURLCursor = QCursor();
const QCursor& KHTMLPart::urlCursor() const
{
_logNeverImplemented();
+ return staticURLCursor;
}
@@ -707,6 +714,7 @@ QString KHTMLPart::selectedText() const
DOM::Range KHTMLPart::selection() const
{
_logNeverImplemented();
+ return DOM::Range();
}
@@ -946,7 +954,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// The mouse is over something
if ( url.length() )
{
- bool shiftPressed = ( _mouse->state() & ShiftButton );
+ // FIXME: this is unused
+ //bool shiftPressed = ( _mouse->state() & ShiftButton );
// Image map
if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -1067,7 +1076,6 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
{
- QMouseEvent *_mouse = event->qmouseEvent();
DOM::Node innerNode = event->innerNode();
d->m_mousePressNode = DOM::Node();
@@ -1080,7 +1088,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
// HACK! FIXME!
if (d->m_strSelectedURL != QString::null) {
- [((QWidget *)view())->getView() resetView];
+ [((KWQHTMLView *)((QWidget *)view())->getView()) resetView];
KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
openURL (clickedURL);
// [kocienda]: shield your eyes!
diff --git a/WebCore/kwq/KWQKHTMLSettings.mm b/WebCore/kwq/KWQKHTMLSettings.mm
index 87ad966..0006b7d 100644
--- a/WebCore/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/kwq/KWQKHTMLSettings.mm
@@ -33,7 +33,7 @@ KHTMLSettings::KHTMLSettings()
// set available font families...ask the system
NSFontManager *sharedFontManager;
NSArray *array, *fontSizeArray;
- int i;
+ unsigned int i;
sharedFontManager = [NSFontManager sharedFontManager];
array = [sharedFontManager availableFontFamilies];
diff --git a/WebCore/kwq/KWQKJobClasses.mm b/WebCore/kwq/KWQKJobClasses.mm
index 6a897d1..722027f 100644
--- a/WebCore/kwq/KWQKJobClasses.mm
+++ b/WebCore/kwq/KWQKJobClasses.mm
@@ -108,8 +108,6 @@ private:
TransferJob::TransferJob(const KURL &url, bool reload=false, bool showProgressInfo=true)
{
- NSString *string;
-
_url = url;
_reload = reload;
_showProgressInfo = showProgressInfo;
diff --git a/WebCore/kwq/KWQKLineEdit.mm b/WebCore/kwq/KWQKLineEdit.mm
index 22039d7..c7964db 100644
--- a/WebCore/kwq/KWQKLineEdit.mm
+++ b/WebCore/kwq/KWQKLineEdit.mm
@@ -41,13 +41,15 @@ KLineEdit::~KLineEdit()
void KLineEdit::setMouseTracking(bool)
{
- KWQNSTextField *fieldView = (KWQNSTextField *)getView();
+ KWQNSTextField *fieldView;
+ fieldView = (KWQNSTextField *)getView();
}
void KLineEdit::setContextMenuEnabled(bool showMenu)
{
- KWQNSTextField *fieldView = (KWQNSTextField *)getView();
+ KWQNSTextField *fieldView;
+ fieldView = (KWQNSTextField *)getView();
}
diff --git a/WebCore/kwq/KWQKMimeType.h b/WebCore/kwq/KWQKMimeType.h
index a06f79d..bc06104 100644
--- a/WebCore/kwq/KWQKMimeType.h
+++ b/WebCore/kwq/KWQKMimeType.h
@@ -49,8 +49,8 @@ public:
// constructors, copy constructors, and destructors ------------------------
- KSharedPtr() {}
- KSharedPtr(const KSharedPtr &) {}
+ KSharedPtr() { object = 0; }
+ KSharedPtr(const KSharedPtr &) {object = 0;}
~KSharedPtr() {}
// member functions --------------------------------------------------------
@@ -58,11 +58,14 @@ public:
// operators ---------------------------------------------------------------
KSharedPtr &operator=(const KSharedPtr &) {}
- T *operator->() {}
+ T *operator->() { return object; }
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
+private:
+ T *object;
+
}; // class KSharedPtr =========================================================
diff --git a/WebCore/kwq/KWQKMimeType.mm b/WebCore/kwq/KWQKMimeType.mm
index 4d33989..b79558e 100644
--- a/WebCore/kwq/KWQKMimeType.mm
+++ b/WebCore/kwq/KWQKMimeType.mm
@@ -28,10 +28,12 @@
//FIX ME:
static QString tempQString = QString();
+static KMimeType::Ptr tempPtr = KMimeType::Ptr();
KMimeType::Ptr KMimeType::findByURL(const KURL &, mode_t=0, bool=false, bool)
{
_logNotYetImplemented();
+ return tempPtr;
}
diff --git a/WebCore/kwq/KWQKWin.mm b/WebCore/kwq/KWQKWin.mm
index 15e3eef..3c741b4 100644
--- a/WebCore/kwq/KWQKWin.mm
+++ b/WebCore/kwq/KWQKWin.mm
@@ -30,4 +30,6 @@
KWin::Info KWin::info(int win)
{
_logNotYetImplemented();
+ KWin::Info result;
+ return result;
}
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index e5af97b..4f15b2d 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -915,6 +915,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
-(id)initWithLoader:(Loader *)loader
{
m_loader = loader;
+ return self;
}
-(void)cacheDataAvailable:(NSNotification *)notification
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index 840efc5..92e6b3f 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -60,7 +60,7 @@ QListBox::~QListBox()
uint QListBox::count() const
{
- (uint)[matrix numberOfRows];
+ return (uint)[matrix numberOfRows];
}
@@ -105,7 +105,7 @@ void QListBox::insertItem(const QListBoxItem *newItem, int index)
if ( !newItem )
return;
- if ( index < 0 || index >= count())
+ if ( index < 0 || index >= (int)count())
index = count();
QListBoxItem *item = (QListBoxItem *)newItem;
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index e5af97b..4f15b2d 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -915,6 +915,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
-(id)initWithLoader:(Loader *)loader
{
m_loader = loader;
+ return self;
}
-(void)cacheDataAvailable:(NSNotification *)notification
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index e5af97b..4f15b2d 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -915,6 +915,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
-(id)initWithLoader:(Loader *)loader
{
m_loader = loader;
+ return self;
}
-(void)cacheDataAvailable:(NSNotification *)notification
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index 4e559dc..0d736de 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -160,15 +160,13 @@
- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error
{
*obj = string;
+ return YES;
}
- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error
{
- int i, length = [(NSString *)partialString length];
- NSString *string = @"";
-
- if ([partialString length] >= maxLength){
+ if ((int)[partialString length] >= maxLength){
*newString = nil;
return NO;
}
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 5fa6b11..3cd0d40 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -174,6 +174,7 @@ const QBrush &QPainter::brush() const
QRect QPainter::xForm(const QRect &) const
{
_logNotYetImplemented();
+ return QRect();
}
@@ -246,8 +247,6 @@ void QPainter::_setColorFromPen()
void QPainter::drawLine(int x1, int y1, int x2, int y2)
{
- NSBezierPath *path;
-
_lockFocus();
_setColorFromPen();
@@ -346,7 +345,6 @@ void QPainter::_drawPoints (const QPointArray &_points, bool winding, int index,
int _npoints, bool fill)
{
NSBezierPath *path;
- float fa, falen;
int i;
int npoints = _npoints != -1 ? _npoints : _points.size()-index;
@@ -470,7 +468,6 @@ void QPainter::drawText(int x, int y, const QString &qstring, int len)
{
NSString *string;
NSFont *font;
- const char *ascii;
_lockFocus();
@@ -529,7 +526,6 @@ void QPainter::drawText(int x, int y, int w, int h, int flags, const QString&qst
{
NSString *string;
NSFont *font;
- const char *ascii;
NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
_lockFocus();
@@ -622,6 +618,7 @@ Qt::RasterOp QPainter::rasterOp() const
return CopyROP;
#else
_logNeverImplemented();
+ return CopyROP;
#endif
}
@@ -657,12 +654,14 @@ bool QPainter::begin(const QPaintDevice *bd)
data->bufferDevice = bd;
const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
[pixmap->nsimage setFlipped: YES];
+ return true;
}
bool QPainter::end()
{
data->bufferDevice = 0L;
+ return true;
}
diff --git a/WebCore/kwq/KWQPart.mm b/WebCore/kwq/KWQPart.mm
index 4d78676..56299b4 100644
--- a/WebCore/kwq/KWQPart.mm
+++ b/WebCore/kwq/KWQPart.mm
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <qwidget.h>
#include <kwqdebug.h>
#include <part.h>
@@ -41,9 +42,11 @@ KParts::Part::~Part()
}
+static QWidget *theWidget = new QWidget();
QWidget *KParts::Part::widget()
{
_logNotYetImplemented();
+ return theWidget;
}
@@ -67,8 +70,10 @@ KParts::ReadOnlyPart::~ReadOnlyPart()
}
+static const KURL emptyURL = KURL();
const KURL &KParts::ReadOnlyPart::url() const
{
// must override
_logNeverImplemented();
+ return emptyURL;
}
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index 9e4d75e..17f8b04 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -25,6 +25,7 @@
#include <kwqdebug.h>
#include <qpixmap.h>
+#include <qbitmap.h>
/*
* FIXME: This is a bad hack which really should go away.
@@ -108,10 +109,11 @@ void QPixmap::setMask(const QBitmap &)
_logNotYetImplemented();
}
-
+static QBitmap *theMask = new QBitmap();
const QBitmap *QPixmap::mask() const
{
_logNotYetImplemented();
+ return theMask;
}
@@ -178,6 +180,7 @@ QPixmap QPixmap::xForm(const QWMatrix &xmatrix) const
QImage QPixmap::convertToImage() const
{
_logNotYetImplemented();
+ return QImage();
}
diff --git a/WebCore/kwq/KWQRegion.mm b/WebCore/kwq/KWQRegion.mm
index 8fa00ff..eccd709 100644
--- a/WebCore/kwq/KWQRegion.mm
+++ b/WebCore/kwq/KWQRegion.mm
@@ -87,9 +87,10 @@ QRegion::~QRegion()
free(data);
}
-QRegion QRegion::intersect(const QRegion &) const
+QRegion QRegion::intersect(const QRegion ®ion) const
{
_logNotYetImplemented();
+ return region;
}
bool QRegion::contains(const QPoint &point) const
@@ -113,4 +114,5 @@ QRegion &QRegion::operator=(const QRegion &other)
}
data->path = [[NSBezierPath bezierPath] retain];
[data->path appendBezierPath:other.data->path];
+ return *this;
}
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 21ace9c..b760012 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -260,5 +260,6 @@ QScrollView::QScrollView(const QScrollView &)
QScrollView &QScrollView::operator=(const QScrollView &)
{
_logNeverImplemented();
+ return *this;
}
diff --git a/WebCore/kwq/KWQString.h b/WebCore/kwq/KWQString.h
index 5175efd..3c972ef 100644
--- a/WebCore/kwq/KWQString.h
+++ b/WebCore/kwq/KWQString.h
@@ -175,6 +175,145 @@ private:
}; // class QChar ==============================================================
+#if defined (_KWQ_QCHAR_INLINES_) && ! defined (_KWQ_QCHAR_INLINES_INCLUDED_)
+#define _KWQ_QCHAR_INLINES_INCLUDED_
+
+inline QChar::QChar()
+{
+ c = 0;
+}
+
+inline QChar::QChar(char ch)
+{
+ c = ch;
+}
+
+inline QChar::QChar(uchar uch)
+{
+ c = uch;
+}
+
+inline QChar::QChar(short n)
+{
+ c = n;
+}
+
+inline QChar::QChar(ushort n)
+{
+ c = n;
+}
+
+inline QChar::QChar(uint n)
+{
+ c = n;
+}
+
+inline QChar::QChar(int n)
+{
+ c = n;
+}
+
+inline QChar::QChar(const QChar &qc)
+{
+ c = qc.c;
+}
+
+inline QChar::~QChar()
+{
+ // do nothing because the single data member is a UniChar
+}
+
+inline bool operator==(QChar qc1, QChar qc2)
+{
+ return qc1.c == qc2.c;
+}
+
+inline bool operator==(QChar qc, char ch)
+{
+ return qc.c == ch;
+}
+
+inline bool operator==(char ch, QChar qc)
+{
+ return ch == qc.c;
+}
+
+inline bool operator!=(QChar qc1, QChar qc2)
+{
+ return qc1.c != qc2.c;
+}
+
+inline bool operator!=(QChar qc, char ch)
+{
+ return qc.c != ch;
+}
+
+inline bool operator!=(char ch, QChar qc)
+{
+ return ch != qc.c;
+}
+
+inline bool operator>=(QChar qc1, QChar qc2)
+{
+ return qc1.c >= qc2.c;
+}
+
+inline bool operator>=(QChar qc, char ch)
+{
+ return qc.c >= ch;
+}
+
+inline bool operator>=(char ch, QChar qc)
+{
+ return ch >= qc.c;
+}
+
+inline bool operator>(QChar qc1, QChar qc2)
+{
+ return qc1.c > qc2.c;
+}
+
+inline bool operator>(QChar qc, char ch)
+{
+ return qc.c > ch;
+}
+
+inline bool operator>(char ch, QChar qc)
+{
+ return ch > qc.c;
+}
+
+inline bool operator<=(QChar qc1, QChar qc2)
+{
+ return qc1.c <= qc2.c;
+}
+
+inline bool operator<=(QChar qc, char ch)
+{
+ return qc.c <= ch;
+}
+
+inline bool operator<=(char ch, QChar qc)
+{
+ return ch <= qc.c;
+}
+
+inline bool operator<(QChar qc1, QChar qc2)
+{
+ return qc1.c < qc2.c;
+}
+
+inline bool operator<(QChar qc, char ch)
+{
+ return qc.c < ch;
+}
+
+inline bool operator<(char ch, QChar qc)
+{
+ return ch < qc.c;
+}
+
+#endif // _KWQ_QCHAR_INLINES_
// QString class ===============================================================
@@ -399,6 +538,66 @@ QString operator+(const char *, const QString &);
QString operator+(QChar, const QString &);
QString operator+(char, const QString &);
+#if defined (_KWQ_QSTRING_INLINES_) && ! defined (_KWQ_QSTRING_INLINES_INCLUDED_)
+#define _KWQ_QSTRING_INLINES_INCLUDED_
+
+inline QString::QString()
+{
+ s = NULL;
+ cache = NULL;
+ cacheType = CacheInvalid;
+}
+
+inline QString::~QString()
+{
+ if (s) {
+ CFRelease(s);
+ }
+ if (cache) {
+ CFAllocatorDeallocate(kCFAllocatorDefault, cache);
+ }
+}
+
+inline QString &QString::operator=(QChar qc)
+{
+ return *this = QString(qc);
+}
+
+inline QString &QString::operator=(char ch)
+{
+ return *this = QString(QChar(ch));
+}
+
+inline uint QString::length() const
+{
+ return s ? CFStringGetLength(s) : 0;
+}
+
+inline bool QString::isNull() const
+{
+ // NOTE: do NOT use "unicode() == NULL"
+ return s == NULL;
+}
+
+inline bool QString::isEmpty() const
+{
+ return length() == 0;
+}
+
+inline QChar QString::at(uint index) const
+{
+ // FIXME: this might cause some errors on *big* indexes
+ CFIndex signedIndex = (CFIndex)index;
+ if (s) {
+ CFIndex len = CFStringGetLength(s);
+ if (signedIndex < len) {
+ return QChar(CFStringGetCharacterAtIndex(s, signedIndex));
+ }
+ }
+ return QChar(0);
+}
+
+#endif // _KWQ_QSTRING_INLINES_
// class QConstString ==========================================================
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 3b2af80..c5d7c51 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -146,6 +146,8 @@ QString QString::fromCFMutableString(CFMutableStringRef cfs)
// constructors, copy constructors, and destructors ----------------------------
+#ifndef _KWQ_QSTRING_INLINES_
+
QString::QString()
{
s = NULL;
@@ -153,6 +155,18 @@ QString::QString()
cacheType = CacheInvalid;
}
+QString::~QString()
+{
+ if (s) {
+ CFRelease(s);
+ }
+ if (cache) {
+ CFAllocatorDeallocate(kCFAllocatorDefault, cache);
+ }
+}
+
+#endif // _KWQ_QSTRING_INLINES_
+
QString::QString(QChar qc)
{
s = CFStringCreateMutable(kCFAllocatorDefault, 0);
@@ -232,16 +246,6 @@ QString::QString(const QString &qs)
cacheType = CacheInvalid;
}
-QString::~QString()
-{
- if (s) {
- CFRelease(s);
- }
- if (cache) {
- CFAllocatorDeallocate(kCFAllocatorDefault, cache);
- }
-}
-
// assignment operators --------------------------------------------------------
QString &QString::operator=(const QString &qs)
@@ -268,6 +272,8 @@ QString &QString::operator=(const char *chs)
return *this = QString(chs);
}
+#ifndef _KWQ_QSTRING_INLINES_
+
QString &QString::operator=(QChar qc)
{
return *this = QString(qc);
@@ -278,13 +284,41 @@ QString &QString::operator=(char ch)
return *this = QString(QChar(ch));
}
+#endif // _KWQ_QSTRING_INLINES_
+
// member functions ------------------------------------------------------------
+#ifndef _KWQ_QSTRING_INLINES_
+
uint QString::length() const
{
return s ? CFStringGetLength(s) : 0;
}
+bool QString::isNull() const
+{
+ // NOTE: do NOT use "unicode() == NULL"
+ return s == NULL;
+}
+
+bool QString::isEmpty() const
+{
+ return length() == 0;
+}
+
+QChar QString::at(uint index) const
+{
+ if (s) {
+ CFIndex len = CFStringGetLength(s);
+ if (index < len) {
+ return QChar(CFStringGetCharacterAtIndex(s, index));
+ }
+ }
+ return QChar(0);
+}
+
+#endif // _KWQ_QSTRING_INLINES_
+
const QChar *QString::unicode() const
{
UniChar *ucs = NULL;
@@ -363,30 +397,6 @@ QCString QString::local8Bit() const
return convertToQCString(kCFStringEncodingMacRoman);
}
-bool QString::isNull() const
-{
- // NOTE: do NOT use "unicode() == NULL"
- return s == NULL;
-}
-
-bool QString::isEmpty() const
-{
- return length() == 0;
-}
-
-//#ifdef USING_BORROWED_KURL
-QChar QString::at(uint index) const
-{
- if (s) {
- CFIndex len = CFStringGetLength(s);
- if (index < len) {
- return QChar(CFStringGetCharacterAtIndex(s, index));
- }
- }
- return QChar(0);
-}
-//#endif // USING_BORROWED_KURL
-
int QString::compare(const QString &qs) const
{
if (s == qs.s) {
@@ -760,15 +770,17 @@ QString QString::right(uint width) const
QString QString::mid(uint index, uint width) const
{
QString qs;
+ int signedIndex = (int)index;
+ int signedWidth = (int)width;
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && (index < len) && width) {
- if (!((index == 0) && (width >= len))) {
- if (width > (len - index)) {
- width = len - index;
+ if (len && (signedIndex < len) && signedWidth) {
+ if (!((signedIndex == 0) && (signedWidth >= len))) {
+ if (signedWidth > (len - signedIndex)) {
+ signedWidth = len - signedIndex;
}
CFStringRef tmp = CFStringCreateWithSubstring(
- kCFAllocatorDefault, s, CFRangeMake(index, width));
+ kCFAllocatorDefault, s, CFRangeMake(signedIndex, width));
if (tmp) {
qs.s = CFStringCreateMutableCopy(kCFAllocatorDefault, 0,
tmp);
@@ -1030,6 +1042,7 @@ QString &QString::append(const QString &qs)
QString &QString::insert(uint index, const QString &qs)
{
+ int signedIndex = (int)index;
flushCache();
if (qs.s) {
CFIndex len = CFStringGetLength(qs.s);
@@ -1038,8 +1051,8 @@ QString &QString::insert(uint index, const QString &qs)
s = CFStringCreateMutable(kCFAllocatorDefault, 0);
}
if (s) {
- if (index < CFStringGetLength(s)) {
- CFStringInsert(s, index, qs.s);
+ if (signedIndex < CFStringGetLength(s)) {
+ CFStringInsert(s, signedIndex, qs.s);
} else {
CFStringAppend(s, qs.s);
}
@@ -1061,14 +1074,16 @@ QString &QString::insert(uint index, char ch)
QString &QString::remove(uint index, uint width)
{
+ int signedIndex = (int)index;
+ int signedWidth = (int)width;
flushCache();
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && (index < len) && width) {
- if (width > (len - index)) {
- width = len - index;
+ if (len && (signedIndex < len) && signedWidth) {
+ if (signedWidth > (len - signedIndex)) {
+ signedWidth = len - signedIndex;
}
- CFStringDelete(s, CFRangeMake(index, width));
+ CFStringDelete(s, CFRangeMake(signedIndex, signedWidth));
}
}
return *this;
@@ -1099,11 +1114,12 @@ QString &QString::replace(const QRegExp &qre, const QString &qs)
void QString::truncate(uint newLen)
{
flushCache();
+ int signedNewLen = (int)newLen;
if (s) {
- if (newLen) {
+ if (signedNewLen) {
CFIndex len = CFStringGetLength(s);
- if (len && (newLen < len)) {
- CFStringDelete(s, CFRangeMake(newLen, len - newLen));
+ if (len && (signedNewLen < len)) {
+ CFStringDelete(s, CFRangeMake(signedNewLen, len - signedNewLen));
}
} else {
CFRelease(s);
@@ -1313,13 +1329,14 @@ ulong QString::convertToNumber(bool *ok, int base, bool *neg) const
QString QString::leftRight(uint width, bool left) const
{
QString qs;
+ int signedWidth = (int)width;
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && width) {
- if (len > width) {
+ if (len && signedWidth) {
+ if (len > signedWidth) {
CFStringRef tmp = CFStringCreateWithSubstring(
- kCFAllocatorDefault, s, left ? CFRangeMake(0, width)
- : CFRangeMake(len - width, width));
+ kCFAllocatorDefault, s, left ? CFRangeMake(0, signedWidth)
+ : CFRangeMake(len - signedWidth, signedWidth));
if (tmp) {
qs.s = CFStringCreateMutableCopy(kCFAllocatorDefault, 0,
tmp);
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 4e559dc..0d736de 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -160,15 +160,13 @@
- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error
{
*obj = string;
+ return YES;
}
- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error
{
- int i, length = [(NSString *)partialString length];
- NSString *string = @"";
-
- if ([partialString length] >= maxLength){
+ if ((int)[partialString length] >= maxLength){
*newString = nil;
return NO;
}
diff --git a/WebCore/kwq/KWQTextStorage.h b/WebCore/kwq/KWQTextStorage.h
index 37c691e..2632153 100644
--- a/WebCore/kwq/KWQTextStorage.h
+++ b/WebCore/kwq/KWQTextStorage.h
@@ -33,7 +33,7 @@
NSLayoutManager *_layoutManager;
}
-+ setString:(NSString *)str attributes:(NSDictionary *)attrs;
++ (void)setString:(NSString *)str attributes:(NSDictionary *)attrs;
- (void)setString: (NSString *)aString attributes: (NSDictionary *)at;
@end
diff --git a/WebCore/kwq/KWQTextStorage.mm b/WebCore/kwq/KWQTextStorage.mm
index 1e9a5dc..12efc33 100644
--- a/WebCore/kwq/KWQTextStorage.mm
+++ b/WebCore/kwq/KWQTextStorage.mm
@@ -49,7 +49,7 @@ static KWQTextStorage *sharedInstance = nil;
return sharedInstance;
}
-+ setString:(NSString *)str attributes:(NSDictionary *)attrs
++ (void)setString:(NSString *)str attributes:(NSDictionary *)attrs
{
[[KWQTextStorage sharedInstance] setString: str attributes: attrs];
}
diff --git a/WebCore/kwq/KWQView.h b/WebCore/kwq/KWQView.h
index 4ed3055..e75c611 100644
--- a/WebCore/kwq/KWQView.h
+++ b/WebCore/kwq/KWQView.h
@@ -70,6 +70,7 @@ class KHTMLPart;
- initWithFrame: (NSRect)r widget: (QWidget *)w;
- (void)setIsFlipped: (bool)flag;
- (void)setNeedsLayout: (bool)flag;
+- (void)resetView;
@end
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index 0311903..2672225 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -78,7 +78,7 @@
return self;
}
-- action: sender
+- (void)action: sender
{
widget->emitAction(QObject::ACTION_BUTTON_CLICKED);
}
@@ -149,9 +149,9 @@
if (((KHTMLView *)widget)->part()->xmlDocImpl() &&
((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
if (needsLayout){
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
((KHTMLView *)widget)->layout(TRUE);
- KWQDEBUGLEVEL1 (0x200, "layout time %d\n", _GetMillisecondsSinceEpoch() - start);
+ KWQDEBUGLEVEL1 (0x200, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
needsLayout = NO;
}
}
@@ -174,12 +174,12 @@
[self lockFocus];
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x,
(int)rect.origin.y,
(int)rect.size.width,
(int)rect.size.height );
- KWQDEBUGLEVEL1 (0x200, "draw time %d\n", _GetMillisecondsSinceEpoch() - start);
+ KWQDEBUGLEVEL1 (0x200, "draw time %e\n", CFAbsoluteTimeGetCurrent() - start);
[self unlockFocus];
}
}
diff --git a/WebCore/kwq/KWQWMatrix.mm b/WebCore/kwq/KWQWMatrix.mm
index 95713fc..b2ff6ad 100644
--- a/WebCore/kwq/KWQWMatrix.mm
+++ b/WebCore/kwq/KWQWMatrix.mm
@@ -43,5 +43,6 @@ QWMatrix &QWMatrix::scale(double _sx, double _sy)
empty = FALSE;
sx = _sx;
sy = _sy;
+ return *this;
}
diff --git a/WebCore/kwq/KWQXml.mm b/WebCore/kwq/KWQXml.mm
index c409d65..6e35c47 100644
--- a/WebCore/kwq/KWQXml.mm
+++ b/WebCore/kwq/KWQXml.mm
@@ -195,6 +195,7 @@ QXmlParseException::QXmlParseException()
QString QXmlParseException::message() const
{
_logNotYetImplemented();
+ return QString();
}
diff --git a/WebCore/kwq/kde/_kurl.cpp b/WebCore/kwq/kde/_kurl.cpp
index feaaea4..1f95203 100644
--- a/WebCore/kwq/kde/_kurl.cpp
+++ b/WebCore/kwq/kde/_kurl.cpp
@@ -227,8 +227,8 @@ static QString decode( const QString& segment, bool *keepEncoded=0, int encoding
// Encoding specified
if ( encoding_hint )
{
- QTextCodec * textCodec = codecForHint( encoding_hint );
// FIXME: ignoring encodings for now
+ //QTextCodec * textCodec = codecForHint( encoding_hint );
/*
if (textCodec)
{
@@ -1207,7 +1207,7 @@ QString KURL::fileName( bool _strip_trailing_slash ) const
{
QString fname;
- int len = m_strPath.length();
+ unsigned int len = m_strPath.length();
if ( len == 0 )
return fname;
diff --git a/WebCore/kwq/kdecore/kdebug.h b/WebCore/kwq/kdecore/kdebug.h
index b1e31f4..227aaa1 100644
--- a/WebCore/kwq/kdecore/kdebug.h
+++ b/WebCore/kwq/kdecore/kdebug.h
@@ -66,17 +66,17 @@ public:
kdbgstream &operator<<(const QCString &);
kdbgstream &operator<<(KDBGFUNC);
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
-
-private:
-
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
kdbgstream(const kdbgstream &);
#endif
+// protected -------------------------------------------------------------------
+// private ---------------------------------------------------------------------
+
+private:
+
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
diff --git a/WebCore/kwq/kio/kmimetype.h b/WebCore/kwq/kio/kmimetype.h
index a06f79d..bc06104 100644
--- a/WebCore/kwq/kio/kmimetype.h
+++ b/WebCore/kwq/kio/kmimetype.h
@@ -49,8 +49,8 @@ public:
// constructors, copy constructors, and destructors ------------------------
- KSharedPtr() {}
- KSharedPtr(const KSharedPtr &) {}
+ KSharedPtr() { object = 0; }
+ KSharedPtr(const KSharedPtr &) {object = 0;}
~KSharedPtr() {}
// member functions --------------------------------------------------------
@@ -58,11 +58,14 @@ public:
// operators ---------------------------------------------------------------
KSharedPtr &operator=(const KSharedPtr &) {}
- T *operator->() {}
+ T *operator->() { return object; }
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
+private:
+ T *object;
+
}; // class KSharedPtr =========================================================
diff --git a/WebCore/kwq/kwqdebug.mm b/WebCore/kwq/kwqdebug.mm
index 1c77f4c..5434462 100644
--- a/WebCore/kwq/kwqdebug.mm
+++ b/WebCore/kwq/kwqdebug.mm
@@ -25,38 +25,8 @@
#include <kwqdebug.h>
-
-#if defined(__MACH__)
-#include <stdlib.h>
-#include <sys/time.h>
-#endif
-#if defined(__WIN32__)
-#import <sys/utime.h>
-#endif
-
-
-long _GetMillisecondsSinceEpoch() {
- long result;
- struct timeval tp;
- struct timezone tzp;
-
- result = 0;
- tzp.tz_minuteswest = 0;
- tzp.tz_dsttime = 0;
-
- // FIXME: need to ifdef for Win32 at some point,
- // or use something from Foundation
- if (gettimeofday(&tp, &tzp) == 0) {
- result = (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
- }
-
- return result;
-}
-
-
unsigned int KWQ_LOG_LEVEL = KWQ_LOG_ALL;
-
void KWQSetLogLevel(int mask) {
KWQ_LOG_LEVEL = mask;
}
diff --git a/WebCore/kwq/qt/_qstringlist.cpp b/WebCore/kwq/qt/_qstringlist.cpp
index 6b87311..a7e9458 100644
--- a/WebCore/kwq/qt/_qstringlist.cpp
+++ b/WebCore/kwq/qt/_qstringlist.cpp
@@ -266,8 +266,6 @@ QStringList QStringList::grep( const QRegExp &expr ) const
for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
if ( (*it).contains( expr ) )
res << *it;
-#else
-#warning function is not implemented
#endif
return res;
}
diff --git a/WebCore/kwq/qt/qasyncimageio.h b/WebCore/kwq/qt/qasyncimageio.h
index 8eca5b9..45b6165 100644
--- a/WebCore/kwq/qt/qasyncimageio.h
+++ b/WebCore/kwq/qt/qasyncimageio.h
@@ -62,7 +62,7 @@ public:
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
- ~QImageConsumer() {}
+ virtual ~QImageConsumer() {}
#endif
// member functions --------------------------------------------------------
diff --git a/WebCore/kwq/qt/qstring.h b/WebCore/kwq/qt/qstring.h
index 5175efd..3c972ef 100644
--- a/WebCore/kwq/qt/qstring.h
+++ b/WebCore/kwq/qt/qstring.h
@@ -175,6 +175,145 @@ private:
}; // class QChar ==============================================================
+#if defined (_KWQ_QCHAR_INLINES_) && ! defined (_KWQ_QCHAR_INLINES_INCLUDED_)
+#define _KWQ_QCHAR_INLINES_INCLUDED_
+
+inline QChar::QChar()
+{
+ c = 0;
+}
+
+inline QChar::QChar(char ch)
+{
+ c = ch;
+}
+
+inline QChar::QChar(uchar uch)
+{
+ c = uch;
+}
+
+inline QChar::QChar(short n)
+{
+ c = n;
+}
+
+inline QChar::QChar(ushort n)
+{
+ c = n;
+}
+
+inline QChar::QChar(uint n)
+{
+ c = n;
+}
+
+inline QChar::QChar(int n)
+{
+ c = n;
+}
+
+inline QChar::QChar(const QChar &qc)
+{
+ c = qc.c;
+}
+
+inline QChar::~QChar()
+{
+ // do nothing because the single data member is a UniChar
+}
+
+inline bool operator==(QChar qc1, QChar qc2)
+{
+ return qc1.c == qc2.c;
+}
+
+inline bool operator==(QChar qc, char ch)
+{
+ return qc.c == ch;
+}
+
+inline bool operator==(char ch, QChar qc)
+{
+ return ch == qc.c;
+}
+
+inline bool operator!=(QChar qc1, QChar qc2)
+{
+ return qc1.c != qc2.c;
+}
+
+inline bool operator!=(QChar qc, char ch)
+{
+ return qc.c != ch;
+}
+
+inline bool operator!=(char ch, QChar qc)
+{
+ return ch != qc.c;
+}
+
+inline bool operator>=(QChar qc1, QChar qc2)
+{
+ return qc1.c >= qc2.c;
+}
+
+inline bool operator>=(QChar qc, char ch)
+{
+ return qc.c >= ch;
+}
+
+inline bool operator>=(char ch, QChar qc)
+{
+ return ch >= qc.c;
+}
+
+inline bool operator>(QChar qc1, QChar qc2)
+{
+ return qc1.c > qc2.c;
+}
+
+inline bool operator>(QChar qc, char ch)
+{
+ return qc.c > ch;
+}
+
+inline bool operator>(char ch, QChar qc)
+{
+ return ch > qc.c;
+}
+
+inline bool operator<=(QChar qc1, QChar qc2)
+{
+ return qc1.c <= qc2.c;
+}
+
+inline bool operator<=(QChar qc, char ch)
+{
+ return qc.c <= ch;
+}
+
+inline bool operator<=(char ch, QChar qc)
+{
+ return ch <= qc.c;
+}
+
+inline bool operator<(QChar qc1, QChar qc2)
+{
+ return qc1.c < qc2.c;
+}
+
+inline bool operator<(QChar qc, char ch)
+{
+ return qc.c < ch;
+}
+
+inline bool operator<(char ch, QChar qc)
+{
+ return ch < qc.c;
+}
+
+#endif // _KWQ_QCHAR_INLINES_
// QString class ===============================================================
@@ -399,6 +538,66 @@ QString operator+(const char *, const QString &);
QString operator+(QChar, const QString &);
QString operator+(char, const QString &);
+#if defined (_KWQ_QSTRING_INLINES_) && ! defined (_KWQ_QSTRING_INLINES_INCLUDED_)
+#define _KWQ_QSTRING_INLINES_INCLUDED_
+
+inline QString::QString()
+{
+ s = NULL;
+ cache = NULL;
+ cacheType = CacheInvalid;
+}
+
+inline QString::~QString()
+{
+ if (s) {
+ CFRelease(s);
+ }
+ if (cache) {
+ CFAllocatorDeallocate(kCFAllocatorDefault, cache);
+ }
+}
+
+inline QString &QString::operator=(QChar qc)
+{
+ return *this = QString(qc);
+}
+
+inline QString &QString::operator=(char ch)
+{
+ return *this = QString(QChar(ch));
+}
+
+inline uint QString::length() const
+{
+ return s ? CFStringGetLength(s) : 0;
+}
+
+inline bool QString::isNull() const
+{
+ // NOTE: do NOT use "unicode() == NULL"
+ return s == NULL;
+}
+
+inline bool QString::isEmpty() const
+{
+ return length() == 0;
+}
+
+inline QChar QString::at(uint index) const
+{
+ // FIXME: this might cause some errors on *big* indexes
+ CFIndex signedIndex = (CFIndex)index;
+ if (s) {
+ CFIndex len = CFStringGetLength(s);
+ if (signedIndex < len) {
+ return QChar(CFStringGetCharacterAtIndex(s, signedIndex));
+ }
+ }
+ return QChar(0);
+}
+
+#endif // _KWQ_QSTRING_INLINES_
// class QConstString ==========================================================
diff --git a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
index 99a6b8c..d0b9397 100644
--- a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
@@ -464,8 +464,8 @@ void HTMLTitleElementImpl::setTitle()
s.compose();
s = KStringHandler::csqueeze( s.visual(), 128 );
- HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
// FIXME: need to uncomment this eventually
+ //HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
//if ( !d->view()->part()->parentPart() )
// emit d->view()->part()->setWindowCaption( s.visual() );
}
diff --git a/WebCore/src/kdelibs/khtml/khtmlview.cpp b/WebCore/src/kdelibs/khtml/khtmlview.cpp
index 0b59bf0..608b68f 100644
--- a/WebCore/src/kdelibs/khtml/khtmlview.cpp
+++ b/WebCore/src/kdelibs/khtml/khtmlview.cpp
@@ -143,6 +143,10 @@ public:
m_viewprivate = vp;
};
+#ifdef _KWQ_
+ virtual ~KHTMLToolTip() {}
+#endif
+
protected:
virtual void maybeTip(const QPoint &);
@@ -1094,7 +1098,8 @@ void KHTMLView::addFormCompletionItem(const QString &name, const QString &value)
// dashes or spaces as those are likely credit card numbers or
// something similar
bool cc_number(true);
- for (int i = 0; i < value.length(); ++i)
+ // [kocienda] fixed signed/unsigned int comparison
+ for (unsigned int i = 0; i < value.length(); ++i)
{
QChar c(value[i]);
if (!c.isNumber() && c != '-' && !c.isSpace())
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_hr.cpp b/WebCore/src/kdelibs/khtml/rendering/render_hr.cpp
index 7deea71..7b9829d 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_hr.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_hr.cpp
@@ -69,8 +69,9 @@ void RenderHR::print(QPainter *p, int _x, int _y, int _w, int _h, int _tx, int _
prev = prev->previousSibling();
if(prev && static_cast<RenderFlow *>(prev)->floatBottom() > prev->height() )
xp += static_cast<RenderFlow *>(prev)->leftOffset( prev->height() );
-
- int yp = _ty ;
+
+ // [kocienda] yp is unused because of #if 0 block
+ //int yp = _ty ;
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_table.cpp b/WebCore/src/kdelibs/khtml/rendering/render_table.cpp
index 5057090..20fee35 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_table.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_table.cpp
@@ -729,7 +729,8 @@ void RenderTable::calcFinalColMax(int c, ColInfo* col)
oldmin+=colMinWidth[o];
}
- int smin = col->min;
+ // [kocienda] smin in unused
+ //int smin = col->min;
int smax = col->max;
if (col->type == Percent)
@@ -1357,7 +1358,8 @@ void RenderTable::layoutRows(int yoff)
continue;
if ( c < totalCols - 1 && cell == cells[r][c+1] )
continue;
- if ( r < (int)totalRows - 1 && cell == cells[r+1][c] )
+ // [kocienda] fixed signed/unsigned comparison
+ if ( (int)r < (int)totalRows - 1 && cell == cells[r+1][c] )
continue;
cell->calcVerticalMargins();
@@ -1378,7 +1380,8 @@ void RenderTable::layoutRows(int yoff)
else if (h.isPercent())
{
Length ch = containingBlock()->style()->height();
- RenderObject *containing = containingBlock();
+ // [kocienda] containing is unused
+ //RenderObject *containing = containingBlock();
if (ch.isFixed())
th = h.width(ch.value);
else
@@ -1425,7 +1428,8 @@ void RenderTable::layoutRows(int yoff)
continue;
if ( c < totalCols - 1 && cell == cells[r][c+1] )
continue;
- if ( r < (int)totalRows - 1 && cell == cells[r+1][c] )
+ // [kocienda] fixed signed/unsigned comparison
+ if ( (int)r < (int)totalRows - 1 && cell == cells[r+1][c] )
continue;
if ( ( indx = c-cell->colSpan()+1 ) < 0 )
diff --git a/WebCore/src/kwq/KWQCString.mm b/WebCore/src/kwq/KWQCString.mm
index 2a0a3fc..9ca079e 100644
--- a/WebCore/src/kwq/KWQCString.mm
+++ b/WebCore/src/kwq/KWQCString.mm
@@ -97,7 +97,7 @@ int QCString::find(const char *s, int index=0, bool cs=TRUE) const
result = -1;
- if (!s || index >= size()) {
+ if (!s || index >= (int)size()) {
result = -1;
}
else if (!*s) {
diff --git a/WebCore/src/kwq/KWQChar.mm b/WebCore/src/kwq/KWQChar.mm
index 8889072..1ca6471 100644
--- a/WebCore/src/kwq/KWQChar.mm
+++ b/WebCore/src/kwq/KWQChar.mm
@@ -51,6 +51,8 @@ const QChar QChar::null;
// constructors, copy constructors, and destructors ----------------------------
+#ifndef _KWQ_QCHAR_INLINES_
+
QChar::QChar()
{
c = 0;
@@ -96,6 +98,8 @@ QChar::~QChar()
// do nothing because the single data member is a UniChar
}
+#endif // _KWQ_QCHAR_INLINES_
+
// member functions ------------------------------------------------------------
ushort QChar::unicode() const
@@ -231,6 +235,8 @@ int QChar::digitValue() const
// operators -------------------------------------------------------------------
+#ifndef _KWQ_QCHAR_INLINES_
+
bool operator==(QChar qc1, QChar qc2)
{
return qc1.c == qc2.c;
@@ -321,6 +327,8 @@ bool operator<(char ch, QChar qc)
return ch < qc.c;
}
+#endif // _KWQ_QCHAR_INLINES_
+
#else // USING_BORROWED_QSTRING
// This will help to keep the linker from complaining about empty archives
void KWQChar_Dummy() {}
diff --git a/WebCore/src/kwq/KWQColor.mm b/WebCore/src/kwq/KWQColor.mm
index 9c14854..4ebb909 100644
--- a/WebCore/src/kwq/KWQColor.mm
+++ b/WebCore/src/kwq/KWQColor.mm
@@ -374,8 +374,6 @@ void QColor::setHsv(int h, int s, int v)
QColor QColor::light(int factor) const
{
- NSColor *newColor;
-
if (factor <= 0) {
return QColor(*this);
}
@@ -407,8 +405,6 @@ QColor QColor::light(int factor) const
QColor QColor::dark(int factor) const
{
- NSColor *newColor;
-
if (factor <= 0) {
return QColor(*this);
}
@@ -493,7 +489,9 @@ QT_STATIC_CONST_IMPL QColor & Qt::darkYellow = stdcol[18];
void QColor::initGlobalColors()
{
- NSAutoreleasePool *colorPool = [[NSAutoreleasePool allocWithZone:NULL] init];
+ NSAutoreleasePool *colorPool;
+
+ colorPool = [[NSAutoreleasePool allocWithZone:NULL] init];
globals_init = TRUE;
diff --git a/WebCore/src/kwq/KWQFont.mm b/WebCore/src/kwq/KWQFont.mm
index 4ea26e4..4f00f67 100644
--- a/WebCore/src/kwq/KWQFont.mm
+++ b/WebCore/src/kwq/KWQFont.mm
@@ -132,10 +132,14 @@ int QFont::weight() const
bool QFont::setItalic(bool flag)
{
- if (flag)
+ if (flag) {
_setTrait (NSItalicFontMask);
- else
+ return TRUE;
+ }
+ else {
_setTrait (NSUnitalicFontMask);
+ return FALSE;
+ }
}
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index 3e08044..32343b4 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -145,7 +145,6 @@ static NSMutableDictionary *metricsCache = nil;
- (NSRect)rectForString:(NSString *)string
{
KWQLayoutFragment *cachedFragment, *fragment;
- NSTextStorage *textStorage;
if (fragmentCache == nil){
fragmentCache = [[NSMutableDictionary alloc] init];
diff --git a/WebCore/src/kwq/KWQFrame.mm b/WebCore/src/kwq/KWQFrame.mm
index 004eb5a..292156a 100644
--- a/WebCore/src/kwq/KWQFrame.mm
+++ b/WebCore/src/kwq/KWQFrame.mm
@@ -60,5 +60,6 @@ QFrame::QFrame(const QFrame &)
QFrame &QFrame::operator=(const QFrame &)
{
_logNeverImplemented();
+ return *this;
}
diff --git a/WebCore/src/kwq/KWQKCursor.mm b/WebCore/src/kwq/KWQKCursor.mm
index 9f093c0..d5dabc1 100644
--- a/WebCore/src/kwq/KWQKCursor.mm
+++ b/WebCore/src/kwq/KWQKCursor.mm
@@ -27,15 +27,15 @@
void KCursor::setAutoHideCursor(QWidget *w, bool enable) {}
-QCursor KCursor::arrowCursor() {}
-QCursor KCursor::crossCursor() {}
-QCursor KCursor::sizeAllCursor() {}
-QCursor KCursor::sizeHorCursor() {}
-QCursor KCursor::sizeVerCursor() {}
-QCursor KCursor::sizeBDiagCursor() {}
-QCursor KCursor::sizeFDiagCursor() {}
-QCursor KCursor::ibeamCursor() {}
-QCursor KCursor::waitCursor() {}
+QCursor KCursor::arrowCursor() { return QCursor(); }
+QCursor KCursor::crossCursor() { return QCursor(); }
+QCursor KCursor::sizeAllCursor() { return QCursor(); }
+QCursor KCursor::sizeHorCursor() { return QCursor(); }
+QCursor KCursor::sizeVerCursor() { return QCursor(); }
+QCursor KCursor::sizeBDiagCursor() { return QCursor(); }
+QCursor KCursor::sizeFDiagCursor() { return QCursor(); }
+QCursor KCursor::ibeamCursor() { return QCursor(); }
+QCursor KCursor::waitCursor() { return QCursor(); }
KCursor::KCursor()
diff --git a/WebCore/src/kwq/KWQKDebug.mm b/WebCore/src/kwq/KWQKDebug.mm
index edd680a..e225560 100644
--- a/WebCore/src/kwq/KWQKDebug.mm
+++ b/WebCore/src/kwq/KWQKDebug.mm
@@ -33,31 +33,37 @@ kdbgstream::kdbgstream(unsigned int area, unsigned int level, bool print=true)
kdbgstream &kdbgstream::operator<<(int)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const char *)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const void *)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const QString &)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(const QCString &)
{
+ return *this;
}
kdbgstream &kdbgstream::operator<<(KDBGFUNC)
{
+ return *this;
}
@@ -65,36 +71,43 @@ kdbgstream &kdbgstream::operator<<(KDBGFUNC)
kdbgstream kdDebug(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdWarning(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdWarning(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdError(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdError(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdFatal(int area = 0)
{
+ return kdbgstream(0,0);
}
kdbgstream kdFatal(bool cond, int area = 0)
{
+ return kdbgstream(0,0);
}
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 2cf4d80..3ba0d46 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -28,7 +28,7 @@
#include <qfont.h>
#include <qtextcodec.h>
-#include <Foundation/Foundation.h>
+#import <Foundation/Foundation.h>
#include <job.h>
#include <jobclasses.h>
@@ -45,12 +45,15 @@
#include <kjs.h>
#include <kjs_dom.h>
#include <dom_doc.h>
+#include <qcursor.h>
#include <KWQKHTMLPart.h>
#import <WCURICache.h>
#import <WCURICacheData.h>
+#import <KWQView.h>
+
static bool cache_init = false;
static void recursive(const DOM::Node &pNode, const DOM::Node &node)
@@ -279,6 +282,8 @@ bool KHTMLPart::closeURL()
//d->m_doc = 0;
+
+ return true;
}
@@ -421,7 +426,7 @@ bool KHTMLPart::onlyLocalReferences() const
}
#ifdef _KWQ_TIMING
- static long totalWriteTime = 0;
+ static double totalWriteTime = 0;
#endif
@@ -509,7 +514,7 @@ void KHTMLPart::write(const char *str, int len)
if ( len == -1 )
len = strlen( str );
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
QString decoded = d->m_decoder->decode( str, len );
@@ -525,9 +530,9 @@ void KHTMLPart::write(const char *str, int len)
t->write( decoded, true );
#ifdef _KWQ_TIMING
- long thisTime = _GetMillisecondsSinceEpoch() - start;
+ double thisTime = CFAbsoluteTimeGetCurrent() - start;
totalWriteTime += thisTime;
- KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %d, milliseconds = %d, total = %d\n", len, thisTime, totalWriteTime);
+ KWQDEBUGLEVEL3 (0x200, "tokenize/parse length = %e, milliseconds = %e, total = %e\n", len, thisTime, totalWriteTime);
#endif
}
@@ -665,10 +670,12 @@ void KHTMLPart::setURLCursor( const QCursor &c )
_logNeverImplemented();
}
-
+// FIXME: this should be removed
+static const QCursor staticURLCursor = QCursor();
const QCursor& KHTMLPart::urlCursor() const
{
_logNeverImplemented();
+ return staticURLCursor;
}
@@ -707,6 +714,7 @@ QString KHTMLPart::selectedText() const
DOM::Range KHTMLPart::selection() const
{
_logNeverImplemented();
+ return DOM::Range();
}
@@ -946,7 +954,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// The mouse is over something
if ( url.length() )
{
- bool shiftPressed = ( _mouse->state() & ShiftButton );
+ // FIXME: this is unused
+ //bool shiftPressed = ( _mouse->state() & ShiftButton );
// Image map
if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -1067,7 +1076,6 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
{
- QMouseEvent *_mouse = event->qmouseEvent();
DOM::Node innerNode = event->innerNode();
d->m_mousePressNode = DOM::Node();
@@ -1080,7 +1088,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
// HACK! FIXME!
if (d->m_strSelectedURL != QString::null) {
- [((QWidget *)view())->getView() resetView];
+ [((KWQHTMLView *)((QWidget *)view())->getView()) resetView];
KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
openURL (clickedURL);
// [kocienda]: shield your eyes!
diff --git a/WebCore/src/kwq/KWQKHTMLSettings.mm b/WebCore/src/kwq/KWQKHTMLSettings.mm
index 87ad966..0006b7d 100644
--- a/WebCore/src/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/src/kwq/KWQKHTMLSettings.mm
@@ -33,7 +33,7 @@ KHTMLSettings::KHTMLSettings()
// set available font families...ask the system
NSFontManager *sharedFontManager;
NSArray *array, *fontSizeArray;
- int i;
+ unsigned int i;
sharedFontManager = [NSFontManager sharedFontManager];
array = [sharedFontManager availableFontFamilies];
diff --git a/WebCore/src/kwq/KWQKLineEdit.mm b/WebCore/src/kwq/KWQKLineEdit.mm
index 22039d7..c7964db 100644
--- a/WebCore/src/kwq/KWQKLineEdit.mm
+++ b/WebCore/src/kwq/KWQKLineEdit.mm
@@ -41,13 +41,15 @@ KLineEdit::~KLineEdit()
void KLineEdit::setMouseTracking(bool)
{
- KWQNSTextField *fieldView = (KWQNSTextField *)getView();
+ KWQNSTextField *fieldView;
+ fieldView = (KWQNSTextField *)getView();
}
void KLineEdit::setContextMenuEnabled(bool showMenu)
{
- KWQNSTextField *fieldView = (KWQNSTextField *)getView();
+ KWQNSTextField *fieldView;
+ fieldView = (KWQNSTextField *)getView();
}
diff --git a/WebCore/src/kwq/KWQKMimeType.mm b/WebCore/src/kwq/KWQKMimeType.mm
index 4d33989..b79558e 100644
--- a/WebCore/src/kwq/KWQKMimeType.mm
+++ b/WebCore/src/kwq/KWQKMimeType.mm
@@ -28,10 +28,12 @@
//FIX ME:
static QString tempQString = QString();
+static KMimeType::Ptr tempPtr = KMimeType::Ptr();
KMimeType::Ptr KMimeType::findByURL(const KURL &, mode_t=0, bool=false, bool)
{
_logNotYetImplemented();
+ return tempPtr;
}
diff --git a/WebCore/src/kwq/KWQKWin.mm b/WebCore/src/kwq/KWQKWin.mm
index 15e3eef..3c741b4 100644
--- a/WebCore/src/kwq/KWQKWin.mm
+++ b/WebCore/src/kwq/KWQKWin.mm
@@ -30,4 +30,6 @@
KWin::Info KWin::info(int win)
{
_logNotYetImplemented();
+ KWin::Info result;
+ return result;
}
diff --git a/WebCore/src/kwq/KWQKjobclasses.mm b/WebCore/src/kwq/KWQKjobclasses.mm
index 6a897d1..722027f 100644
--- a/WebCore/src/kwq/KWQKjobclasses.mm
+++ b/WebCore/src/kwq/KWQKjobclasses.mm
@@ -108,8 +108,6 @@ private:
TransferJob::TransferJob(const KURL &url, bool reload=false, bool showProgressInfo=true)
{
- NSString *string;
-
_url = url;
_reload = reload;
_showProgressInfo = showProgressInfo;
diff --git a/WebCore/src/kwq/KWQKloader.mm b/WebCore/src/kwq/KWQKloader.mm
index e5af97b..4f15b2d 100644
--- a/WebCore/src/kwq/KWQKloader.mm
+++ b/WebCore/src/kwq/KWQKloader.mm
@@ -915,6 +915,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
-(id)initWithLoader:(Loader *)loader
{
m_loader = loader;
+ return self;
}
-(void)cacheDataAvailable:(NSNotification *)notification
diff --git a/WebCore/src/kwq/KWQListBox.mm b/WebCore/src/kwq/KWQListBox.mm
index 840efc5..92e6b3f 100644
--- a/WebCore/src/kwq/KWQListBox.mm
+++ b/WebCore/src/kwq/KWQListBox.mm
@@ -60,7 +60,7 @@ QListBox::~QListBox()
uint QListBox::count() const
{
- (uint)[matrix numberOfRows];
+ return (uint)[matrix numberOfRows];
}
@@ -105,7 +105,7 @@ void QListBox::insertItem(const QListBoxItem *newItem, int index)
if ( !newItem )
return;
- if ( index < 0 || index >= count())
+ if ( index < 0 || index >= (int)count())
index = count();
QListBoxItem *item = (QListBoxItem *)newItem;
diff --git a/WebCore/src/kwq/KWQNSTextField.mm b/WebCore/src/kwq/KWQNSTextField.mm
index 4e559dc..0d736de 100644
--- a/WebCore/src/kwq/KWQNSTextField.mm
+++ b/WebCore/src/kwq/KWQNSTextField.mm
@@ -160,15 +160,13 @@
- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error
{
*obj = string;
+ return YES;
}
- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error
{
- int i, length = [(NSString *)partialString length];
- NSString *string = @"";
-
- if ([partialString length] >= maxLength){
+ if ((int)[partialString length] >= maxLength){
*newString = nil;
return NO;
}
diff --git a/WebCore/src/kwq/KWQPainter.mm b/WebCore/src/kwq/KWQPainter.mm
index 5fa6b11..3cd0d40 100644
--- a/WebCore/src/kwq/KWQPainter.mm
+++ b/WebCore/src/kwq/KWQPainter.mm
@@ -174,6 +174,7 @@ const QBrush &QPainter::brush() const
QRect QPainter::xForm(const QRect &) const
{
_logNotYetImplemented();
+ return QRect();
}
@@ -246,8 +247,6 @@ void QPainter::_setColorFromPen()
void QPainter::drawLine(int x1, int y1, int x2, int y2)
{
- NSBezierPath *path;
-
_lockFocus();
_setColorFromPen();
@@ -346,7 +345,6 @@ void QPainter::_drawPoints (const QPointArray &_points, bool winding, int index,
int _npoints, bool fill)
{
NSBezierPath *path;
- float fa, falen;
int i;
int npoints = _npoints != -1 ? _npoints : _points.size()-index;
@@ -470,7 +468,6 @@ void QPainter::drawText(int x, int y, const QString &qstring, int len)
{
NSString *string;
NSFont *font;
- const char *ascii;
_lockFocus();
@@ -529,7 +526,6 @@ void QPainter::drawText(int x, int y, int w, int h, int flags, const QString&qst
{
NSString *string;
NSFont *font;
- const char *ascii;
NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
_lockFocus();
@@ -622,6 +618,7 @@ Qt::RasterOp QPainter::rasterOp() const
return CopyROP;
#else
_logNeverImplemented();
+ return CopyROP;
#endif
}
@@ -657,12 +654,14 @@ bool QPainter::begin(const QPaintDevice *bd)
data->bufferDevice = bd;
const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
[pixmap->nsimage setFlipped: YES];
+ return true;
}
bool QPainter::end()
{
data->bufferDevice = 0L;
+ return true;
}
diff --git a/WebCore/src/kwq/KWQPart.mm b/WebCore/src/kwq/KWQPart.mm
index 4d78676..56299b4 100644
--- a/WebCore/src/kwq/KWQPart.mm
+++ b/WebCore/src/kwq/KWQPart.mm
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <qwidget.h>
#include <kwqdebug.h>
#include <part.h>
@@ -41,9 +42,11 @@ KParts::Part::~Part()
}
+static QWidget *theWidget = new QWidget();
QWidget *KParts::Part::widget()
{
_logNotYetImplemented();
+ return theWidget;
}
@@ -67,8 +70,10 @@ KParts::ReadOnlyPart::~ReadOnlyPart()
}
+static const KURL emptyURL = KURL();
const KURL &KParts::ReadOnlyPart::url() const
{
// must override
_logNeverImplemented();
+ return emptyURL;
}
diff --git a/WebCore/src/kwq/KWQPixmap.mm b/WebCore/src/kwq/KWQPixmap.mm
index 9e4d75e..17f8b04 100644
--- a/WebCore/src/kwq/KWQPixmap.mm
+++ b/WebCore/src/kwq/KWQPixmap.mm
@@ -25,6 +25,7 @@
#include <kwqdebug.h>
#include <qpixmap.h>
+#include <qbitmap.h>
/*
* FIXME: This is a bad hack which really should go away.
@@ -108,10 +109,11 @@ void QPixmap::setMask(const QBitmap &)
_logNotYetImplemented();
}
-
+static QBitmap *theMask = new QBitmap();
const QBitmap *QPixmap::mask() const
{
_logNotYetImplemented();
+ return theMask;
}
@@ -178,6 +180,7 @@ QPixmap QPixmap::xForm(const QWMatrix &xmatrix) const
QImage QPixmap::convertToImage() const
{
_logNotYetImplemented();
+ return QImage();
}
diff --git a/WebCore/src/kwq/KWQRegion.mm b/WebCore/src/kwq/KWQRegion.mm
index 8fa00ff..eccd709 100644
--- a/WebCore/src/kwq/KWQRegion.mm
+++ b/WebCore/src/kwq/KWQRegion.mm
@@ -87,9 +87,10 @@ QRegion::~QRegion()
free(data);
}
-QRegion QRegion::intersect(const QRegion &) const
+QRegion QRegion::intersect(const QRegion ®ion) const
{
_logNotYetImplemented();
+ return region;
}
bool QRegion::contains(const QPoint &point) const
@@ -113,4 +114,5 @@ QRegion &QRegion::operator=(const QRegion &other)
}
data->path = [[NSBezierPath bezierPath] retain];
[data->path appendBezierPath:other.data->path];
+ return *this;
}
diff --git a/WebCore/src/kwq/KWQScrollView.mm b/WebCore/src/kwq/KWQScrollView.mm
index 21ace9c..b760012 100644
--- a/WebCore/src/kwq/KWQScrollView.mm
+++ b/WebCore/src/kwq/KWQScrollView.mm
@@ -260,5 +260,6 @@ QScrollView::QScrollView(const QScrollView &)
QScrollView &QScrollView::operator=(const QScrollView &)
{
_logNeverImplemented();
+ return *this;
}
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 3b2af80..c5d7c51 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -146,6 +146,8 @@ QString QString::fromCFMutableString(CFMutableStringRef cfs)
// constructors, copy constructors, and destructors ----------------------------
+#ifndef _KWQ_QSTRING_INLINES_
+
QString::QString()
{
s = NULL;
@@ -153,6 +155,18 @@ QString::QString()
cacheType = CacheInvalid;
}
+QString::~QString()
+{
+ if (s) {
+ CFRelease(s);
+ }
+ if (cache) {
+ CFAllocatorDeallocate(kCFAllocatorDefault, cache);
+ }
+}
+
+#endif // _KWQ_QSTRING_INLINES_
+
QString::QString(QChar qc)
{
s = CFStringCreateMutable(kCFAllocatorDefault, 0);
@@ -232,16 +246,6 @@ QString::QString(const QString &qs)
cacheType = CacheInvalid;
}
-QString::~QString()
-{
- if (s) {
- CFRelease(s);
- }
- if (cache) {
- CFAllocatorDeallocate(kCFAllocatorDefault, cache);
- }
-}
-
// assignment operators --------------------------------------------------------
QString &QString::operator=(const QString &qs)
@@ -268,6 +272,8 @@ QString &QString::operator=(const char *chs)
return *this = QString(chs);
}
+#ifndef _KWQ_QSTRING_INLINES_
+
QString &QString::operator=(QChar qc)
{
return *this = QString(qc);
@@ -278,13 +284,41 @@ QString &QString::operator=(char ch)
return *this = QString(QChar(ch));
}
+#endif // _KWQ_QSTRING_INLINES_
+
// member functions ------------------------------------------------------------
+#ifndef _KWQ_QSTRING_INLINES_
+
uint QString::length() const
{
return s ? CFStringGetLength(s) : 0;
}
+bool QString::isNull() const
+{
+ // NOTE: do NOT use "unicode() == NULL"
+ return s == NULL;
+}
+
+bool QString::isEmpty() const
+{
+ return length() == 0;
+}
+
+QChar QString::at(uint index) const
+{
+ if (s) {
+ CFIndex len = CFStringGetLength(s);
+ if (index < len) {
+ return QChar(CFStringGetCharacterAtIndex(s, index));
+ }
+ }
+ return QChar(0);
+}
+
+#endif // _KWQ_QSTRING_INLINES_
+
const QChar *QString::unicode() const
{
UniChar *ucs = NULL;
@@ -363,30 +397,6 @@ QCString QString::local8Bit() const
return convertToQCString(kCFStringEncodingMacRoman);
}
-bool QString::isNull() const
-{
- // NOTE: do NOT use "unicode() == NULL"
- return s == NULL;
-}
-
-bool QString::isEmpty() const
-{
- return length() == 0;
-}
-
-//#ifdef USING_BORROWED_KURL
-QChar QString::at(uint index) const
-{
- if (s) {
- CFIndex len = CFStringGetLength(s);
- if (index < len) {
- return QChar(CFStringGetCharacterAtIndex(s, index));
- }
- }
- return QChar(0);
-}
-//#endif // USING_BORROWED_KURL
-
int QString::compare(const QString &qs) const
{
if (s == qs.s) {
@@ -760,15 +770,17 @@ QString QString::right(uint width) const
QString QString::mid(uint index, uint width) const
{
QString qs;
+ int signedIndex = (int)index;
+ int signedWidth = (int)width;
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && (index < len) && width) {
- if (!((index == 0) && (width >= len))) {
- if (width > (len - index)) {
- width = len - index;
+ if (len && (signedIndex < len) && signedWidth) {
+ if (!((signedIndex == 0) && (signedWidth >= len))) {
+ if (signedWidth > (len - signedIndex)) {
+ signedWidth = len - signedIndex;
}
CFStringRef tmp = CFStringCreateWithSubstring(
- kCFAllocatorDefault, s, CFRangeMake(index, width));
+ kCFAllocatorDefault, s, CFRangeMake(signedIndex, width));
if (tmp) {
qs.s = CFStringCreateMutableCopy(kCFAllocatorDefault, 0,
tmp);
@@ -1030,6 +1042,7 @@ QString &QString::append(const QString &qs)
QString &QString::insert(uint index, const QString &qs)
{
+ int signedIndex = (int)index;
flushCache();
if (qs.s) {
CFIndex len = CFStringGetLength(qs.s);
@@ -1038,8 +1051,8 @@ QString &QString::insert(uint index, const QString &qs)
s = CFStringCreateMutable(kCFAllocatorDefault, 0);
}
if (s) {
- if (index < CFStringGetLength(s)) {
- CFStringInsert(s, index, qs.s);
+ if (signedIndex < CFStringGetLength(s)) {
+ CFStringInsert(s, signedIndex, qs.s);
} else {
CFStringAppend(s, qs.s);
}
@@ -1061,14 +1074,16 @@ QString &QString::insert(uint index, char ch)
QString &QString::remove(uint index, uint width)
{
+ int signedIndex = (int)index;
+ int signedWidth = (int)width;
flushCache();
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && (index < len) && width) {
- if (width > (len - index)) {
- width = len - index;
+ if (len && (signedIndex < len) && signedWidth) {
+ if (signedWidth > (len - signedIndex)) {
+ signedWidth = len - signedIndex;
}
- CFStringDelete(s, CFRangeMake(index, width));
+ CFStringDelete(s, CFRangeMake(signedIndex, signedWidth));
}
}
return *this;
@@ -1099,11 +1114,12 @@ QString &QString::replace(const QRegExp &qre, const QString &qs)
void QString::truncate(uint newLen)
{
flushCache();
+ int signedNewLen = (int)newLen;
if (s) {
- if (newLen) {
+ if (signedNewLen) {
CFIndex len = CFStringGetLength(s);
- if (len && (newLen < len)) {
- CFStringDelete(s, CFRangeMake(newLen, len - newLen));
+ if (len && (signedNewLen < len)) {
+ CFStringDelete(s, CFRangeMake(signedNewLen, len - signedNewLen));
}
} else {
CFRelease(s);
@@ -1313,13 +1329,14 @@ ulong QString::convertToNumber(bool *ok, int base, bool *neg) const
QString QString::leftRight(uint width, bool left) const
{
QString qs;
+ int signedWidth = (int)width;
if (s) {
CFIndex len = CFStringGetLength(s);
- if (len && width) {
- if (len > width) {
+ if (len && signedWidth) {
+ if (len > signedWidth) {
CFStringRef tmp = CFStringCreateWithSubstring(
- kCFAllocatorDefault, s, left ? CFRangeMake(0, width)
- : CFRangeMake(len - width, width));
+ kCFAllocatorDefault, s, left ? CFRangeMake(0, signedWidth)
+ : CFRangeMake(len - signedWidth, signedWidth));
if (tmp) {
qs.s = CFStringCreateMutableCopy(kCFAllocatorDefault, 0,
tmp);
diff --git a/WebCore/src/kwq/KWQTextStorage.h b/WebCore/src/kwq/KWQTextStorage.h
index 37c691e..2632153 100644
--- a/WebCore/src/kwq/KWQTextStorage.h
+++ b/WebCore/src/kwq/KWQTextStorage.h
@@ -33,7 +33,7 @@
NSLayoutManager *_layoutManager;
}
-+ setString:(NSString *)str attributes:(NSDictionary *)attrs;
++ (void)setString:(NSString *)str attributes:(NSDictionary *)attrs;
- (void)setString: (NSString *)aString attributes: (NSDictionary *)at;
@end
diff --git a/WebCore/src/kwq/KWQTextStorage.mm b/WebCore/src/kwq/KWQTextStorage.mm
index 1e9a5dc..12efc33 100644
--- a/WebCore/src/kwq/KWQTextStorage.mm
+++ b/WebCore/src/kwq/KWQTextStorage.mm
@@ -49,7 +49,7 @@ static KWQTextStorage *sharedInstance = nil;
return sharedInstance;
}
-+ setString:(NSString *)str attributes:(NSDictionary *)attrs
++ (void)setString:(NSString *)str attributes:(NSDictionary *)attrs
{
[[KWQTextStorage sharedInstance] setString: str attributes: attrs];
}
diff --git a/WebCore/src/kwq/KWQView.h b/WebCore/src/kwq/KWQView.h
index 4ed3055..e75c611 100644
--- a/WebCore/src/kwq/KWQView.h
+++ b/WebCore/src/kwq/KWQView.h
@@ -70,6 +70,7 @@ class KHTMLPart;
- initWithFrame: (NSRect)r widget: (QWidget *)w;
- (void)setIsFlipped: (bool)flag;
- (void)setNeedsLayout: (bool)flag;
+- (void)resetView;
@end
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index 0311903..2672225 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -78,7 +78,7 @@
return self;
}
-- action: sender
+- (void)action: sender
{
widget->emitAction(QObject::ACTION_BUTTON_CLICKED);
}
@@ -149,9 +149,9 @@
if (((KHTMLView *)widget)->part()->xmlDocImpl() &&
((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
if (needsLayout){
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
((KHTMLView *)widget)->layout(TRUE);
- KWQDEBUGLEVEL1 (0x200, "layout time %d\n", _GetMillisecondsSinceEpoch() - start);
+ KWQDEBUGLEVEL1 (0x200, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
needsLayout = NO;
}
}
@@ -174,12 +174,12 @@
[self lockFocus];
- long start = _GetMillisecondsSinceEpoch();
+ double start = CFAbsoluteTimeGetCurrent();
((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x,
(int)rect.origin.y,
(int)rect.size.width,
(int)rect.size.height );
- KWQDEBUGLEVEL1 (0x200, "draw time %d\n", _GetMillisecondsSinceEpoch() - start);
+ KWQDEBUGLEVEL1 (0x200, "draw time %e\n", CFAbsoluteTimeGetCurrent() - start);
[self unlockFocus];
}
}
diff --git a/WebCore/src/kwq/KWQWMatrix.mm b/WebCore/src/kwq/KWQWMatrix.mm
index 95713fc..b2ff6ad 100644
--- a/WebCore/src/kwq/KWQWMatrix.mm
+++ b/WebCore/src/kwq/KWQWMatrix.mm
@@ -43,5 +43,6 @@ QWMatrix &QWMatrix::scale(double _sx, double _sy)
empty = FALSE;
sx = _sx;
sy = _sy;
+ return *this;
}
diff --git a/WebCore/src/kwq/KWQxml.mm b/WebCore/src/kwq/KWQxml.mm
index c409d65..6e35c47 100644
--- a/WebCore/src/kwq/KWQxml.mm
+++ b/WebCore/src/kwq/KWQxml.mm
@@ -195,6 +195,7 @@ QXmlParseException::QXmlParseException()
QString QXmlParseException::message() const
{
_logNotYetImplemented();
+ return QString();
}
diff --git a/WebCore/src/kwq/kde/_kurl.cpp b/WebCore/src/kwq/kde/_kurl.cpp
index feaaea4..1f95203 100644
--- a/WebCore/src/kwq/kde/_kurl.cpp
+++ b/WebCore/src/kwq/kde/_kurl.cpp
@@ -227,8 +227,8 @@ static QString decode( const QString& segment, bool *keepEncoded=0, int encoding
// Encoding specified
if ( encoding_hint )
{
- QTextCodec * textCodec = codecForHint( encoding_hint );
// FIXME: ignoring encodings for now
+ //QTextCodec * textCodec = codecForHint( encoding_hint );
/*
if (textCodec)
{
@@ -1207,7 +1207,7 @@ QString KURL::fileName( bool _strip_trailing_slash ) const
{
QString fname;
- int len = m_strPath.length();
+ unsigned int len = m_strPath.length();
if ( len == 0 )
return fname;
diff --git a/WebCore/src/kwq/kdecore/kdebug.h b/WebCore/src/kwq/kdecore/kdebug.h
index b1e31f4..227aaa1 100644
--- a/WebCore/src/kwq/kdecore/kdebug.h
+++ b/WebCore/src/kwq/kdecore/kdebug.h
@@ -66,17 +66,17 @@ public:
kdbgstream &operator<<(const QCString &);
kdbgstream &operator<<(KDBGFUNC);
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
-
-private:
-
// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
kdbgstream(const kdbgstream &);
#endif
+// protected -------------------------------------------------------------------
+// private ---------------------------------------------------------------------
+
+private:
+
// add assignment operator
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
diff --git a/WebCore/src/kwq/kio/kmimetype.h b/WebCore/src/kwq/kio/kmimetype.h
index a06f79d..bc06104 100644
--- a/WebCore/src/kwq/kio/kmimetype.h
+++ b/WebCore/src/kwq/kio/kmimetype.h
@@ -49,8 +49,8 @@ public:
// constructors, copy constructors, and destructors ------------------------
- KSharedPtr() {}
- KSharedPtr(const KSharedPtr &) {}
+ KSharedPtr() { object = 0; }
+ KSharedPtr(const KSharedPtr &) {object = 0;}
~KSharedPtr() {}
// member functions --------------------------------------------------------
@@ -58,11 +58,14 @@ public:
// operators ---------------------------------------------------------------
KSharedPtr &operator=(const KSharedPtr &) {}
- T *operator->() {}
+ T *operator->() { return object; }
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
+private:
+ T *object;
+
}; // class KSharedPtr =========================================================
diff --git a/WebCore/src/kwq/kwqdebug.mm b/WebCore/src/kwq/kwqdebug.mm
index 1c77f4c..5434462 100644
--- a/WebCore/src/kwq/kwqdebug.mm
+++ b/WebCore/src/kwq/kwqdebug.mm
@@ -25,38 +25,8 @@
#include <kwqdebug.h>
-
-#if defined(__MACH__)
-#include <stdlib.h>
-#include <sys/time.h>
-#endif
-#if defined(__WIN32__)
-#import <sys/utime.h>
-#endif
-
-
-long _GetMillisecondsSinceEpoch() {
- long result;
- struct timeval tp;
- struct timezone tzp;
-
- result = 0;
- tzp.tz_minuteswest = 0;
- tzp.tz_dsttime = 0;
-
- // FIXME: need to ifdef for Win32 at some point,
- // or use something from Foundation
- if (gettimeofday(&tp, &tzp) == 0) {
- result = (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
- }
-
- return result;
-}
-
-
unsigned int KWQ_LOG_LEVEL = KWQ_LOG_ALL;
-
void KWQSetLogLevel(int mask) {
KWQ_LOG_LEVEL = mask;
}
diff --git a/WebCore/src/kwq/qt/_qstringlist.cpp b/WebCore/src/kwq/qt/_qstringlist.cpp
index 6b87311..a7e9458 100644
--- a/WebCore/src/kwq/qt/_qstringlist.cpp
+++ b/WebCore/src/kwq/qt/_qstringlist.cpp
@@ -266,8 +266,6 @@ QStringList QStringList::grep( const QRegExp &expr ) const
for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
if ( (*it).contains( expr ) )
res << *it;
-#else
-#warning function is not implemented
#endif
return res;
}
diff --git a/WebCore/src/kwq/qt/qasyncimageio.h b/WebCore/src/kwq/qt/qasyncimageio.h
index 8eca5b9..45b6165 100644
--- a/WebCore/src/kwq/qt/qasyncimageio.h
+++ b/WebCore/src/kwq/qt/qasyncimageio.h
@@ -62,7 +62,7 @@ public:
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
- ~QImageConsumer() {}
+ virtual ~QImageConsumer() {}
#endif
// member functions --------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/qstring.h b/WebCore/src/kwq/qt/qstring.h
index 5175efd..3c972ef 100644
--- a/WebCore/src/kwq/qt/qstring.h
+++ b/WebCore/src/kwq/qt/qstring.h
@@ -175,6 +175,145 @@ private:
}; // class QChar ==============================================================
+#if defined (_KWQ_QCHAR_INLINES_) && ! defined (_KWQ_QCHAR_INLINES_INCLUDED_)
+#define _KWQ_QCHAR_INLINES_INCLUDED_
+
+inline QChar::QChar()
+{
+ c = 0;
+}
+
+inline QChar::QChar(char ch)
+{
+ c = ch;
+}
+
+inline QChar::QChar(uchar uch)
+{
+ c = uch;
+}
+
+inline QChar::QChar(short n)
+{
+ c = n;
+}
+
+inline QChar::QChar(ushort n)
+{
+ c = n;
+}
+
+inline QChar::QChar(uint n)
+{
+ c = n;
+}
+
+inline QChar::QChar(int n)
+{
+ c = n;
+}
+
+inline QChar::QChar(const QChar &qc)
+{
+ c = qc.c;
+}
+
+inline QChar::~QChar()
+{
+ // do nothing because the single data member is a UniChar
+}
+
+inline bool operator==(QChar qc1, QChar qc2)
+{
+ return qc1.c == qc2.c;
+}
+
+inline bool operator==(QChar qc, char ch)
+{
+ return qc.c == ch;
+}
+
+inline bool operator==(char ch, QChar qc)
+{
+ return ch == qc.c;
+}
+
+inline bool operator!=(QChar qc1, QChar qc2)
+{
+ return qc1.c != qc2.c;
+}
+
+inline bool operator!=(QChar qc, char ch)
+{
+ return qc.c != ch;
+}
+
+inline bool operator!=(char ch, QChar qc)
+{
+ return ch != qc.c;
+}
+
+inline bool operator>=(QChar qc1, QChar qc2)
+{
+ return qc1.c >= qc2.c;
+}
+
+inline bool operator>=(QChar qc, char ch)
+{
+ return qc.c >= ch;
+}
+
+inline bool operator>=(char ch, QChar qc)
+{
+ return ch >= qc.c;
+}
+
+inline bool operator>(QChar qc1, QChar qc2)
+{
+ return qc1.c > qc2.c;
+}
+
+inline bool operator>(QChar qc, char ch)
+{
+ return qc.c > ch;
+}
+
+inline bool operator>(char ch, QChar qc)
+{
+ return ch > qc.c;
+}
+
+inline bool operator<=(QChar qc1, QChar qc2)
+{
+ return qc1.c <= qc2.c;
+}
+
+inline bool operator<=(QChar qc, char ch)
+{
+ return qc.c <= ch;
+}
+
+inline bool operator<=(char ch, QChar qc)
+{
+ return ch <= qc.c;
+}
+
+inline bool operator<(QChar qc1, QChar qc2)
+{
+ return qc1.c < qc2.c;
+}
+
+inline bool operator<(QChar qc, char ch)
+{
+ return qc.c < ch;
+}
+
+inline bool operator<(char ch, QChar qc)
+{
+ return ch < qc.c;
+}
+
+#endif // _KWQ_QCHAR_INLINES_
// QString class ===============================================================
@@ -399,6 +538,66 @@ QString operator+(const char *, const QString &);
QString operator+(QChar, const QString &);
QString operator+(char, const QString &);
+#if defined (_KWQ_QSTRING_INLINES_) && ! defined (_KWQ_QSTRING_INLINES_INCLUDED_)
+#define _KWQ_QSTRING_INLINES_INCLUDED_
+
+inline QString::QString()
+{
+ s = NULL;
+ cache = NULL;
+ cacheType = CacheInvalid;
+}
+
+inline QString::~QString()
+{
+ if (s) {
+ CFRelease(s);
+ }
+ if (cache) {
+ CFAllocatorDeallocate(kCFAllocatorDefault, cache);
+ }
+}
+
+inline QString &QString::operator=(QChar qc)
+{
+ return *this = QString(qc);
+}
+
+inline QString &QString::operator=(char ch)
+{
+ return *this = QString(QChar(ch));
+}
+
+inline uint QString::length() const
+{
+ return s ? CFStringGetLength(s) : 0;
+}
+
+inline bool QString::isNull() const
+{
+ // NOTE: do NOT use "unicode() == NULL"
+ return s == NULL;
+}
+
+inline bool QString::isEmpty() const
+{
+ return length() == 0;
+}
+
+inline QChar QString::at(uint index) const
+{
+ // FIXME: this might cause some errors on *big* indexes
+ CFIndex signedIndex = (CFIndex)index;
+ if (s) {
+ CFIndex len = CFStringGetLength(s);
+ if (signedIndex < len) {
+ return QChar(CFStringGetCharacterAtIndex(s, signedIndex));
+ }
+ }
+ return QChar(0);
+}
+
+#endif // _KWQ_QSTRING_INLINES_
// class QConstString ==========================================================
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list