Fixed whitespace

Whitespace inconsistencies reported in https://github.com/libsdl-org/SDL/pull/5673
main
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=
# Allow an external caller to specify locations.
for arg in $*
do
if [ "${arg:0:8}" == "NDK_OUT=" ]; then
obj=${arg#NDK_OUT=}
elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
lib=${arg#NDK_LIBS_OUT=}
else
ndk_args="$ndk_args $arg"
fi
for arg in $*; do
if [ "${arg:0:8}" == "NDK_OUT=" ]; then
obj=${arg#NDK_OUT=}
elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
lib=${arg#NDK_LIBS_OUT=}
else
ndk_args="$ndk_args $arg"
fi
done
if [ -z $obj ]; then
obj=$buildandroid/obj
obj=$buildandroid/obj
fi
if [ -z $lib ]; then
lib=$buildandroid/lib
lib=$buildandroid/lib
fi
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.
# For consistency, pass all values on the command line.
ndk-build \
NDK_PROJECT_PATH=null \
NDK_OUT=$obj \
NDK_LIBS_OUT=$lib \
APP_BUILD_SCRIPT=Android.mk \
APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
APP_PLATFORM=android-16 \
APP_MODULES="SDL2 SDL2_main" \
$ndk_args
NDK_PROJECT_PATH=null \
NDK_OUT=$obj \
NDK_LIBS_OUT=$lib \
APP_BUILD_SCRIPT=Android.mk \
APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
APP_PLATFORM=android-16 \
APP_MODULES="SDL2 SDL2_main" \
$ndk_args

View File

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

View File

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