[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [patch] Fixes for kdelibs on win32/msvc
From:       Jarosław_Staniek <js () iidea ! pl>
Date:       2007-07-10 13:42:03
Message-ID: 46938CAB.6020400 () iidea ! pl
[Download RAW message or body]

Hello,
RFC. This patch is against trunk from the last weekend, so I'll update it 
before commiting.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org

["kdelibs.patch" (text/plain)]

Index: kimgio/xcf.h
===================================================================
--- kimgio/xcf.h	(wersja 684875)
+++ kimgio/xcf.h	(kopia robocza)
@@ -43,7 +43,7 @@
     static bool canRead(QIODevice *device);
 };
 
-const float INCHESPERMETER = (100.0 / 2.54);
+const float INCHESPERMETER = float(100.0 / 2.54);
 
 /*!
  * Each layer in an XCF file is stored as a matrix of
Index: kio/kio/kmimetyperesolver.cpp
===================================================================
--- kio/kio/kmimetyperesolver.cpp	(wersja 684875)
+++ kio/kio/kmimetyperesolver.cpp	(kopia robocza)
@@ -56,7 +56,7 @@
 
     if (m_pendingIndexes.count() < 20) { // for few items, it's faster to \
                not bother
         //kDebug() << k_funcinfo << "Few items, returning first one" << \
                endl;
-        return m_pendingIndexes.first();
+        return (QModelIndex)m_pendingIndexes.first();
     }
 
     const QRect visibleArea = m_view->viewport()->rect();
@@ -66,7 +66,7 @@
         const QRect rect = m_view->visualRect(*it);
         if (rect.intersects(visibleArea)) {
             //kDebug() << k_funcinfo << "found item at " << rect << " in \
                visibleArea " << visibleArea << endl;
-            return *it;
+            return (QModelIndex)*it;
         }
     }
 
Index: kio/kio/ktar.cpp
===================================================================
--- kio/kio/ktar.cpp	(wersja 684875)
+++ kio/kio/ktar.cpp	(kopia robocza)
@@ -98,7 +98,7 @@
                 if ( file.getChar( &firstByte ) &&
                      file.getChar( &secondByte ) &&
                      file.getChar( &thirdByte ) ) {
-                    if ( firstByte == 0037 && secondByte == \
static_cast<char>(0213) ) +                    if ( firstByte == 0037 && \
static_cast<uchar>(secondByte) == static_cast<uchar>(0213) )  d->mimetype = \
                "application/x-gzip";
                     else if ( firstByte == 'B' && secondByte == 'Z' && \
thirdByte == 'h' )  d->mimetype = "application/x-bzip";
Index: kdecore/tests/CMakeLists.txt
===================================================================
--- kdecore/tests/CMakeLists.txt	(wersja 684875)
+++ kdecore/tests/CMakeLists.txt	(kopia robocza)
@@ -95,6 +95,9 @@
 
 ########### module for klibloadertest4 ###############
 
+#temp.
+if (WIN32)
+
 set(klibloadertestmodule4_PART_SRCS klibloadertest4_module.cpp )
 
 kde4_automoc(${klibloadertestmodule4_PART_SRCS})
@@ -104,3 +107,5 @@
 target_link_libraries(klibloadertestmodule4  ${KDE4_KDECORE_LIBS} \
${QT_QTTEST_LIBRARY})  
 set_target_properties(klibloadertestmodule4 PROPERTIES SKIP_BUILD_RPATH \
FALSE BUILD_WITH_INSTALL_RPATH FALSE) +
+endif (WIN32)
Index: kjs/wtf/VectorTraits.h
===================================================================
--- kjs/wtf/VectorTraits.h	(wersja 684875)
+++ kjs/wtf/VectorTraits.h	(kopia robocza)
@@ -49,7 +49,7 @@
     template <typename P> struct IsPod<P *>      { static const bool value \
= true; };  
     template<bool isPod, typename T>
-    class VectorTraitsBase;
+    struct VectorTraitsBase;
 
     template<typename T>
     struct VectorTraitsBase<false, T>
Index: kjs/wtf/Vector.h
===================================================================
--- kjs/wtf/Vector.h	(wersja 684875)
+++ kjs/wtf/Vector.h	(kopia robocza)
@@ -41,7 +41,7 @@
     using std::max;
     
     template <bool needsDestruction, typename T>
-    class VectorDestructor;
+    struct VectorDestructor;
 
     template<typename T>
     struct VectorDestructor<false, T>
@@ -60,7 +60,7 @@
     };
 
     template <bool needsInitialization, bool canInitializeWithMemset, \
                typename T>
-    class VectorInitializer;
+    struct VectorInitializer;
 
     template<bool ignore, typename T>
     struct VectorInitializer<false, ignore, T>
@@ -88,7 +88,7 @@
     };
 
     template <bool canMoveWithMemcpy, typename T>
-    class VectorMover;
+    struct VectorMover;
 
     template<typename T>
     struct VectorMover<false, T>
@@ -132,7 +132,7 @@
     };
 
     template <bool canCopyWithMemcpy, typename T>
-    class VectorCopier;
+    struct VectorCopier;
 
     template<typename T>
     struct VectorCopier<false, T>
@@ -157,7 +157,7 @@
     };
 
     template <bool canFillWithMemset, typename T>
-    class VectorFiller;
+    struct VectorFiller;
 
     template<typename T>
     struct VectorFiller<false, T>
Index: kjs/regexp_object.cpp
===================================================================
--- kjs/regexp_object.cpp	(wersja 684875)
+++ kjs/regexp_object.cpp	(kopia robocza)
@@ -172,8 +172,8 @@
   reg = r;
 
   putDirect("global", jsBoolean(r->flags() & RegExp::Global), DontDelete | \
                ReadOnly | DontEnum);
-  putDirect("ignoreCase", jsBoolean(r->flags() & RegExp::IgnoreCase), \
                DontDelete | ReadOnly | DontEnum);
-  putDirect("multiline",  jsBoolean(r->flags() & RegExp::Multiline),  \
DontDelete | ReadOnly | DontEnum); +  putDirect("ignoreCase", \
jsBoolean((r->flags() & RegExp::IgnoreCase)!=0), DontDelete | ReadOnly | \
DontEnum); +  putDirect("multiline",  jsBoolean((r->flags() & \
RegExp::Multiline)!=0),  DontDelete | ReadOnly | DontEnum);  \
putDirect("source",     jsString (r->pattern()), DontDelete | ReadOnly | \
DontEnum);  putDirect("lastIndex",  jsNumber(0), DontDelete | DontEnum);
 }
@@ -254,7 +254,7 @@
   // The returned array contains 'result' as first item, followed by the \
list of matches  list.append(jsString(result));
   if ( lastOvector )
-    for ( int i = 1 ; i < lastNumSubPatterns + 1 ; ++i )
+    for ( unsigned int i = 1 ; i < lastNumSubPatterns + 1 ; ++i )
     {
       int start = lastOvector[2*i];
       if (start == -1)
@@ -272,7 +272,7 @@
 
 JSValue *RegExpObjectImp::getBackref(int i) const
 {
-  if (lastOvector && i < lastNumSubPatterns + 1) {
+  if (lastOvector && i < int(lastNumSubPatterns + 1)) {
     UString substring = lastInput.substr(lastOvector[2*i], \
lastOvector[2*i+1] - lastOvector[2*i] );  return jsString(substring);
   } 
Index: kjs/internal.h
===================================================================
--- kjs/internal.h	(wersja 684875)
+++ kjs/internal.h	(kopia robocza)
@@ -92,7 +92,7 @@
   //                            Evaluation
   // ---------------------------------------------------------------------------
  
-  class AttachedInterpreter;
+  struct AttachedInterpreter;
   class DebuggerImp {
   public:
 
Index: kjs/debugger.cpp
===================================================================
--- kjs/debugger.cpp	(wersja 684875)
+++ kjs/debugger.cpp	(kopia robocza)
@@ -33,7 +33,6 @@
 namespace KJS {
   struct AttachedInterpreter
   {
-  public:
     AttachedInterpreter(Interpreter *i, AttachedInterpreter *ai) : \
interp(i), next(ai) { ++Debugger::debuggersPresent; }  \
~AttachedInterpreter() { --Debugger::debuggersPresent; }  Interpreter \
*interp; @@ -113,20 +112,20 @@
   return true;
 }
 
-bool Debugger::atStatement(ExecState */*exec*/, int /*sourceId*/, int \
/*firstLine*/, +bool Debugger::atStatement(ExecState * /*exec*/, int \
/*sourceId*/, int /*firstLine*/,  int /*lastLine*/)
 {
   return true;
 }
 
-bool Debugger::callEvent(ExecState */*exec*/, int /*sourceId*/, int \
                /*lineno*/,
-                         JSObject */*function*/, const List &/*args*/)
+bool Debugger::callEvent(ExecState * /*exec*/, int /*sourceId*/, int \
/*lineno*/, +                         JSObject * /*function*/, const List \
&/*args*/)  {
   return true;
 }
 
-bool Debugger::returnEvent(ExecState */*exec*/, int /*sourceId*/, int \
                /*lineno*/,
-                           JSObject */*function*/)
+bool Debugger::returnEvent(ExecState * /*exec*/, int /*sourceId*/, int \
/*lineno*/, +                           JSObject * /*function*/)
 {
   return true;
 }
Index: kjs/function.cpp
===================================================================
--- kjs/function.cpp	(wersja 684875)
+++ kjs/function.cpp	(kopia robocza)
@@ -563,7 +563,7 @@
     int id = _function->body->lookupSymbolID(propertyName);
 
     if (validLocal(id)) {
-      slot.setValueSlot(this, &_locals[id].value, _locals[id].attr & \
ReadOnly); +      slot.setValueSlot(this, &_locals[id].value, \
(_locals[id].attr & ReadOnly) != 0);  return true;
     }
 
Index: kjs/JSImmediate.h
===================================================================
--- kjs/JSImmediate.h	(wersja 684875)
+++ kjs/JSImmediate.h	(kopia robocza)
@@ -108,7 +108,7 @@
             if ((doubleUnion.asBits & TagMask) != 0)
                 return 0;
 
-            return tag(doubleUnion.asBits, NumberType);
+            return tag((uintptr_t)doubleUnion.asBits, NumberType);
         } else {
             // could just return 0 without aborting, but nicer to be \
explicit about not supporting the platform well  abort();
@@ -158,7 +158,7 @@
     static JSValue *nullImmediate() { return tag(zeroAsBits(), \
UndefinedType); }  
 private:
-    static const uintptr_t TagMask = 3; // type tags are 2 bits long
+    static const uintptr_t TagMask;
     
     static JSValue *tag(uintptr_t bits, uintptr_t tag)
     {
Index: kjs/nodes.cpp
===================================================================
--- kjs/nodes.cpp	(wersja 684875)
+++ kjs/nodes.cpp	(kopia robocza)
@@ -2042,7 +2042,7 @@
   KJS_BREAKPOINT;
   ActivationImp* scope = \
static_cast<ActivationImp*>(exec->context()->activationObject());  
-  for (int i = 0; i < initializers.size(); ++i) {
+  for (unsigned int i = 0; i < initializers.size(); ++i) {
     JSValue* val = initializers[i].initExpr->evaluate(exec);
     KJS_CHECKEXCEPTION
     scope->putLocal(initializers[i].localID, val);
@@ -2053,7 +2053,7 @@
 
 void StaticVarStatementNode::recurseVisit(NodeVisitor *visitor)
 {
-  for (int i = 0; i < initializers.size(); ++i) {
+  for (unsigned int i = 0; i < initializers.size(); ++i) {
    Node* oldInitializer = initializers[i].initExpr.get();
    Node* newInitializer = visitor->visit(oldInitializer);
    if (newInitializer)
Index: kjs/property_map.cpp
===================================================================
--- kjs/property_map.cpp	(wersja 684875)
+++ kjs/property_map.cpp	(kopia robocza)
@@ -105,7 +105,7 @@
 // Returns true if the key is not null or the deleted sentinel, false \
otherwise  static inline bool isValid(UString::Rep* key)
 {
-    return reinterpret_cast<uintptr_t>(key) & ~0x1;
+    return (reinterpret_cast<uintptr_t>(key) & ~0x1)!=0;
 }
 
 PropertyMap::~PropertyMap()
@@ -255,7 +255,7 @@
 #if USE_SINGLE_ENTRY
         UString::Rep *key = _singleEntry.key;
         if (rep == key) {
-            readOnly = _singleEntry.attributes & ReadOnly;
+            readOnly = (_singleEntry.attributes & ReadOnly)!=0;
             return &_singleEntry.value;
         }
 #endif
@@ -273,7 +273,7 @@
 #endif
     while (UString::Rep *key = entries[i].key) {
         if (rep == key) {
-            readOnly = entries[i].attributes & ReadOnly;
+            readOnly = (entries[i].attributes & ReadOnly)!=0;
             return &entries[i].value;
         }
         if (k == 0)
Index: kjs/JSImmediate.cpp
===================================================================
--- kjs/JSImmediate.cpp	(wersja 684875)
+++ kjs/JSImmediate.cpp	(kopia robocza)
@@ -24,6 +24,8 @@
 
 namespace KJS {
 
+const uintptr_t JSImmediate::TagMask = 3; // type tags are 2 bits long
+
 JSObject *JSImmediate::toObject(const JSValue *v, ExecState *exec)
 {
     assert(isImmediate(v));
Index: kjs/ustring.cpp
===================================================================
--- kjs/ustring.cpp	(wersja 684875)
+++ kjs/ustring.cpp	(kopia robocza)
@@ -910,7 +910,7 @@
   char *q = statBuffer;
   const UChar *limit = p + length;
   while (p != limit) {
-    *q = p->uc;
+    *q = (char)p->uc;
     ++p;
     ++q;
   }
Index: kjs/date_object.cpp
===================================================================
--- kjs/date_object.cpp	(wersja 684875)
+++ kjs/date_object.cpp	(kopia robocza)
@@ -62,9 +62,11 @@
 #define snprintf _snprintf
 #if !COMPILER(GCC)
 #define isfinite(x) _finite(x)
+#ifndef strncasecmp
 #define strncasecmp(x, y, z) strnicmp(x, y, z)
 #endif
 #endif
+#endif
 
 inline int gmtoffset(const tm& t)
 {
Index: kjs/array_object.cpp
===================================================================
--- kjs/array_object.cpp	(wersja 684875)
+++ kjs/array_object.cpp	(kopia robocza)
@@ -972,7 +972,7 @@
 }
 
 // ECMA 15.6.1
-JSValue *ArrayObjectImp::callAsFunction(ExecState *exec, JSObject \
*/*thisObj*/, const List &args) +JSValue \
*ArrayObjectImp::callAsFunction(ExecState *exec, JSObject * /*thisObj*/, \
const List &args)  {
   // equivalent to 'new Array(....)'
   return construct(exec,args);
Index: kjs/operations.cpp
===================================================================
--- kjs/operations.cpp	(wersja 684875)
+++ kjs/operations.cpp	(kopia robocza)
@@ -47,7 +47,7 @@
 bool isNaN(double d)
 {
 #if HAVE(FUNC_ISNAN)
-    return isnan(d);
+    return isnan(d) != 0;
 #elif HAVE(FLOAT_H)
     return _isnan(d) != 0;
 #else
Index: solid/solid/CMakeLists.txt
===================================================================
--- solid/solid/CMakeLists.txt	(wersja 684875)
+++ solid/solid/CMakeLists.txt	(kopia robocza)
@@ -2,6 +2,10 @@
 add_subdirectory( backends )
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR} \
${CMAKE_CURRENT_BINARY_DIR} )  
+if(WIN32)
+   include_directories( ${KDEWIN32_INCLUDES} )
+endif(WIN32) 
+
 configure_file(solid_export.h.cmake \
${CMAKE_CURRENT_BINARY_DIR}/solid_export.h)  
 ########### next target ###############



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic