mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
4746a8b3af
* `crypto_memcmp` was replaced by more specific functions. We never want to compare arbitrary amounts of data this way. We use these functions to compare key material. * apidsl has been bothering people, so now we un-bother them. You're welcome. * Added the memlock/unlock functions from the New Group Chats branch. * Remove some system dependencies in crypto_core_mem.c. * Renamed UPPERCASE_NAMES to Snake_Camel_Case names.
47 lines
1.1 KiB
Bash
Executable File
47 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
SOURCE_DIR="$1"
|
|
ASTYLE="$2"
|
|
|
|
# Go to the source root.
|
|
if [ -z "$SOURCE_DIR" ]; then
|
|
SOURCE_DIR=.
|
|
fi
|
|
cd "$SOURCE_DIR"
|
|
|
|
if [ -z "$ASTYLE" ] || ! which "$ASTYLE"; then
|
|
ASTYLE=astyle
|
|
fi
|
|
|
|
if ! which "$ASTYLE"; then
|
|
# If we couldn't find or install an astyle binary, don't do anything.
|
|
echo "Could not find an astyle binary; please install astyle."
|
|
exit 1
|
|
fi
|
|
|
|
readarray -t CC_SOURCES <<<"$(find . '(' -name '*.cc' ')')"
|
|
CC_SOURCES+=(toxcore/crypto_core.c)
|
|
CC_SOURCES+=(toxcore/ping_array.c)
|
|
|
|
for bin in clang-format-6.0 clang-format-5.0 clang-format; do
|
|
if which "$bin"; then
|
|
"$bin" -i -style='{BasedOnStyle: Google, ColumnLimit: 100}' "${CC_SOURCES[@]}"
|
|
break
|
|
fi
|
|
done
|
|
|
|
FIND="find ."
|
|
FIND="$FIND '(' -name '*.[ch]' ')'"
|
|
FIND="$FIND -and -not -name '*.api.h'"
|
|
FIND="$FIND -and -not -wholename './super_donators/*'"
|
|
FIND="$FIND -and -not -wholename './third_party/*'"
|
|
FIND="$FIND -and -not -wholename './toxencryptsave/crypto_pwhash*'"
|
|
|
|
readarray -t C_SOURCES <<<"$(eval "$FIND")"
|
|
|
|
"$ASTYLE" -n --options=other/astyle/astylerc "${C_SOURCES[@]}"
|
|
|
|
git diff --color=always --exit-code
|