]> git.sesse.net Git - vlc/commitdiff
- all: compilation fixes with vc7.1
authorCyril Deguet <asmax@videolan.org>
Mon, 18 Jul 2005 23:57:41 +0000 (23:57 +0000)
committerCyril Deguet <asmax@videolan.org>
Mon, 18 Jul 2005 23:57:41 +0000 (23:57 +0000)
12 files changed:
modules/gui/skins2/controls/ctrl_radialslider.cpp
modules/gui/skins2/src/dialogs.cpp
modules/gui/skins2/src/theme_loader.cpp
modules/gui/skins2/src/theme_repository.cpp
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/utils/bezier.cpp
modules/gui/skins2/utils/var_percent.cpp
modules/gui/skins2/utils/var_percent.hpp
modules/gui/skins2/vars/playlist.cpp
modules/gui/skins2/win32/win32_graphics.cpp
modules/gui/skins2/win32/win32_window.cpp

index effc2368cb6b46581d5f1b112b62690f4f67ec81..740d234121089db2c8bcaef755d9111734016c62 100644 (file)
@@ -151,7 +151,7 @@ void CtrlRadialSlider::setCursor( int posX, int posY, bool blocking )
     int y = posY - pPos->getTop() - m_width / 2;
 
     // Compute the polar coordinates. angle is -(-j,OM)
-    float r = sqrt(x*x + y*y);
+    float r = sqrt((float)(x*x + y*y));
     if( r == 0 )
     {
         return;
index 1c578ea3ba6351a9a580f842f5ca09f5179b3407..a4330e4abd63374dfe437f880d376e66a2acabce 100644 (file)
@@ -99,7 +99,7 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
                         vlc_value_t old_val, vlc_value_t new_val, void *param )
 {
     Dialogs *p_dialogs = (Dialogs *)param;
-    p_dialogs->showPopupMenu( new_val.b_bool );
+    p_dialogs->showPopupMenu( new_val.b_bool != 0 );
 
     return VLC_SUCCESS;
 }
index 96916bec64b456d33c5eaef9bc00d8819de173aa..6e75486fdc7ba5c9a85523a0c3c7be3ae366a757 100644 (file)
@@ -224,7 +224,7 @@ bool ThemeLoader::findThemeFile( const string &rootDir, string &themeFilePath )
     }
 
     // Get the first directory entry
-    pDirContent = readdir( pCurrDir );
+    pDirContent = (dirent*)readdir( pCurrDir );
 
     // While we still have entries in the directory
     while( pDirContent != NULL )
@@ -265,7 +265,7 @@ bool ThemeLoader::findThemeFile( const string &rootDir, string &themeFilePath )
             }
         }
 
-        pDirContent = readdir( pCurrDir );
+        pDirContent = (dirent*)readdir( pCurrDir );
     }
 
     closedir( pCurrDir );
@@ -535,7 +535,7 @@ int gzopen_frontend( char *pathname, int oflags, int mode )
     char *gzflags;
     gzFile gzf;
 
-    switch( oflags & O_ACCMODE )
+    switch( oflags )
     {
         case O_WRONLY:
             gzflags = "wb";
index c63a6261790bf9e7778fe4d26730ffd9205a1d2e..68098c4502e2d776b3b7cdb9a3f694344db984b3 100644 (file)
@@ -114,7 +114,7 @@ void ThemeRepository::parseDirectory( const string &rDir )
     }
 
     // Get the first directory entry
-    pDirContent = readdir( pDir );
+    pDirContent = (dirent*)readdir( pDir );
 
     // While we still have entries in the directory
     while( pDirContent != NULL )
@@ -132,7 +132,7 @@ void ThemeRepository::parseDirectory( const string &rDir )
                         &text );
         }
 
-        pDirContent = readdir( pDir );
+        pDirContent = (dirent*)readdir( pDir );
     }
 
     closedir( pDir );
index 3f973e24ed5be204ddd57a85b5a1dd554d122596..d2c07303e0c5a7f5cac881b8a5802d319dc2296b 100644 (file)
@@ -260,15 +260,15 @@ void VlcProc::manage()
     // Refresh the random variable
     vlc_value_t val;
     var_Get( getIntf()->p_sys->p_playlist, "random", &val );
-    pVarRandom->set( val.b_bool );
+    pVarRandom->set( val.b_bool != 0 );
 
     // Refresh the loop variable
     var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
-    pVarLoop->set( val.b_bool );
+    pVarLoop->set( val.b_bool != 0 );
 
     // Refresh the repeat variable
     var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
-    pVarRepeat->set( val.b_bool );
+    pVarRepeat->set( val.b_bool != 0 );
 }
 
 
index dbd8fa0d66fb6387e7b1a7757a2ecae24e9b2b9e..e8a563671af185b3e2c19ffa9bc3f6e6b1593b67 100644 (file)
@@ -71,7 +71,7 @@ class VlcProc: public SkinObject
         void unregisterVoutWindow( void *pVoutWindow );
 
         /// Indicate whether the embedded video output is currently used
-        bool isVoutUsed() const { return m_pVout; }
+        bool isVoutUsed() const { return m_pVout != NULL; }
 
         /// If an embedded video output is used, drop it (i.e. tell it to stop
         /// using our window handle)
index 7a3f2e9e0569c62a9551c9ce5117c059a041ad8a..5d2b83b0604c04c110fa45320f7ee4491f0a2d88 100644 (file)
 #include "bezier.hpp"
 #include <math.h>
 
+// XXX should be in VLC core
 #ifndef HAVE_LRINTF
-#   define lrintf(a) (int)rint(a)
+#   ifdef HAVE_LRINT
+#       define lrintf( x ) (int)rint( x )
+#   elif defined WIN32
+           __inline long int lrintf( float x )
+           {
+            int i;
+            _asm fld x __asm fistp i
+                   return i;
+       }
+#   endif
 #endif
 
 Bezier::Bezier( intf_thread_t *p_intf, const vector<float> &rAbscissas,
@@ -100,8 +110,8 @@ float Bezier::getNearestPercent( int x, int y ) const
 float Bezier::getMinDist( int x, int y ) const
 {
     int nearest = findNearestPoint( x, y );
-    return sqrt( (m_leftVect[nearest] - x) * (m_leftVect[nearest] - x) +
-                 (m_topVect[nearest] - y) * (m_topVect[nearest] - y) );
+    return sqrt( (double)((m_leftVect[nearest] - x) * (m_leftVect[nearest] - x) +
+                 (m_topVect[nearest] - y) * (m_topVect[nearest] - y)) );
 }
 
 
index 6b52ca7846c1bb4e432b67db9104d1fc67434f54..75ecc2ef370eb21bf7217c1e8d50d8c2c207cd0c 100644 (file)
 const string VarPercent::m_type = "percent";
 
 
-VarPercent::VarPercent( intf_thread_t *pIntf ): Variable( pIntf ), m_value( 0 )
-{
-}
-
-
 void VarPercent::set( float percentage )
 {
     if( percentage < 0 )
index 6fb4a6e0062507c9301a3da312ba96c60d52be57..ef705182e17c79e59693e637030370696b20138a 100644 (file)
 #include "variable.hpp"
 #include "observer.hpp"
 
+class VarPercent;
+
 
 /// Percentage variable
 class VarPercent: public Variable, public Subject<VarPercent>
 {
     public:
-        VarPercent( intf_thread_t *pIntf );
+        VarPercent( intf_thread_t *pIntf ): Variable( pIntf ), m_value( 0 ) {}
         virtual ~VarPercent() {}
 
         /// Get the variable type
index bbefcf54c7d5a3ce2cfa5b2c552a59ba8ec2dde9..d2b47be7d889c4485ce369b7706cda8b27345ec8 100644 (file)
@@ -38,7 +38,10 @@ Playlist::Playlist( intf_thread_t *pIntf ): VarList( pIntf )
     vlc_current_charset( &pCharset );
     iconvHandle = vlc_iconv_open( "UTF-8", pCharset );
     msg_Dbg( pIntf, "Using character encoding: %s", pCharset );
+#ifndef WIN32
+    // vlc_current_charset returns a pointer on a satic char[] on win32
     free( pCharset );
+#endif
 
     if( iconvHandle == (vlc_iconv_t)-1 )
     {
index ac48898a388261325cb520847846e7ee655ee678..455eec2ecc6def7c7fb59748fc35aa0ea99100d9 100644 (file)
@@ -331,7 +331,7 @@ void Win32Graphics::copyToWindow( OSWindow &rWindow, int xSrc, int ySrc,
 
 bool Win32Graphics::hit( int x, int y ) const
 {
-    return PtInRegion( m_mask, x, y );
+    return PtInRegion( m_mask, x, y ) != 0;
 }
 
 
index 556fa37d590394120239f3f00a5847ca2b1efedf..18cb2d74058d9e79bd252fa7ffb65818b187d0fe 100644 (file)
 #endif
 
 
+// XXX layered windows are supposed to work only with at least win2k
+#ifndef WS_EX_LAYERED
+#   define WS_EX_LAYERED 0x00080000
+#endif
+
 Win32Window::Win32Window( intf_thread_t *pIntf, GenericWindow &rWindow,
                           HINSTANCE hInst, HWND hParentWindow,
                           bool dragDrop, bool playOnDrop,