Fixed whitespace

Whitespace inconsistencies reported in https://github.com/libsdl-org/SDL/pull/5673
This commit is contained in:
Sam Lantinga 2022-05-18 06:57:28 -07:00
parent 56665e1d9d
commit aa6ea607d9
3 changed files with 51 additions and 53 deletions

View File

@ -33,22 +33,21 @@ lib=
ndk_args= ndk_args=
# Allow an external caller to specify locations. # Allow an external caller to specify locations.
for arg in $* for arg in $*; do
do if [ "${arg:0:8}" == "NDK_OUT=" ]; then
if [ "${arg:0:8}" == "NDK_OUT=" ]; then obj=${arg#NDK_OUT=}
obj=${arg#NDK_OUT=} elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then lib=${arg#NDK_LIBS_OUT=}
lib=${arg#NDK_LIBS_OUT=} else
else ndk_args="$ndk_args $arg"
ndk_args="$ndk_args $arg" fi
fi
done done
if [ -z $obj ]; then if [ -z $obj ]; then
obj=$buildandroid/obj obj=$buildandroid/obj
fi fi
if [ -z $lib ]; then if [ -z $lib ]; then
lib=$buildandroid/lib lib=$buildandroid/lib
fi fi
for dir in $build $buildandroid $obj $lib; do for dir in $build $buildandroid $obj $lib; do
@ -64,11 +63,11 @@ done
# ndk-build makefile segments that use them, e.g., default-application.mk. # ndk-build makefile segments that use them, e.g., default-application.mk.
# For consistency, pass all values on the command line. # For consistency, pass all values on the command line.
ndk-build \ ndk-build \
NDK_PROJECT_PATH=null \ NDK_PROJECT_PATH=null \
NDK_OUT=$obj \ NDK_OUT=$obj \
NDK_LIBS_OUT=$lib \ NDK_LIBS_OUT=$lib \
APP_BUILD_SCRIPT=Android.mk \ APP_BUILD_SCRIPT=Android.mk \
APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \ APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
APP_PLATFORM=android-16 \ APP_PLATFORM=android-16 \
APP_MODULES="SDL2 SDL2_main" \ APP_MODULES="SDL2 SDL2_main" \
$ndk_args $ndk_args

View File

@ -1,8 +1,7 @@
#!/bin/sh #!/bin/sh
find . -type f -exec grep -Il "Copyright" {} \; \ find . -type f -exec grep -Il "Copyright" {} \; \
| grep -v \.git \ | grep -v \.git \
| while read file; \ | while read file; do \
do \ LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \
LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \
done done

View File

@ -34,44 +34,44 @@
char * char *
SDL_GetBasePath(void) SDL_GetBasePath(void)
{ {
char *retval = NULL; char *retval = NULL;
size_t len; size_t len;
char cwd[FILENAME_MAX]; char cwd[FILENAME_MAX];
getcwd(cwd, sizeof(cwd)); getcwd(cwd, sizeof(cwd));
len = SDL_strlen(cwd) + 2; len = SDL_strlen(cwd) + 2;
retval = (char *) SDL_malloc(len); retval = (char *) SDL_malloc(len);
SDL_snprintf(retval, len, "%s/", cwd); SDL_snprintf(retval, len, "%s/", cwd);
return retval; return retval;
} }
char * char *
SDL_GetPrefPath(const char *org, const char *app) SDL_GetPrefPath(const char *org, const char *app)
{ {
char *retval = NULL; char *retval = NULL;
size_t len; size_t len;
char *base = SDL_GetBasePath(); char *base = SDL_GetBasePath();
if (!app) { if (!app) {
SDL_InvalidParamError("app"); SDL_InvalidParamError("app");
return NULL; return NULL;
} }
if(!org) { if(!org) {
org = ""; org = "";
} }
len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4;
retval = (char *) SDL_malloc(len); retval = (char *) SDL_malloc(len);
if (*org) { if (*org) {
SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); SDL_snprintf(retval, len, "%s%s/%s/", base, org, app);
} else { } else {
SDL_snprintf(retval, len, "%s%s/", base, app); SDL_snprintf(retval, len, "%s%s/", base, app);
} }
free(base); free(base);
mkdir(retval, 0755); mkdir(retval, 0755);
return retval; return retval;
} }
#endif /* SDL_FILESYSTEM_PSP */ #endif /* SDL_FILESYSTEM_PSP */