Skip to content

Commit

Permalink
Attempt to fix MinGW builds
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark committed Jul 13, 2024
1 parent 75b5520 commit a482262
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions include/RemotePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,11 @@ private slots:
void processErrored(QProcess::ProcessError err );
} ;


LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr)
inline std::string QSTR_TO_STDSTR(QString const& qstr)
{
return qstr.toStdString();
}


} // namespace lmms

#endif // LMMS_REMOTE_PLUGIN_H
13 changes: 5 additions & 8 deletions plugins/VstBase/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class RemoteVstPlugin : public RemotePluginClient
void saveChunkToFile( const std::string & _file );

// restore settings chunk of plugin from file
void loadChunkFromFile( const std::string & _file, int _len );
void loadChunkFromFile(const std::string& _file, std::size_t _len);

// restore settings chunk of plugin from file
void loadPresetFile( const std::string & _file );
Expand Down Expand Up @@ -1303,7 +1303,7 @@ void RemoteVstPlugin::saveChunkToFile( const std::string & _file )
"Error opening file for saving chunk.\n" );
return;
}
if ( fwrite( chunk, 1, len, fp ) != len )
if (fwrite(chunk, 1, len, fp) != static_cast<std::size_t>(len))
{
fprintf( stderr,
"Error saving chunk to file.\n" );
Expand Down Expand Up @@ -1541,7 +1541,7 @@ void RemoteVstPlugin::loadPresetFile( const std::string & _file )
unsigned int toUInt;
float * pFloat;

if (m_plugin->uniqueID != pBank->fxID) {
if (static_cast<std::uint_fast32_t>(m_plugin->uniqueID) != pBank->fxID) {
sendMessage( message( IdVstCurrentProgramName ).
addString( "Error: Plugin UniqID not match" ) );
fclose( stream );
Expand Down Expand Up @@ -1577,7 +1577,7 @@ void RemoteVstPlugin::loadPresetFile( const std::string & _file )
else
{
auto toUIntArray = reinterpret_cast<unsigned int*>(chunk);
for (int i = 0; i < pBank->numPrograms; i++ )
for (auto i = 0u; i < pBank->numPrograms; i++)
{
toUInt = endian_swap( toUIntArray[ i ] );
pFloat = ( float* ) &toUInt;
Expand Down Expand Up @@ -1625,10 +1625,7 @@ void RemoteVstPlugin::loadPresetFile( const std::string & _file )
delete[] (char*)chunk;
}




void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len )
void RemoteVstPlugin::loadChunkFromFile(const std::string& _file, std::size_t _len)
{
auto chunk = new char[_len];

Expand Down
2 changes: 1 addition & 1 deletion src/gui/MainApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool MainApplication::winEventFilter(MSG* msg, long* result)
switch(msg->message)
{
case WM_STYLECHANGING:
if(msg->wParam == GWL_EXSTYLE)
if (msg->wParam == static_cast<WPARAM>(GWL_EXSTYLE))
{
// Prevent plugins making the main window transparent
STYLESTRUCT * style = reinterpret_cast<STYLESTRUCT *>(msg->lParam);
Expand Down

0 comments on commit a482262

Please sign in to comment.