Skip to content

Commit

Permalink
Merge branch 'master' into enum-classes-2020-04-11
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade authored Apr 14, 2020
2 parents 61f0bbb + ac64d81 commit 97e34b7
Show file tree
Hide file tree
Showing 544 changed files with 14,500 additions and 2,508 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ readability-*,\
-readability-redundant-declaration,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test).*'
HeaderFilterRegex: '(src|test|tools).*'
FormatStyle: none
CheckOptions:
- key: readability-uppercase-literal-suffix.NewSuffixes
Expand Down
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ branches:
# - CMAKE=1
# - SANITIZE=address
# - LOCALIZE=0
# - A clang-tidy run
# - A clang-tidy run (now switched to GitHub workflow)
# - Tests with important mods enabled (Magiclysm, RL_Classes)
# We try to minimize the number of builds subject to those constraints.

Expand Down Expand Up @@ -111,20 +111,12 @@ jobs:
directories:
- $HOME/.ccache

- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1 BREWGETTEXT=1
name: "Xcode 10.1 Make build with Tiles and sound (macOS)"
os: osx
osx_image: xcode10.1
compiler: clang

- env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=plugin
name: "Clang-tidy CMake build with Tiles and Sound"
compiler: clang
addons: &clang8
apt:
packages: ["clang-8", "libclang-8-dev", "llvm-8-dev", "llvm-8-tools", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev", "libpulse-dev", "libpulse0=1:8.0-0ubuntu3.10", "libpulse-mainloop-glib0=1:8.0-0ubuntu3.10"]
sources: [*apt_sources, llvm-toolchain-xenial-8]

# Finally check the compiler variants
- stage: compilers
# GCC 5.4 is default on Xenial
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ ADD_DEFINITIONS(-DCMAKE)

if (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
string(REPLACE "-NOTFOUND" "" GIT_VERSION ${GIT_VERSION})
FILE(WRITE ${CMAKE_SOURCE_DIR}/src/version.h "\#define VERSION \"${GIT_VERSION}\"\n")
FILE(WRITE ${CMAKE_SOURCE_DIR}/src/version.h
"// NOLINT(cata-header-guard)\n\#define VERSION \"${GIT_VERSION}\"\n")
MESSAGE(STATUS "${PROJECT_NAME} build version is : ${GIT_VERSION}\n")
ADD_DEFINITIONS(-DGIT_VERSION)
ELSE (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ ifeq ($(NATIVE), osx)
LDFLAGS += -L$(LIBSDIR)/gettext/lib
CXXFLAGS += -I$(LIBSDIR)/gettext/include
endif
ifeq ($(BREWGETTEXT), 1)
# recent versions of brew will not allow you to link
LDFLAGS += -L/usr/local/opt/gettext/lib
CXXFLAGS += -I/usr/local/opt/gettext/include
endif
ifeq ($(MACPORTS), 1)
ifneq ($(TILES), 1)
CXXFLAGS += -I$(shell ncursesw6-config --includedir)
Expand Down Expand Up @@ -847,7 +852,7 @@ version:
@( VERSION_STRING=$(VERSION) ; \
[ -e ".git" ] && GITVERSION=$$( git describe --tags --always --dirty --match "[0-9A-Z]*.[0-9A-Z]*" ) && VERSION_STRING=$$GITVERSION ; \
[ -e "$(SRC_DIR)/version.h" ] && OLDVERSION=$$(grep VERSION $(SRC_DIR)/version.h|cut -d '"' -f2) ; \
if [ "x$$VERSION_STRING" != "x$$OLDVERSION" ]; then echo "#define VERSION \"$$VERSION_STRING\"" | tee $(SRC_DIR)/version.h ; fi \
if [ "x$$VERSION_STRING" != "x$$OLDVERSION" ]; then printf '// NOLINT(cata-header-guard)\n#define VERSION "%s"\n' "$$VERSION_STRING" | tee $(SRC_DIR)/version.h ; fi \
)

# Unconditionally create the object dir on every invocation.
Expand Down
2 changes: 0 additions & 2 deletions build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ function run_tests
$WINE "$@" -d yes --use-colour yes --rng-seed time $EXTRA_TEST_OPTS | grep -Ev "^0\.0[0-9]{2} s:"
}

date +%s > build-start-time

# We might need binaries installed via pip, so ensure that our personal bin dir is on the PATH
export PATH=$HOME/.local/bin:$PATH

Expand Down
12 changes: 0 additions & 12 deletions build-scripts/clang-tidy-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
#!/bin/bash

# Wrapper script for clang tidy which is a no-op after some time limit to avoid
# hitting the Travis build timeout.

set -eu
set -o pipefail

seconds_since_build_start=$(($(date +%s) - $(cat build-start-time)))
time_limit=$((15*60)) # Stop 15 minutes after build started
printf "%s/%s seconds elapsed\n" "$seconds_since_build_start" "$time_limit"
if [ "$seconds_since_build_start" -gt "$time_limit" ]
then
printf "Skipping clang-tidy %s due to time limit\n" "$*"
exit 0
fi

plugin=build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so

set -x
Expand Down
1 change: 0 additions & 1 deletion build-scripts/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gettext ncurses ccache
brew link --force gettext ncurses
fi

if [[ "$NATIVE" == "android" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion data/json/field_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
"type": "field_type",
"legacy_enum_id": 25,
"intensity_levels": [
{ "name": "faint glimmer", "color": "blue", "sym": "9", "light_emitted": 4 },
{ "name": "faint glimmer", "color": "blue", "sym": "9" },
{ "name": "beam of light", "color": "light_blue" },
{ "name": "intense beam of light", "color": "white" }
],
Expand Down
2 changes: 1 addition & 1 deletion data/json/furniture_and_terrain/terrain-flora.json
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@
"symbol": ".",
"color": "light_green",
"move_cost": 2,
"flags": [ "TRANSPARENT", "DIGGABLE", "FLAT" ],
"flags": [ "TRANSPARENT", "DIGGABLE", "FLAT", "PLOWABLE" ],
"bash": { "sound": "thump", "ter_set": "t_null", "str_min": 40, "str_max": 100, "str_min_supported": 100, "bash_below": true }
},
{
Expand Down
15 changes: 10 additions & 5 deletions data/json/itemgroups/Weapons_Mods_Ammo/guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
{ "item": "sw_500", "prob": 25, "charges-min": 0, "charges-max": 5 },
{ "item": "sw629", "prob": 40, "charges-min": 0, "charges-max": 6 },
{ "item": "usp_45", "prob": 70, "charges-min": 0, "charges-max": 12 },
{ "item": "usp_9mm", "prob": 120, "charges-min": 0, "charges-max": 15 }
{ "item": "usp_9mm", "prob": 120, "charges-min": 0, "charges-max": 15 },
{ "item": "draco", "prob": 30, "charges-min": 0, "charges-max": 30 }
]
},
{
Expand All @@ -116,7 +117,8 @@
{ "item": "sw_500", "prob": 25, "charges-min": 0, "charges-max": 0 },
{ "item": "sw629", "prob": 40, "charges-min": 0, "charges-max": 0 },
{ "item": "usp_45", "prob": 70, "charges-min": 0, "charges-max": 0 },
{ "item": "usp_9mm", "prob": 120, "charges-min": 0, "charges-max": 0 }
{ "item": "usp_9mm", "prob": 120, "charges-min": 0, "charges-max": 0 },
{ "item": "draco", "prob": 30, "charges-min": 0, "charges-max": 0 }
]
},
{
Expand Down Expand Up @@ -273,7 +275,8 @@
{ "item": "ruger_mini", "prob": 60, "charges-min": 0, "charges-max": 5 },
{ "item": "sks", "prob": 40, "charges-min": 0, "charges-max": 10 },
{ "item": "win70", "prob": 15, "charges-min": 0, "charges-max": 3 },
{ "item": "1895sbl", "prob": 15, "charges-min": 0, "charges-max": 7 }
{ "item": "1895sbl", "prob": 15, "charges-min": 0, "charges-max": 7 },
{ "item": "aksemi", "prob": 35, "charges-min": 0, "charges-max": 30 }
]
},
{
Expand All @@ -296,7 +299,8 @@
{ "item": "ruger_mini", "prob": 60, "charges-min": 0, "charges-max": 0 },
{ "item": "sks", "prob": 40, "charges-min": 0, "charges-max": 0 },
{ "item": "win70", "prob": 15, "charges-min": 0, "charges-max": 0 },
{ "item": "1895sbl", "prob": 15, "charges-min": 0, "charges-max": 0 }
{ "item": "1895sbl", "prob": 15, "charges-min": 0, "charges-max": 0 },
{ "item": "aksemi", "prob": 35, "charges-min": 0, "charges-max": 0 }
]
},
{
Expand Down Expand Up @@ -753,7 +757,8 @@
{ "item": "shotgun_s", "prob": 10 },
{ "item": "shotgun_d", "prob": 10, "charges-min": 0, "charges-max": 2 },
{ "item": "sten", "prob": 20, "charges-min": 0, "charges-max": 32 },
{ "item": "sks", "prob": 10, "charges-min": 0, "charges-max": 10 }
{ "item": "sks", "prob": 10, "charges-min": 0, "charges-max": 10 },
{ "item": "aksemi", "prob": 5, "charges-min": 0, "charges-max": 30 }
]
}
]
9 changes: 6 additions & 3 deletions data/json/itemgroups/Weapons_Mods_Ammo/magazines.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@
[ "stanag10", 30 ],
[ "ruger30", 20 ],
[ "stanag30", 10 ],
[ "ar10mag_20rd", 30 ]
[ "ar10mag_20rd", 30 ],
[ "akmag30", 25 ]
]
},
{
Expand All @@ -234,8 +235,10 @@
"id": "mags_rifle_rare",
"//": "Aftermarket or otherwise uncommon rifle magazines excluding milspec.",
"items": [
[ "akmbigmag", 5 ],
[ "akmmag", 25 ],
[ "akmag10", 40 ],
[ "akmag20", 40 ],
[ "akmag40", 40 ],
[ "akdrum75", 30 ],
[ "falmag", 100 ],
[ "falbigmag", 50 ],
[ "g3mag", 80 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/activities_hobbies.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
[ "bolt_cf", 5 ],
[ "bbgun", 10 ],
[ "crossbow", 2 ],
[ "compcrossbow", 2 ],
[ "mag_survival", 40 ],
[ "textbook_survival", 20 ],
[ "modern_tanner", 8 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/collections_domestic.json
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@
[ "throwing_axe", 25 ],
[ "binoculars", 50 ],
[ "crossbow", 20 ],
[ "compcrossbow", 20 ],
[ "rapier", 1 ],
[ "rapier_fake", 10 ],
[ "cavalry_sabre", 1 ],
Expand Down
3 changes: 2 additions & 1 deletion data/json/itemgroups/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@
"id": "archery",
"subtype": "distribution",
"entries": [
{ "item": "crossbow", "prob": 80 },
{ "item": "crossbow", "prob": 70 },
{ "item": "compcrossbow", "prob": 10 },
{ "item": "bullet_crossbow", "prob": 10 },
{ "item": "hand_crossbow", "prob": 10 },
{ "item": "longbow", "prob": 40 },
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/roof.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{ "item": "mre_lemontuna_box", "prob": 5 },
{ "item": "mre_asianbeef_box", "prob": 5 },
{ "item": "ak47", "prob": 20 },
{ "item": "akmmag", "prob": 20 },
{ "item": "akmag30", "prob": 20 },
{ "item": "762_m43", "prob": 20 },
{ "item": "cig", "prob": 10 },
{ "item": "joint_roach", "prob": 20 },
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/book/archery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"weight": "932 g",
"volume": "1250 ml",
"price": 2000,
"price_postapoc": 7500,
"price_postapoc": 500,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand All @@ -24,7 +24,7 @@
"weight": "60 g",
"volume": "250 ml",
"price": 480,
"price_postapoc": 5000,
"price_postapoc": 250,
"material": [ "paper" ],
"symbol": "?",
"color": "pink",
Expand All @@ -42,7 +42,7 @@
"weight": "1454 g",
"volume": "1250 ml",
"price": 1900,
"price_postapoc": 5000,
"price_postapoc": 500,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/book/barter.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"weight": "90 g",
"volume": "250 ml",
"price": 450,
"price_postapoc": 5000,
"price_postapoc": 50,
"material": [ "paper" ],
"symbol": "?",
"color": "pink",
Expand All @@ -24,7 +24,7 @@
"weight": "454 g",
"volume": "750 ml",
"price": 1900,
"price_postapoc": 5000,
"price_postapoc": 250,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand All @@ -43,7 +43,7 @@
"weight": "1587 g",
"volume": "1750 ml",
"price": 9800,
"price_postapoc": 2500,
"price_postapoc": 250,
"bashing": 5,
"material": [ "paper" ],
"symbol": "?",
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/book/bashing.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"weight": "80 g",
"volume": "250 ml",
"price": 450,
"price_postapoc": 2000,
"price_postapoc": 500,
"material": [ "paper" ],
"symbol": "?",
"color": "pink",
Expand All @@ -25,7 +25,7 @@
"weight": "454 g",
"volume": "250 ml",
"price": 2000,
"price_postapoc": 5000,
"price_postapoc": 750,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand Down
12 changes: 6 additions & 6 deletions data/json/items/book/computer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"weight": "1587 g",
"volume": "1500 ml",
"price": 7800,
"price_postapoc": 2500,
"price_postapoc": 500,
"bashing": 6,
"material": [ "paper" ],
"symbol": "?",
Expand All @@ -27,7 +27,7 @@
"weight": "1587 g",
"volume": "1750 ml",
"price": 7900,
"price_postapoc": 5000,
"price_postapoc": 250,
"bashing": 5,
"material": [ "paper" ],
"symbol": "?",
Expand All @@ -47,7 +47,7 @@
"weight": "454 g",
"volume": "750 ml",
"price": 1700,
"price_postapoc": 500,
"price_postapoc": 50,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand All @@ -64,7 +64,7 @@
"weight": "80 g",
"volume": "250 ml",
"price": 450,
"price_postapoc": 5000,
"price_postapoc": 50,
"material": [ "paper" ],
"symbol": "?",
"color": "pink",
Expand All @@ -82,7 +82,7 @@
"weight": "462 g",
"volume": "750 ml",
"price": 5500,
"price_postapoc": 5000,
"price_postapoc": 50,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
Expand All @@ -99,7 +99,7 @@
"weight": "2206 g",
"volume": "1750 ml",
"price": 8500,
"price_postapoc": 10500,
"price_postapoc": 500,
"bashing": 5,
"material": [ "paper" ],
"symbol": "?",
Expand Down
Loading

0 comments on commit 97e34b7

Please sign in to comment.