Fixes for gcc 10.3.0 (#112)

* Fixes for gcc 10.3.0

* Fixes for gcc 10.3.0

* Removed obsolete declaration

* Changes based on review
This commit is contained in:
uweseimet 2021-06-23 02:03:53 +02:00 committed by GitHub
parent 88f59a6f1e
commit 7e45d11215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 23 deletions

View File

@ -162,7 +162,9 @@ BOOL FASTCALL DiskTrack::Load(const Filepath& path)
if (dt.buffer == NULL) {
#if defined(RASCSI) && !defined(BAREMETAL)
posix_memalign((void **)&dt.buffer, 512, ((length + 511) / 512) * 512);
if (posix_memalign((void **)&dt.buffer, 512, ((length + 511) / 512) * 512)) {
LOGWARN("%s posix_memalign failed", __PRETTY_FUNCTION__);
}
#else
dt.buffer = (BYTE *)malloc(length * sizeof(BYTE));
#endif // RASCSI && !BAREMETAL
@ -177,7 +179,9 @@ BOOL FASTCALL DiskTrack::Load(const Filepath& path)
if (dt.length != (DWORD)length) {
free(dt.buffer);
#if defined(RASCSI) && !defined(BAREMETAL)
posix_memalign((void **)&dt.buffer, 512, ((length + 511) / 512) * 512);
if (posix_memalign((void **)&dt.buffer, 512, ((length + 511) / 512) * 512)) {
LOGWARN("%s posix_memalign failed", __PRETTY_FUNCTION__);
}
#else
dt.buffer = (BYTE *)malloc(length * sizeof(BYTE));
#endif // RASCSI && !BAREMETAL

View File

@ -206,24 +206,6 @@ void FASTCALL Filepath::Split()
free(pBase);
}
//---------------------------------------------------------------------------
//
// パス合成
//
//---------------------------------------------------------------------------
void FASTCALL Filepath::Make()
{
ASSERT(this);
// パス初期化
m_szPath[0] = _T('\0');
// 合成
strncat(m_szPath, m_szDir, ARRAY_SIZE(m_szPath) - strlen(m_szPath));
strncat(m_szPath, m_szFile, ARRAY_SIZE(m_szPath) - strlen(m_szPath));
strncat(m_szPath, m_szExt, ARRAY_SIZE(m_szPath) - strlen(m_szPath));
}
//---------------------------------------------------------------------------
//
// クリアされているか

View File

@ -59,8 +59,6 @@ public:
private:
void FASTCALL Split();
// パス分割
void FASTCALL Make();
// パス合成
void FASTCALL SetCurDir();
// カレントディレクトリ設定
TCHAR m_szPath[_MAX_PATH];

View File

@ -1242,10 +1242,14 @@ int FASTCALL GPIOBUS::PollSelectEvent()
struct gpioevent_data gpev;
if (epoll_wait(epfd, &epev, 1, -1) <= 0) {
LOGWARN("%s epoll_wait failed", __PRETTY_FUNCTION__);
return -1;
}
(void)read(selevreq.fd, &gpev, sizeof(gpev));
if (read(selevreq.fd, &gpev, sizeof(gpev)) < 0) {
LOGWARN("%s read failed", __PRETTY_FUNCTION__);
return -1;
}
#endif // BAREMETAL
return 0;

View File

@ -19,6 +19,7 @@
#include "rascsi_version.h"
#include "spdlog/spdlog.h"
#include <sys/time.h>
#include <climits>
//---------------------------------------------------------------------------
//