mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-10 02:29:33 +00:00
Changes based on review
This commit is contained in:
parent
aa53095ede
commit
07ea0a5e2e
|
@ -162,7 +162,9 @@ BOOL FASTCALL DiskTrack::Load(const Filepath& path)
|
|||
|
||||
if (dt.buffer == NULL) {
|
||||
#if defined(RASCSI) && !defined(BAREMETAL)
|
||||
(void)!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)
|
||||
(void)!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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user