From 0090580a6468995ec66b60b369ded568afd0c3fc Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 11 May 2019 20:59:31 +1000 Subject: [PATCH] [c-host] be compatible with new option ABI --- VERSION | 2 +- c-host/platform/Linux/src/platform.c | 20 +++++++++----------- c-host/platform/Windows/src/platform.c | 8 ++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/VERSION b/VERSION index f0948e10..c2ddd946 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-181-g5b199d8f25+1 \ No newline at end of file +a12-182-g538a6dc08e+1 \ No newline at end of file diff --git a/c-host/platform/Linux/src/platform.c b/c-host/platform/Linux/src/platform.c index 86de7f48..24db6813 100644 --- a/c-host/platform/Linux/src/platform.c +++ b/c-host/platform/Linux/src/platform.c @@ -121,9 +121,9 @@ static int shmOpenDev(const char * shmDevice) return fd; } -static bool shmDeviceValidator(struct OptionValue * value, const char ** error) +static bool shmDeviceValidator(struct Option * opt, const char ** error) { - char * name = uioGetName(value->v.x_string); + char * name = uioGetName(opt->value.x_string); if (!name) { *error = "Failed to get the uio device name"; @@ -174,15 +174,13 @@ int main(int argc, char * argv[]) struct Option options[] = { { - .module = "os", - .name = "shmDevice", - .description = "The IVSHMEM device to use", - .value = { - .type = OPTION_TYPE_STRING, - .v.x_string = "uio0" - }, - .validator = shmDeviceValidator, - .printHelp = shmDevicePrintHelp + .module = "os", + .name = "shmDevice", + .description = "The IVSHMEM device to use", + .type = OPTION_TYPE_STRING, + .value.x_string = "uio0", + .validator = shmDeviceValidator, + .printHelp = shmDevicePrintHelp }, {0} }; diff --git a/c-host/platform/Windows/src/platform.c b/c-host/platform/Windows/src/platform.c index 749b710c..cd7a0d3f 100644 --- a/c-host/platform/Windows/src/platform.c +++ b/c-host/platform/Windows/src/platform.c @@ -119,12 +119,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine .module = "os", .name = "shmDevice", .description = "The IVSHMEM device to use", - .value = { - .type = OPTION_TYPE_INT, - .v.x_int = 0, - }, - .validator = NULL, - .printHelp = NULL + .type = OPTION_TYPE_INT, + .value.x_int = 0 }, {0} };