src/mess/device.c
| r2059 | r2060 | |
| 361 | 361 | * |
| 362 | 362 | *************************************/ |
| 363 | 363 | |
| 364 | static const struct IODevice *filter_device_array_termination(const struct IODevice *dev) |
| 365 | { |
| 366 | return (dev->type < IO_COUNT) ? dev : NULL; |
| 367 | } |
| 368 | |
| 369 | |
| 370 | |
| 364 | 371 | const struct IODevice *mess_device_first_from_machine(const running_machine *machine) |
| 365 | 372 | { |
| 366 | | return machine->devices; |
| 373 | return filter_device_array_termination(machine->devices); |
| 367 | 374 | } |
| 368 | 375 | |
| 369 | 376 | |
| 370 | 377 | |
| 371 | 378 | const struct IODevice *mess_device_next(const struct IODevice *dev) |
| 372 | 379 | { |
| 373 | | dev++; |
| 374 | | return (dev->type < IO_COUNT) ? dev : NULL; |
| 380 | return filter_device_array_termination(dev + 1); |
| 375 | 381 | } |
| 376 | 382 | |
| 377 | 383 | |