From 40f4d805a86afa5600ff361bafd6e4d2f7bfc4b4 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 30 Aug 2017 23:01:12 -0400 Subject: [PATCH 1/3] Fix non-existent include of input_config.h --- input/drivers_hid/libusb_hid.c | 1 - 1 file changed, 1 deletion(-) diff --git a/input/drivers_hid/libusb_hid.c b/input/drivers_hid/libusb_hid.c index 0ebb8a265d..357504e46b 100644 --- a/input/drivers_hid/libusb_hid.c +++ b/input/drivers_hid/libusb_hid.c @@ -26,7 +26,6 @@ #include "../connect/joypad_connection.h" #include "../input_defines.h" #include "../../tasks/tasks_internal.h" -#include "../input_config.h" #include "../input_driver.h" #include "../../verbosity.h" From d993bd3dcfd05428ed1a8b2ee643c2f03c5ad9fb Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 30 Aug 2017 23:10:12 -0400 Subject: [PATCH 2/3] Remove input_config.h include --- input/drivers_keyboard/keyboard_event_apple.h | 1 - 1 file changed, 1 deletion(-) diff --git a/input/drivers_keyboard/keyboard_event_apple.h b/input/drivers_keyboard/keyboard_event_apple.h index 2c6351b07f..fe012efd73 100644 --- a/input/drivers_keyboard/keyboard_event_apple.h +++ b/input/drivers_keyboard/keyboard_event_apple.h @@ -36,7 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include "../input_config.h" #ifndef MAX_KEYS #define MAX_KEYS 256 From fa75f47995f76c9ce5413c5c70e0bdff2a9c6a5e Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 30 Aug 2017 23:14:27 -0400 Subject: [PATCH 3/3] Fix includes of input_config --- gfx/drivers_tracker/video_state_python.c | 14 +++--- input/drivers_hid/iohidmanager_hid.c | 21 ++++----- input/drivers_hid/wiiusb_hid.c | 3 +- input/drivers_keyboard/keyboard_event_apple.c | 3 +- ui/drivers/cocoa/cocoatouch_menu.m | 46 +++++++++---------- 5 files changed, 42 insertions(+), 45 deletions(-) diff --git a/gfx/drivers_tracker/video_state_python.c b/gfx/drivers_tracker/video_state_python.c index 5222b5444a..cf3bac5ff3 100644 --- a/gfx/drivers_tracker/video_state_python.c +++ b/gfx/drivers_tracker/video_state_python.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2017 - Daniel De Matteis - * + * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -32,7 +32,7 @@ #include "../../dynamic.h" #include "../../core.h" #include "../../verbosity.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" static PyObject* py_read_wram(PyObject *self, PyObject *args) { @@ -79,7 +79,7 @@ static PyObject* py_read_vram(PyObject *self, PyObject *args) mem_info.id = RETRO_MEMORY_VIDEO_RAM; core_get_memory(&mem_info); - + data = (const uint8_t*)mem_info.data; (void)self; @@ -112,10 +112,10 @@ static PyObject *py_read_input(PyObject *self, PyObject *args) const struct retro_keybind *py_binds[MAX_USERS]; int16_t res = 0; settings_t *settings = config_get_ptr(); - + for (i = 0; i < MAX_USERS; i++) py_binds[i] = input_config_binds[i]; - + (void)self; if (!PyArg_ParseTuple(args, "II", &user, &key)) @@ -156,7 +156,7 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args) joypad_info.joy_idx = settings->uints.input_joypad_map[user - 1]; joypad_info.auto_binds = input_autoconf_binds[joypad_info.joy_idx]; - res = current_input->input_state(current_input_data, + res = current_input->input_state(current_input_data, joypad_info, py_binds, user - 1, RETRO_DEVICE_ANALOG, index, id); return PyFloat_FromDouble((double)res / 0x7fff); @@ -313,7 +313,7 @@ py_state_t *py_state_new(const char *script, { /* Have to hack around the fact that the FILE struct * isn't standardized across environments. - * PyRun_SimpleFile() breaks on Windows because it's + * PyRun_SimpleFile() breaks on Windows because it's * compiled with MSVC. */ ssize_t len; char *script_ = NULL; diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 2e9de7c5cd..e63f3cf7ad 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2013-2014 - Jason Fetters * Copyright (C) 2011-2017 - Daniel De Matteis - * + * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -23,7 +23,6 @@ #include -#include "../input_config.h" #include "../input_defines.h" #include "../input_driver.h" @@ -120,7 +119,7 @@ static uint64_t iohidmanager_hid_joypad_get_buttons(void *data, unsigned port) static bool iohidmanager_hid_joypad_button(void *data, unsigned port, uint16_t joykey) { - uint64_t buttons = + uint64_t buttons = iohidmanager_hid_joypad_get_buttons(data, port); iohidmanager_hid_t *hid = (iohidmanager_hid_t*)data; unsigned hat_dir = GET_HAT_DIR(joykey); @@ -149,7 +148,7 @@ static bool iohidmanager_hid_joypad_button(void *data, /* Check the button. */ if ((port < MAX_USERS) && (joykey < 32)) - return ((buttons & (1 << joykey)) != 0) + return ((buttons & (1 << joykey)) != 0) || ((hid->buttons[port] & (1 << joykey)) != 0); return false; } @@ -197,7 +196,7 @@ static int16_t iohidmanager_hid_joypad_axis(void *data, static void iohidmanager_hid_device_send_control(void *data, uint8_t* data_buf, size_t size) { - struct iohidmanager_hid_adapter *adapter = + struct iohidmanager_hid_adapter *adapter = (struct iohidmanager_hid_adapter*)data; if (adapter) @@ -210,7 +209,7 @@ static void iohidmanager_hid_device_report(void *data, IOHIDReportType type, uint32_t reportID, uint8_t *report, CFIndex reportLength) { - struct iohidmanager_hid_adapter *adapter = + struct iohidmanager_hid_adapter *adapter = (struct iohidmanager_hid_adapter*)data; iohidmanager_hid_t *hid = (iohidmanager_hid_t*)hid_driver_get_data(); @@ -227,7 +226,7 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result, { iohidmanager_hid_t *hid = (iohidmanager_hid_t*) hid_driver_get_data(); - struct iohidmanager_hid_adapter *adapter = + struct iohidmanager_hid_adapter *adapter = (struct iohidmanager_hid_adapter*)data; IOHIDElementRef element = IOHIDValueGetElement(value); uint32_t type = (uint32_t)IOHIDElementGetType(element); @@ -366,7 +365,7 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result, static void iohidmanager_hid_device_remove(void *data, IOReturn result, void* sender) { - struct iohidmanager_hid_adapter *adapter = + struct iohidmanager_hid_adapter *adapter = (struct iohidmanager_hid_adapter*)data; iohidmanager_hid_t *hid = (iohidmanager_hid_t*) hid_driver_get_data(); @@ -380,7 +379,7 @@ static void iohidmanager_hid_device_remove(void *data, pad_connection_pad_deinit(&hid->slots[adapter->slot], adapter->slot); } - + if (adapter) { apple_input_rec_t* tmp = NULL; @@ -490,7 +489,7 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result, /* Move the device's run loop to this thread. */ IOHIDDeviceScheduleWithRunLoop(device, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); - IOHIDDeviceRegisterRemovalCallback(device, + IOHIDDeviceRegisterRemovalCallback(device, iohidmanager_hid_device_remove, adapter); #ifndef IOS @@ -502,7 +501,7 @@ static void iohidmanager_hid_device_add(void *data, IOReturn result, dev_pid = iohidmanager_hid_device_get_product_id (device); adapter->slot = pad_connection_pad_init(hid->slots, - adapter->name, dev_vid, dev_pid, adapter, + adapter->name, dev_vid, dev_pid, adapter, &iohidmanager_hid_device_send_control); if (adapter->slot == -1) diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index 5bca564886..8c022a12b8 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -19,7 +19,6 @@ #include #include -#include "../input_config.h" #include "../input_defines.h" #include "../input_driver.h" @@ -44,7 +43,7 @@ typedef struct wiiusb_hid /* helps on knowing if a new device has been inserted */ bool device_detected; /* helps on detecting that a device has just been removed */ - bool removal_cb; + bool removal_cb; bool manual_removal; } wiiusb_hid_t; diff --git a/input/drivers_keyboard/keyboard_event_apple.c b/input/drivers_keyboard/keyboard_event_apple.c index 6470adcccf..b7b3115d61 100644 --- a/input/drivers_keyboard/keyboard_event_apple.c +++ b/input/drivers_keyboard/keyboard_event_apple.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2011-2017 - Daniel De Matteis * Copyright (C) 2013-2014 - Jason Fetters - * + * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -21,7 +21,6 @@ #include "../../config.h" #endif -#include "../input_config.h" #include "../input_keymaps.h" #include "../input_driver.h" diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index 40ea236f79..8378ccfc14 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -2,7 +2,7 @@ * Copyright (C) 2013-2014 - Jason Fetters * Copyright (C) 2011-2017 - Daniel De Matteis * Copyright (C) 2014-2015 - Jay McCarthy - * + * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -25,7 +25,7 @@ #include #include "cocoa_common.h" -#include "../../../input/input_config.h" +#include "../../../input/input_driver.h" #include "../../../input/input_keymaps.h" #include "../../../input/drivers/cocoa_input.h" @@ -75,15 +75,15 @@ static void RunActionSheet(const char* title, const struct string_list* items, actionSheet.title = BOXSTRING(title); actionSheet.delegate = delegate; - + for (i = 0; i < items->size; i ++) [actionSheet addButtonWithTitle:BOXSTRING(items->elems[i].data)]; - + actionSheet.cancelButtonIndex = [actionSheet addButtonWithTitle:BOXSTRING("Cancel")]; - + objc_setAssociatedObject(actionSheet, associated_delegate_key, delegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - + [actionSheet showInView:parent]; } @@ -150,10 +150,10 @@ static void RunActionSheet(const char* title, const struct string_list* items, { char label[PATH_MAX_LENGTH]; static NSString* const cell_id = @"boolean_setting"; - + UITableViewCell* result = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:cell_id]; - + if (!result) { result = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 @@ -163,7 +163,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, } menu_entry_get_path(self.i, label, sizeof(label)); - + result.textLabel.text = BOXSTRING(label); [(id)result.accessoryView removeTarget:nil action:NULL @@ -358,12 +358,12 @@ static void RunActionSheet(const char* title, const struct string_list* items, { unsigned i; bool hasDot = false; - + if (partialString.length) for (i = 0; i < partialString.length; i ++) { unichar ch = [partialString characterAtIndex:i]; - + if (i == 0 && (!self.minimum || self.minimum.intValue < 0) && ch == '-') continue; else if (self.allowsFloats && !hasDot && ch == '.') @@ -371,7 +371,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, else if (!isdigit(ch)) return NO; } - + return YES; } @@ -399,7 +399,7 @@ replacementString:(NSString *)string UITableViewCell* result; result = [super cellForTableView: tableView]; - + [self attachDefaultingGestureTo:result]; return result; @@ -417,7 +417,7 @@ replacementString:(NSString *)string menu_entry_get_path(self.i, label, sizeof(label)); desc = BOXSTRING(label); - + alertView = [[UIAlertView alloc] initWithTitle:BOXSTRING("Enter new value") message:desc @@ -467,10 +467,10 @@ replacementString:(NSString *)string { struct string_list* items; RAMenuItemGeneric __weak* weakSelf; - + if (gesture.state != UIGestureRecognizerStateBegan) return; - + weakSelf = self; items = (struct string_list*)string_split("OK", "|"); RunActionSheet("Really Reset Value?", items, self.parentTable, @@ -481,7 +481,7 @@ replacementString:(NSString *)string } [weakSelf.parentTable reloadData]; }); - + string_list_free(items); } @@ -604,7 +604,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; - + [message show]; } @@ -646,7 +646,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIBarButtonItem *item = NULL; settings_t *settings = config_get_ptr(); - + [self reloadData]; self.osdmessage = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 44)]; @@ -680,8 +680,8 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath menu_entries_get_title(title, sizeof(title)); self.title = BOXSTRING(title); - - end = menu_entries_get_end(); + + end = menu_entries_get_end(); menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i); for (; i < end; i++) @@ -695,7 +695,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath [self set_leftbutton:BOXSTRING("Back") target:weakSelf action:@selector(menuBack)]; - + [self set_rightbutton:BOXSTRING("Switch") target:[RetroArch_iOS get] action:@selector(showGameView)]; @@ -777,7 +777,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath #ifdef HAVE_MENU menu_entry_t entry = {{0}}; size_t selection = menu_navigation_get_selection(); - + menu_entry_get(&entry, 0, selection, NULL, false); menu_entry_action(&entry, (unsigned int)selection, MENU_ACTION_CANCEL); #endif