Cleanup add brace (#6545)
* Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line
This commit is contained in:
parent
4958dafdc3
commit
6a2200823c
387 changed files with 6094 additions and 4633 deletions
|
@ -727,7 +727,7 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls,
|
|||
library_file = (*env)->GetStringUTFChars(env, library, NULL);
|
||||
library_handle = dlopen(library_file, RTLD_GLOBAL);
|
||||
|
||||
if (!library_handle) {
|
||||
if (library_handle == NULL) {
|
||||
/* When deploying android app bundle format uncompressed native libs may not extract from apk to filesystem.
|
||||
In this case we should use lib name without path. https://bugzilla.libsdl.org/show_bug.cgi?id=4739 */
|
||||
const char *library_name = SDL_strrchr(library_file, '/');
|
||||
|
@ -770,7 +770,7 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls,
|
|||
}
|
||||
(*env)->DeleteLocalRef(env, string);
|
||||
}
|
||||
if (!arg) {
|
||||
if (arg == NULL) {
|
||||
arg = SDL_strdup("");
|
||||
}
|
||||
argv[argc++] = arg;
|
||||
|
@ -867,8 +867,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
|
|||
{
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
|
||||
if (Android_Window)
|
||||
{
|
||||
if (Android_Window) {
|
||||
Android_SendResize(Android_Window);
|
||||
}
|
||||
|
||||
|
@ -883,8 +882,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)(
|
|||
|
||||
displayOrientation = (SDL_DisplayOrientation)orientation;
|
||||
|
||||
if (Android_Window)
|
||||
{
|
||||
if (Android_Window) {
|
||||
SDL_VideoDisplay *display = SDL_GetDisplay(0);
|
||||
SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation);
|
||||
}
|
||||
|
@ -993,8 +991,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceCreated)(JNIEnv *env, j
|
|||
{
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
|
||||
if (Android_Window)
|
||||
{
|
||||
if (Android_Window) {
|
||||
SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
|
||||
|
||||
data->native_window = Android_JNI_GetNativeWindow();
|
||||
|
@ -1012,8 +1009,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j
|
|||
SDL_LockMutex(Android_ActivityMutex);
|
||||
|
||||
#if SDL_VIDEO_OPENGL_EGL
|
||||
if (Android_Window)
|
||||
{
|
||||
if (Android_Window) {
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
|
||||
|
||||
|
@ -1038,8 +1034,7 @@ retry:
|
|||
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
|
||||
if (Android_Window)
|
||||
{
|
||||
if (Android_Window) {
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
|
||||
|
||||
|
@ -1873,7 +1868,7 @@ size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer,
|
|||
|
||||
if (result > 0) {
|
||||
/* Number of chuncks */
|
||||
return (result / size);
|
||||
return result / size;
|
||||
} else {
|
||||
/* Error or EOF */
|
||||
return result;
|
||||
|
@ -2258,7 +2253,7 @@ void *SDL_AndroidGetActivity(void)
|
|||
/* See SDL_system.h for caveats on using this function. */
|
||||
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
if (!env) {
|
||||
if (env == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2312,7 +2307,7 @@ const char * SDL_AndroidGetInternalStoragePath(void)
|
|||
{
|
||||
static char *s_AndroidInternalFilesPath = NULL;
|
||||
|
||||
if (!s_AndroidInternalFilesPath) {
|
||||
if (s_AndroidInternalFilesPath == NULL) {
|
||||
struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
|
||||
jmethodID mid;
|
||||
jobject context;
|
||||
|
@ -2405,7 +2400,7 @@ const char * SDL_AndroidGetExternalStoragePath(void)
|
|||
{
|
||||
static char *s_AndroidExternalFilesPath = NULL;
|
||||
|
||||
if (!s_AndroidExternalFilesPath) {
|
||||
if (s_AndroidExternalFilesPath == NULL) {
|
||||
struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
|
||||
jmethodID mid;
|
||||
jobject context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue