Commit ab6a48f9 authored by Cyril Deguet's avatar Cyril Deguet

- all: compilation fixes with vc7.1

parent 28c54f7f
......@@ -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;
......
......@@ -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;
}
......
......@@ -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";
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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)
......
......@@ -26,8 +26,18 @@
#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)) );
}
......
......@@ -28,11 +28,6 @@
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 )
......
......@@ -28,12 +28,14 @@
#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
......
......@@ -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 )
{
......
......@@ -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;
}
......
......@@ -38,6 +38,11 @@
#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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment