Skip to content

Commit

Permalink
Fix includes of input_config
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Aug 31, 2017
1 parent d993bd3 commit fa75f47
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 45 deletions.
14 changes: 7 additions & 7 deletions gfx/drivers_tracker/video_state_python.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
21 changes: 10 additions & 11 deletions input/drivers_hid/iohidmanager_hid.c
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,7 +23,6 @@

#include <retro_miscellaneous.h>

#include "../input_config.h"
#include "../input_defines.h"
#include "../input_driver.h"

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand All @@ -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();

Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions input/drivers_hid/wiiusb_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <gccore.h>
#include <rthreads/rthreads.h>

#include "../input_config.h"
#include "../input_defines.h"
#include "../input_driver.h"

Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions input/drivers_keyboard/keyboard_event_apple.c
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,7 +21,6 @@
#include "../../config.h"
#endif

#include "../input_config.h"
#include "../input_keymaps.h"
#include "../input_driver.h"

Expand Down
46 changes: 23 additions & 23 deletions ui/drivers/cocoa/cocoatouch_menu.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -25,7 +25,7 @@
#include <queues/task_queue.h>

#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"

Expand Down Expand Up @@ -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];
}

Expand Down Expand Up @@ -150,10 +150,10 @@ - (UITableViewCell*)cellForTableView:(UITableView*)tableView
{
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
Expand All @@ -163,7 +163,7 @@ - (UITableViewCell*)cellForTableView:(UITableView*)tableView
}

menu_entry_get_path(self.i, label, sizeof(label));

result.textLabel.text = BOXSTRING(label);
[(id)result.accessoryView removeTarget:nil
action:NULL
Expand Down Expand Up @@ -358,20 +358,20 @@ - (BOOL)isPartialStringValid:(NSString*)partialString
{
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 == '.')
hasDot = true;
else if (!isdigit(ch))
return NO;
}

return YES;
}

Expand Down Expand Up @@ -399,7 +399,7 @@ - (UITableViewCell*)cellForTableView:(UITableView*)tableView
UITableViewCell* result;

result = [super cellForTableView: tableView];

[self attachDefaultingGestureTo:result];

return result;
Expand All @@ -417,7 +417,7 @@ - (void)wasSelectedOnTableView:(UITableView*)tableView
menu_entry_get_path(self.i, label, sizeof(label));

desc = BOXSTRING(label);

alertView =
[[UIAlertView alloc] initWithTitle:BOXSTRING("Enter new value")
message:desc
Expand Down Expand Up @@ -467,10 +467,10 @@ - (void)resetValue:(UIGestureRecognizer*)gesture
{
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,
Expand All @@ -481,7 +481,7 @@ - (void)resetValue:(UIGestureRecognizer*)gesture
}
[weakSelf.parentTable reloadData];
});

string_list_free(items);
}

Expand Down Expand Up @@ -604,7 +604,7 @@ -(void)renderMessageBox:(NSString *)msg
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];

[message show];
}

Expand Down Expand Up @@ -646,7 +646,7 @@ - (void)viewWillAppear:(BOOL)animated
{
UIBarButtonItem *item = NULL;
settings_t *settings = config_get_ptr();

[self reloadData];

self.osdmessage = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 44)];
Expand Down Expand Up @@ -680,8 +680,8 @@ - (void)willReloadData

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++)
Expand All @@ -695,7 +695,7 @@ - (void)willReloadData
[self set_leftbutton:BOXSTRING("Back")
target:weakSelf
action:@selector(menuBack)];

[self set_rightbutton:BOXSTRING("Switch")
target:[RetroArch_iOS get]
action:@selector(showGameView)];
Expand Down Expand Up @@ -777,7 +777,7 @@ - (void)menuBack
#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
Expand Down

0 comments on commit fa75f47

Please sign in to comment.