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;
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;
}
}
// Get the first directory entry
- pDirContent = readdir( pCurrDir );
+ pDirContent = (dirent*)readdir( pCurrDir );
// While we still have entries in the directory
while( pDirContent != NULL )
}
}
- pDirContent = readdir( pCurrDir );
+ pDirContent = (dirent*)readdir( pCurrDir );
}
closedir( pCurrDir );
char *gzflags;
gzFile gzf;
- switch( oflags & O_ACCMODE )
+ switch( oflags )
{
case O_WRONLY:
gzflags = "wb";
}
// Get the first directory entry
- pDirContent = readdir( pDir );
+ pDirContent = (dirent*)readdir( pDir );
// While we still have entries in the directory
while( pDirContent != NULL )
&text );
}
- pDirContent = readdir( pDir );
+ pDirContent = (dirent*)readdir( pDir );
}
closedir( pDir );
// 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 );
}
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)
#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,
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)) );
}
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 )
#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
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 )
{
bool Win32Graphics::hit( int x, int y ) const
{
- return PtInRegion( m_mask, x, y );
+ return PtInRegion( m_mask, x, y ) != 0;
}
#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,