summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/audio_driver_jandroid.cpp1
-rw-r--r--platform/android/export/export.cpp4
-rw-r--r--platform/iphone/audio_driver_iphone.cpp6
-rw-r--r--platform/osx/joypad_osx.cpp10
-rw-r--r--platform/windows/os_windows.cpp3
-rw-r--r--platform/x11/context_gl_x11.cpp4
-rw-r--r--platform/x11/os_x11.cpp6
7 files changed, 11 insertions, 23 deletions
diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp
index 763eff2863..ec09fda429 100644
--- a/platform/android/audio_driver_jandroid.cpp
+++ b/platform/android/audio_driver_jandroid.cpp
@@ -80,7 +80,6 @@ Error AudioDriverAndroid::init() {
int mix_rate = GLOBAL_DEF("audio/mix_rate", 44100);
int latency = GLOBAL_DEF("audio/output_latency", 25);
- latency = 50;
unsigned int buffer_size = next_power_of_2(latency * mix_rate / 1000);
if (OS::get_singleton()->is_stdout_verbose()) {
print_line("audio buffer size: " + itos(buffer_size));
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index ee93c29577..ada7df887c 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -3024,7 +3024,7 @@ public:
args.push_back(devices[p_device].id);
args.push_back("reverse");
args.push_back("--remove-all");
- err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
+ OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
int dbg_port = EditorSettings::get_singleton()->get("network/debug/remote_port");
args.clear();
@@ -3034,7 +3034,7 @@ public:
args.push_back("tcp:" + itos(dbg_port));
args.push_back("tcp:" + itos(dbg_port));
- err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
+ OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
print_line("Reverse result: " + itos(rv));
int fs_port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp
index 57b6388016..d8374147c8 100644
--- a/platform/iphone/audio_driver_iphone.cpp
+++ b/platform/iphone/audio_driver_iphone.cpp
@@ -46,10 +46,8 @@ Error AudioDriverIphone::init() {
strdesc.mBytesPerPacket =
strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
- OSStatus result = noErr;
AURenderCallbackStruct callback;
AudioComponentDescription desc;
- AudioComponent comp = NULL;
const AudioUnitElement output_bus = 0;
const AudioUnitElement bus = output_bus;
const AudioUnitScope scope = kAudioUnitScope_Input;
@@ -57,10 +55,10 @@ Error AudioDriverIphone::init() {
zeromem(&desc, sizeof(desc));
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_RemoteIO; /* !!! FIXME: ? */
- comp = AudioComponentFindNext(NULL, &desc);
+ AudioComponent comp = AudioComponentFindNext(NULL, &desc);
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
- result = AudioComponentInstanceNew(comp, &audio_unit);
+ OSStatus result = AudioComponentInstanceNew(comp, &audio_unit);
ERR_FAIL_COND_V(result != noErr, FAILED);
ERR_FAIL_COND_V(comp == NULL, FAILED);
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index 1a4b3a460e..96c660ad1d 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -217,10 +217,9 @@ static void joypad_added_callback(void *ctx, IOReturn res, void *sender, IOHIDDe
}
static bool is_joypad(IOHIDDeviceRef p_device_ref) {
- CFTypeRef refCF = NULL;
int usage_page = 0;
int usage = 0;
- refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDPrimaryUsagePageKey));
+ CFTypeRef refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDPrimaryUsagePageKey));
if (refCF) {
CFNumberGetValue((CFNumberRef)refCF, kCFNumberSInt32Type, &usage_page);
}
@@ -289,13 +288,11 @@ static String _hex_str(uint8_t p_byte) {
bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
- CFTypeRef refCF = NULL;
-
p_joy->device_ref = p_device_ref;
/* get device name */
String name;
char c_name[256];
- refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDProductKey));
+ CFTypeRef refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDProductKey));
if (!refCF) {
refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDManufacturerKey));
}
@@ -334,8 +331,7 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
input->joy_connection_changed(id, true, name, guid);
}
- CFArrayRef array = NULL;
- array = IOHIDDeviceCopyMatchingElements(p_device_ref, NULL, kIOHIDOptionsTypeNone);
+ CFArrayRef array = IOHIDDeviceCopyMatchingElements(p_device_ref, NULL, kIOHIDOptionsTypeNone);
if (array) {
p_joy->add_hid_elements(array);
CFRelease(array);
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 72f6068eb6..2e908b82ab 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -716,8 +716,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} break;
case WM_DROPFILES: {
- HDROP hDropInfo = NULL;
- hDropInfo = (HDROP)wParam;
+ HDROP hDropInfo = (HDROP)wParam;
const int buffsize = 4096;
wchar_t buf[buffsize];
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index f055d730db..563f7db5c3 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -98,11 +98,9 @@ static void set_class_hint(Display *p_display, Window p_window) {
Error ContextGL_X11::initialize() {
- GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
-
//const char *extensions = glXQueryExtensionsString(x11_display, DefaultScreen(x11_display));
- glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte *)"glXCreateContextAttribsARB");
+ GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte *)"glXCreateContextAttribsARB");
ERR_FAIL_COND_V(!glXCreateContextAttribsARB, ERR_UNCONFIGURED);
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index a23f2f1320..8b4253c72c 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -191,8 +191,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
::XIMStyles *xim_styles = NULL;
xim_style = 0L;
- char *imvalret = NULL;
- imvalret = XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL);
+ char *imvalret = XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL);
if (imvalret != NULL || xim_styles == NULL) {
fprintf(stderr, "Input method doesn't support any styles\n");
}
@@ -2140,8 +2139,7 @@ bool OS_X11::is_vsync_enabled() const {
void OS_X11::set_context(int p_context) {
- XClassHint *classHint = NULL;
- classHint = XAllocClassHint();
+ XClassHint *classHint = XAllocClassHint();
if (classHint) {
if (p_context == CONTEXT_EDITOR)