Fixed bug 4277 - warnings patch Sylvain Patch a few warnings when using: -Wmissing-prototypes -Wdocumentation -Wdocumentation-unknown-command They are automatically enabled with -Wall
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
diff --git a/include/SDL_sensor.h b/include/SDL_sensor.h
index fa19c41..ac163a8 100644
--- a/include/SDL_sensor.h
+++ b/include/SDL_sensor.h
@@ -41,7 +41,7 @@ extern "C" {
#endif
/**
- * \file SDL_sensor.h
+ * \brief SDL_sensor.h
*
* In order to use these functions, SDL_Init() must have been called
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
diff --git a/include/SDL_vulkan.h b/include/SDL_vulkan.h
index 51373b1..972cca4 100644
--- a/include/SDL_vulkan.h
+++ b/include/SDL_vulkan.h
@@ -137,9 +137,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
*
* \param [in] \c NULL or window Window for which the required Vulkan instance
* extensions should be retrieved
- * \param [in,out] count pointer to an \c unsigned related to the number of
+ * \param [in,out] pCount pointer to an \c unsigned related to the number of
* required Vulkan instance extensions
- * \param [out] names \c NULL or a pointer to an array to be filled with the
+ * \param [out] pNames \c NULL or a pointer to an array to be filled with the
* required Vulkan instance extensions
*
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 7f0c126..6a03bdc 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -144,6 +144,10 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)(
JNIEnv* env, jclass cls,
jstring text, jint newCursorPosition);
+JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar)(
+ JNIEnv* env, jclass cls,
+ jchar chUnicode);
+
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText)(
JNIEnv* env, jclass cls,
jstring text, jint newCursorPosition);
@@ -195,6 +199,7 @@ JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveHaptic)(
/* #define DEBUG_JNI */
static void Android_JNI_ThreadDestroyed(void*);
+static void checkJNIReady(void);
/*******************************************************************************
This file links the Java side of Android with libsdl
diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h
index a3a7b19..0f7561b 100644
--- a/src/core/android/SDL_android.h
+++ b/src/core/android/SDL_android.h
@@ -85,8 +85,9 @@ void Android_JNI_HapticStop(int device_id);
void Android_JNI_SuspendScreenSaver(SDL_bool suspend);
/* Touch support */
-int Android_JNI_GetTouchDeviceIds(int **ids);
+int Android_JNI_InitTouch(void);
void Android_JNI_SetSeparateMouseAndTouch(SDL_bool new_value);
+int Android_JNI_GetTouchDeviceIds(int **ids);
/* Threads */
#include <jni.h>
@@ -109,9 +110,15 @@ SDL_bool Android_JNI_SetCustomCursor(int cursorID);
SDL_bool Android_JNI_SetSystemCursor(int cursorID);
/* Relative mouse support */
-SDL_bool Android_JNI_SupportsRelativeMouse();
+SDL_bool Android_JNI_SupportsRelativeMouse(void);
SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled);
+
+SDL_bool SDL_IsAndroidTablet(void);
+SDL_bool SDL_IsAndroidTV(void);
+SDL_bool SDL_IsChromebook(void);
+SDL_bool SDL_IsDeXMode(void);
+
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 1decb2d..4410358 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -22,6 +22,7 @@
#include "SDL_config.h"
#else
#include "../SDL_internal.h"
+#include "SDL_simd.h"
#endif
#if defined(__WIN32__)
diff --git a/src/hidapi/android/hid.cpp b/src/hidapi/android/hid.cpp
index fbe1832..b9d95e9 100644
--- a/src/hidapi/android/hid.cpp
+++ b/src/hidapi/android/hid.cpp
@@ -336,7 +336,7 @@ static jmethodID g_midHIDDeviceManagerSendFeatureReport;
static jmethodID g_midHIDDeviceManagerGetFeatureReport;
static jmethodID g_midHIDDeviceManagerClose;
-uint64_t get_timespec_ms( const struct timespec &ts )
+static uint64_t get_timespec_ms( const struct timespec &ts )
{
return (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
}
@@ -694,6 +694,32 @@ static void ThreadDestroyed(void* value)
}
}
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceRegisterCallback)(JNIEnv *env, jobject thiz, jobject callbackHandler);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceReleaseCallback)(JNIEnv *env, jobject thiz);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceConnected)(JNIEnv *env, jobject thiz, int nDeviceID, jstring sIdentifier, int nVendorId, int nProductId, jstring sSerialNumber, int nReleaseNumber, jstring sManufacturer, jstring sProduct, int nInterface );
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceOpenPending)(JNIEnv *env, jobject thiz, int nDeviceID);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceOpenResult)(JNIEnv *env, jobject thiz, int nDeviceID, bool bOpened);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceDisconnected)(JNIEnv *env, jobject thiz, int nDeviceID);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceInputReport)(JNIEnv *env, jobject thiz, int nDeviceID, jbyteArray value);
+
+extern "C"
+JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceFeatureReport)(JNIEnv *env, jobject thiz, int nDeviceID, jbyteArray value);
+
+
extern "C"
JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceRegisterCallback)(JNIEnv *env, jobject thiz, jobject callbackHandler)
{
diff --git a/src/hidapi/hidapi/hidapi.h b/src/hidapi/hidapi/hidapi.h
index e9a74d5..15d6323 100644
--- a/src/hidapi/hidapi/hidapi.h
+++ b/src/hidapi/hidapi/hidapi.h
@@ -225,7 +225,7 @@ namespace NAMESPACE {
-1 on error. If no packet was available to be read within
the timeout period, this function returns 0.
*/
- int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);
+ int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *device, unsigned char *data, size_t length, int milliseconds);
/** @brief Read an Input report from a HID device.
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 07ced0d..4985b16 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -521,7 +521,8 @@ GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format)
return renderer->info.texture_formats[0];
}
-SDL_ScaleMode SDL_GetScaleMode(void)
+
+static SDL_ScaleMode SDL_GetScaleMode(void)
{
const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c
index 46f94a4..5c7a990 100644
--- a/src/sensor/SDL_sensor.c
+++ b/src/sensor/SDL_sensor.c
@@ -48,7 +48,7 @@ static SDL_bool SDL_updating_sensor = SDL_FALSE;
static SDL_mutex *SDL_sensor_lock = NULL; /* This needs to support recursive locks */
static SDL_atomic_t SDL_next_sensor_instance_id;
-void
+static void
SDL_LockSensors(void)
{
if (SDL_sensor_lock) {
@@ -56,7 +56,7 @@ SDL_LockSensors(void)
}
}
-void
+static void
SDL_UnlockSensors(void)
{
if (SDL_sensor_lock) {
@@ -118,7 +118,7 @@ SDL_SensorID SDL_GetNextSensorInstanceID()
* Get the driver and device index for an API device index
* This should be called while the sensor lock is held, to prevent another thread from updating the list
*/
-SDL_bool
+static SDL_bool
SDL_GetDriverAndSensorIndex(int device_index, SDL_SensorDriver **driver, int *driver_index)
{
int i, num_sensors, total_sensors = 0;
diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c
index 441cd9a..5a7ba9d 100644
--- a/src/video/SDL_blit_N.c
+++ b/src/video/SDL_blit_N.c
@@ -2333,6 +2333,30 @@ BlitNtoNKey(SDL_BlitInfo * info)
/* Set up some basic variables */
ckey &= rgbmask;
+ /* Fastpath: same source/destination format, no Amask, bpp 32, loop is vectorized. ~10x faster */
+ if (srcfmt->format == dstfmt->format &&
+ (srcfmt->format == SDL_PIXELFORMAT_RGB888 || srcfmt->format == SDL_PIXELFORMAT_BGR888)) {
+ Uint32 *src32 = (Uint32*)src;
+ Uint32 *dst32 = (Uint32*)dst;
+ srcskip /= sizeof(Uint32);
+ dstskip /= sizeof(Uint32);
+ while (height--) {
+ /* *INDENT-OFF* */
+ DUFFS_LOOP(
+ {
+ Uint32 Pixel = (*src32 == ckey) ? *dst32 : *src32;
+ *dst32 = Pixel;
+ ++src32;
+ ++dst32;
+ },
+ width);
+ /* *INDENT-ON* */
+ src32 += srcskip;
+ dst32 += dstskip;
+ }
+ return;
+ }
+
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
@@ -2380,6 +2404,33 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info)
dstbpp = dstfmt->BytesPerPixel;
ckey &= rgbmask;
+ /* Fastpath: same source/destination format, with Amask, bpp 32, loop is vectorized. ~10x faster */
+ if (srcfmt->format == dstfmt->format &&
+ (srcfmt->format == SDL_PIXELFORMAT_ARGB8888 ||
+ srcfmt->format == SDL_PIXELFORMAT_ABGR8888 ||
+ srcfmt->format == SDL_PIXELFORMAT_BGRA8888 ||
+ srcfmt->format == SDL_PIXELFORMAT_RGBA8888)) {
+ Uint32 *src32 = (Uint32*)src;
+ Uint32 *dst32 = (Uint32*)dst;
+ srcskip /= sizeof(Uint32);
+ dstskip /= sizeof(Uint32);
+ while (height--) {
+ /* *INDENT-OFF* */
+ DUFFS_LOOP(
+ {
+ Uint32 Pixel = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32;
+ *dst32 = Pixel;
+ ++src32;
+ ++dst32;
+ },
+ width);
+ /* *INDENT-ON* */
+ src32 += srcskip;
+ dst32 += dstskip;
+ }
+ return;
+ }
+
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index c6fd3b5..1b2ee6c 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -37,7 +37,7 @@ SDL_COMPILE_TIME_ASSERT(surface_size_assumptions,
/*
* Calculate the pad-aligned scanline width of a surface
*/
-int
+static int
SDL_CalculatePitch(Uint32 format, int width)
{
int pitch;
diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c
index 7c1e6b4..03b04dc 100644
--- a/src/video/SDL_yuv.c
+++ b/src/video/SDL_yuv.c
@@ -23,6 +23,7 @@
#include "SDL_endian.h"
#include "SDL_video.h"
#include "SDL_pixels_c.h"
+#include "SDL_yuv_c.h"
#include "yuv2rgb/yuv_rgb.h"