]> git.sesse.net Git - vlc/commitdiff
* modules/gui/skins2/*: portability fixes.
authorGildas Bazin <gbazin@videolan.org>
Fri, 27 Feb 2004 13:24:12 +0000 (13:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 27 Feb 2004 13:24:12 +0000 (13:24 +0000)
modules/gui/skins2/controls/ctrl_list.cpp
modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/builder_data.hpp
modules/gui/skins2/parser/xmlparser.hpp
modules/gui/skins2/src/ft2_font.cpp
modules/gui/skins2/src/skin_common.hpp
modules/gui/skins2/vars/playlist.cpp
modules/gui/skins2/win32/win32_factory.hpp
modules/gui/skins2/win32/win32_loop.cpp
modules/gui/skins2/win32/win32_loop.hpp

index 6b0dc72ecf43236665128c3e53f7fdd5395d85bf..568e8fed668dbba6380574b4ece8aa1fe9a42a40 100644 (file)
@@ -2,7 +2,7 @@
  * ctrl_list.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: ctrl_list.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: ctrl_list.cpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -95,6 +95,9 @@ void CtrlList::onUpdate( Subject<VarPercent> &rPercent )
     if( excessItems > 0 )
     {
         // a simple (int)(...) causes rounding errors !
+#ifdef _MSC_VER
+#   define lrint (int)
+#endif
         firstItem = lrint( (1.0 - rVarPos.get()) * (double)excessItems );
     }
     if( m_lastPos != firstItem )
index 4c98d4095b842bdd4e3db470ab2de27f6ce89345..6c08c68314ab6ea9c469132e5fa84be476c62380 100755 (executable)
@@ -2,7 +2,7 @@
  * builder.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: builder.cpp,v 1.5 2004/02/01 16:15:40 asmax Exp $
+ * $Id: builder.cpp,v 1.6 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -542,11 +542,12 @@ const string Builder::generateId() const
 {
     static int i = 1;
 
-    const string base = "_ReservedId_";
-    char genId[base.size() + 4];
-    snprintf( genId, base.size() + 4, "%s%i", base.c_str(), i );
-    i++;
-    return genId;
+    char genId[5];
+    snprintf( genId, 4, "%i", i++ );
+
+    string base = "_ReservedId_" + (string)genId;
+
+    return base;
 }
 
 
index 7052d575b27f0b75de94812390f9a220a322fefc..b0839630d18d97c5cc1e5c98aa61be7b2999a7ba 100644 (file)
@@ -2,7 +2,7 @@
  * builder_data.hpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: builder_data.hpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
+ * $Id: builder_data.hpp,v 1.4 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
 #ifndef BUILDER_DATA_HPP
 #define BUILDER_DATA_HPP
 
-using namespace std;
-
 #include <vlc/vlc.h>
 #include <list>
 #include <string>
 
+using namespace std;
+
 /// Structure for mapping data from XML file
 struct BuilderData
 {
index f64302b7fbca5610bf7d0627368c5b264e568789..cdfd78e252379eae8e6269fe3c156afcedae3209 100644 (file)
@@ -2,7 +2,7 @@
  * xmlparser.hpp
  *****************************************************************************
  * Copyright (C) 2004 VideoLAN
- * $Id: xmlparser.hpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
+ * $Id: xmlparser.hpp,v 1.4 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *
@@ -27,8 +27,6 @@
 #include "../src/skin_common.hpp"
 #include <libxml/xmlreader.h>
 #include <map>
-#include <string>
-
 
 /// XML parser using libxml2 text reader API
 class XMLParser: public SkinObject
@@ -53,8 +51,8 @@ class XMLParser: public SkinObject
         typedef map<const char*, const char*, ltstr> AttrList_t;
 
         /// Callbacks
-        virtual void handleBeginElement( const string &rName, AttrList_t &attr ) {}
-        virtual void handleEndElement( const string &rName ) {}
+        virtual void handleBeginElement( const string &rName, AttrList_t &attr ) {;}
+        virtual void handleEndElement( const string &rName ) {;}
 
     private:
         /// Reader context
index ef968e4e6d6f61b50f6609500836a712518ce68d..ae8ab9ea9c373f77f837029a2d93f9bd7f1abbe3 100644 (file)
@@ -2,7 +2,7 @@
  * ft2_font.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: ft2_font.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: ft2_font.cpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -142,8 +142,8 @@ GenericBitmap *FT2Font::drawString( const UString &rString, uint32_t color,
     int len = rString.length();
 
     // Array of glyph bitmaps and position
-    FT_Glyph glyphs[len];
-    int pos[len];
+    FT_Glyph *glyphs = new FT_Glyph[len];
+    int *pos = new int[len];
 
     // Does the font support kerning ?
     FT_Bool useKerning = FT_HAS_KERNING( m_face );
@@ -254,6 +254,8 @@ GenericBitmap *FT2Font::drawString( const UString &rString, uint32_t color,
         }
     }
 
+    delete [] glyphs;
+    delete [] pos;
+
     return pBmp;
 }
-
index 800c9830d6b0995a2431b1714faaba3a06a7fb66..c4cc7d54b8259194b3847ab525d98e41fd56f795 100644 (file)
@@ -2,7 +2,7 @@
  * skin_common.hpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_common.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
+ * $Id: skin_common.hpp,v 1.3 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -28,6 +28,7 @@
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 
+#include <string>
 using namespace std;
 
 class AsyncQueue;
@@ -40,6 +41,9 @@ class VarManager;
 class VlcProc;
 class Theme;
 
+#ifndef M_PI
+#   define M_PI 3.14159265358979323846
+#endif
 
 // Useful macros
 #define SKINS_DELETE( p ) \
index d61359252daf9a37bc323ec01ae9976a05506f2b..68aa3b95e52bd5d54059740d251b37f2872be42b 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: playlist.cpp,v 1.6 2004/01/05 22:17:32 asmax Exp $
+ * $Id: playlist.cpp,v 1.7 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *
@@ -50,7 +50,7 @@ Playlist::Playlist( intf_thread_t *pIntf ): VarList( pIntf )
         msg_Warn( pIntf, "Unable to do requested conversion" );
     }
 #else
-    msg_Dbg( p_dec, "No iconv support available" );
+    msg_Dbg( pIntf, "No iconv support available" );
 #endif
 
     buildList();
index 4e74f6efad965b66b3f9dbb166c799437802967f..573e285a3eff87049df27fbf32635feb0a43a3aa 100644 (file)
@@ -2,7 +2,7 @@
  * win32_factory.hpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_factory.hpp,v 1.2 2004/01/27 17:01:51 gbazin Exp $
+ * $Id: win32_factory.hpp,v 1.3 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -25,6 +25,8 @@
 #ifndef WIN32_FACTORY_HPP
 #define WIN32_FACTORY_HPP
 
+#define _WIN32_WINNT 0x0500
+
 #include <windows.h>
 #include "../src/os_factory.hpp"
 #include <map>
index f5ae6159956bd700ce9dd656a682dd9530917dcd..0e725647d319939e8cbbdb713a447274260f73f8 100755 (executable)
@@ -2,7 +2,7 @@
  * win32_loop.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_loop.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
+ * $Id: win32_loop.cpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -24,8 +24,8 @@
 
 #ifdef WIN32_SKINS
 
-#include "win32_loop.hpp"
 #include "win32_factory.hpp"
+#include "win32_loop.hpp"
 #include "../src/generic_window.hpp"
 #include "../events/evt_key.hpp"
 #include "../events/evt_leave.hpp"
index 5ac66fb55ec054480f62c48441b626633e3e7d02..25ab61b05d57ddacb826d3db119bb496ed277b4c 100644 (file)
@@ -2,7 +2,7 @@
  * win32_loop.hpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_loop.hpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
+ * $Id: win32_loop.hpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -27,7 +27,6 @@
 
 #include "../events/evt_mouse.hpp"
 #include "../src/os_loop.hpp"
-#include <windows.h>
 #include <map>