From 7290803ace237aa32ca210c6ce566133122eeb1f Mon Sep 17 00:00:00 2001 From: Uwe Seimet <48174652+uweseimet@users.noreply.github.com> Date: Wed, 23 Feb 2022 04:07:06 +0100 Subject: [PATCH] Removed untested/unsupported NetBSD-related code (#694) --- src/raspberrypi/devices/cfilesystem.cpp | 12 ----- src/raspberrypi/devices/ctapdriver.cpp | 51 -------------------- src/raspberrypi/devices/ctapdriver.h | 2 - src/raspberrypi/devices/disk.cpp | 1 - src/raspberrypi/devices/disk_track_cache.cpp | 1 - src/raspberrypi/gpiobus.cpp | 2 - src/raspberrypi/os.h | 14 ------ 7 files changed, 83 deletions(-) diff --git a/src/raspberrypi/devices/cfilesystem.cpp b/src/raspberrypi/devices/cfilesystem.cpp index 96adb034..ee4eddd3 100644 --- a/src/raspberrypi/devices/cfilesystem.cpp +++ b/src/raspberrypi/devices/cfilesystem.cpp @@ -6,7 +6,6 @@ // Powered by XM6 TypeG Technology. // Copyright (C) 2016-2020 GIMONS // -// Imported NetBSD support and some optimisation patch by Rin Okuyama. // Imported sava's bugfix patch(in RASDRV DOS edition). // // [ Host File System for the X68000 ] @@ -30,21 +29,11 @@ //--------------------------------------------------------------------------- #define IC_BUF_SIZE 1024 static char convert_buf[IC_BUF_SIZE]; -#ifndef __NetBSD__ -// Using POSIX.1 compliant iconv(3) #define CONVERT(src, dest, inbuf, outbuf, outsize) \ convert(src, dest, (char *)inbuf, outbuf, outsize) static void convert(char const *src, char const *dest, char *inbuf, char *outbuf, size_t outsize) -#else -// Using NetBSD version of iconv(3): The second argument is 'const char **' -#define CONVERT(src, dest, inbuf, outbuf, outsize) \ - convert(src, dest, inbuf, outbuf, outsize) -static void convert(char const *src, char const *dest, - const char *inbuf, char *outbuf, size_t outsize) -#endif { -#ifndef __APPLE__ *outbuf = '\0'; size_t in = strlen(inbuf); size_t out = outsize - 1; @@ -61,7 +50,6 @@ static void convert(char const *src, char const *dest, iconv_close(cd); *outbuf = '\0'; -#endif //ifndef __APPLE__ } //--------------------------------------------------------------------------- diff --git a/src/raspberrypi/devices/ctapdriver.cpp b/src/raspberrypi/devices/ctapdriver.cpp index 0b9de36e..01a540e7 100644 --- a/src/raspberrypi/devices/ctapdriver.cpp +++ b/src/raspberrypi/devices/ctapdriver.cpp @@ -7,8 +7,6 @@ // Copyright (C) 2016-2020 GIMONS // Copyright (C) akuker // -// Imported NetBSD support and some optimisation patches by Rin Okuyama. -// // [ TAP Driver ] // //--------------------------------------------------------------------------- @@ -47,8 +45,6 @@ CTapDriver::CTapDriver() // Initialization // //--------------------------------------------------------------------------- -#ifdef __linux__ - static bool br_setif(int br_socket_fd, const char* bridgename, const char* ifname, bool add) { struct ifreq ifr; ifr.ifr_ifindex = if_nametoindex(ifname); @@ -349,53 +345,6 @@ bool CTapDriver::Init(const map& const_params) return true; } -#endif // __linux__ - -#ifdef __NetBSD__ -bool CTapDriver::Init(const map&) -{ - struct ifreq ifr; - struct ifaddrs *ifa, *a; - - // TAP Device Initialization - if ((m_hTAP = open("/dev/tap", O_RDWR)) < 0) { - LOGERROR("Can't open tap: %s", strerror(errno)); - return false; - } - - // Get device name - if (ioctl(m_hTAP, TAPGIFNAME, (void *)&ifr) < 0) { - LOGERROR("Can't ioctl TAPGIFNAME: %s", strerror(errno)); - close(m_hTAP); - return false; - } - - // Get MAC address - if (getifaddrs(&ifa) == -1) { - LOGERROR("Can't getifaddrs: %s", strerror(errno)); - close(m_hTAP); - return false; - } - for (a = ifa; a != NULL; a = a->ifa_next) - if (strcmp(ifr.ifr_name, a->ifa_name) == 0 && - a->ifa_addr->sa_family == AF_LINK) - break; - if (a == NULL) { - LOGERROR("Can't get MAC address: %s", strerror(errno)); - close(m_hTAP); - return false; - } - - // Save MAC address - memcpy(m_MacAddr, LLADDR((struct sockaddr_dl *)a->ifa_addr), - sizeof(m_MacAddr)); - freeifaddrs(ifa); - - LOGINFO("Tap device: %s\n", ifr.ifr_name); - - return true; -} -#endif // __NetBSD__ void CTapDriver::OpenDump(const Filepath& path) { if (m_pcap == NULL) { diff --git a/src/raspberrypi/devices/ctapdriver.h b/src/raspberrypi/devices/ctapdriver.h index 0d55dc1f..70ff51e3 100644 --- a/src/raspberrypi/devices/ctapdriver.h +++ b/src/raspberrypi/devices/ctapdriver.h @@ -7,8 +7,6 @@ // Copyright (C) 2016-2020 GIMONS // Copyright (C) akuker // -// Imported NetBSD support and some optimisation patch by Rin Okuyama. -// // [ TAP Driver ] // //--------------------------------------------------------------------------- diff --git a/src/raspberrypi/devices/disk.cpp b/src/raspberrypi/devices/disk.cpp index 7bdbc995..b4170a92 100644 --- a/src/raspberrypi/devices/disk.cpp +++ b/src/raspberrypi/devices/disk.cpp @@ -10,7 +10,6 @@ // Copyright (C) 2010 Y.Sugahara // // Imported sava's Anex86/T98Next image and MO format support patch. -// Imported NetBSD support and some optimisation patch by Rin Okuyama. // Comments translated to english by akuker. // //--------------------------------------------------------------------------- diff --git a/src/raspberrypi/devices/disk_track_cache.cpp b/src/raspberrypi/devices/disk_track_cache.cpp index bc4aba37..6a310943 100644 --- a/src/raspberrypi/devices/disk_track_cache.cpp +++ b/src/raspberrypi/devices/disk_track_cache.cpp @@ -10,7 +10,6 @@ // Copyright (C) 2010 Y.Sugahara // // Imported sava's Anex86/T98Next image and MO format support patch. -// Imported NetBSD support and some optimisation patch by Rin Okuyama. // Comments translated to english by akuker. // // [ DiskTrack and DiskCache ] diff --git a/src/raspberrypi/gpiobus.cpp b/src/raspberrypi/gpiobus.cpp index e1797bb0..6d0b155d 100644 --- a/src/raspberrypi/gpiobus.cpp +++ b/src/raspberrypi/gpiobus.cpp @@ -6,8 +6,6 @@ // Powered by XM6 TypeG Technology. // Copyright (C) 2016-2020 GIMONS // -// Imported NetBSD support and some optimisation patch by Rin Okuyama. -// // [ GPIO-SCSI bus ] // //--------------------------------------------------------------------------- diff --git a/src/raspberrypi/os.h b/src/raspberrypi/os.h index 29de7867..3be011fb 100644 --- a/src/raspberrypi/os.h +++ b/src/raspberrypi/os.h @@ -7,8 +7,6 @@ // Copyright (C) 2016-2020 GIMONS // Copyright (C) 2020 akuker // -// Imported NetBSD support and some optimisation patch by Rin Okuyama. -// // [ OS related definitions ] // //--------------------------------------------------------------------------- @@ -58,23 +56,11 @@ #include #include #include -#if defined(__linux__) #include -#endif #include - -#if defined(__linux__) #include #include #include -#elif defined(__NetBSD__) -#include -#include -#include -#include -#include -#include -#endif //--------------------------------------------------------------------------- //