Skip to content

Commit 55a3544

Browse files
authored
Merge pull request #54 from mihaip/upstreaming
Upstream small changes from the Infinite Mac fork
2 parents cfb1999 + a9fd245 commit 55a3544

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

core/bitops.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
2626

2727
#include <cinttypes>
2828

29-
#if defined(__GNUG__) && !defined(__clang__) // GCC, mybe ICC but not Clang
29+
#if defined(__GNUG__) && !defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) // GCC, mybe ICC but not Clang
3030

3131
# include <x86intrin.h>
3232

devices/common/scsi/scsibus.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ void ScsiBus::change_bus_phase(int initiator_id)
6767

6868
void ScsiBus::assert_ctrl_line(int initiator_id, uint16_t mask)
6969
{
70+
DCHECK_F(initiator_id >= 0 && initiator_id < SCSI_MAX_DEVS, "ScsiBus: invalid initiator ID %d", initiator_id);
71+
7072
uint16_t new_state = 0xFFFFU & mask;
7173

7274
this->dev_ctrl_lines[initiator_id] |= new_state;
@@ -84,6 +86,8 @@ void ScsiBus::assert_ctrl_line(int initiator_id, uint16_t mask)
8486

8587
void ScsiBus::release_ctrl_line(int id, uint16_t mask)
8688
{
89+
DCHECK_F(id >= 0 && id < SCSI_MAX_DEVS, "ScsiBus: invalid initiator ID %d", id);
90+
8791
uint16_t new_state = 0;
8892

8993
this->dev_ctrl_lines[id] &= ~mask;

main.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int main(int argc, char** argv) {
140140
machine_str = MachineFactory::machine_name_from_rom(bootrom_path);
141141
if (machine_str.empty()) {
142142
LOG_F(ERROR, "Could not autodetect machine");
143-
return 0;
143+
return 1;
144144
}
145145
else {
146146
LOG_F(INFO, "Machine was autodetected as: %s", machine_str.c_str());
@@ -150,7 +150,7 @@ int main(int argc, char** argv) {
150150
/* handle overriding of machine settings from command line */
151151
map<string, string> settings;
152152
if (MachineFactory::get_machine_settings(machine_str, settings) < 0) {
153-
return 0;
153+
return 1;
154154
}
155155

156156
CLI::App sa;
@@ -168,7 +168,7 @@ int main(int argc, char** argv) {
168168

169169
if (SDL_Init(SDL_INIT_VIDEO)) {
170170
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
171-
return 0;
171+
return 1;
172172
}
173173

174174
// initialize global profiler object
@@ -180,6 +180,9 @@ int main(int argc, char** argv) {
180180

181181
// graceful handling of fatal errors
182182
loguru::set_fatal_handler([](const loguru::Message& message) {
183+
// Make sure the reason for the failure is visible (it may have been
184+
// sent to the logfile only).
185+
cerr << message.preamble << message.indentation << message.prefix << message.message << endl;
183186
enter_debugger();
184187

185188
abort();
@@ -206,7 +209,7 @@ int main(int argc, char** argv) {
206209
break;
207210
default:
208211
LOG_F(ERROR, "Invalid EXECUTION MODE");
209-
return 0;
212+
return 1;
210213
}
211214

212215
bail:

0 commit comments

Comments
 (0)