Commit Graph

46 Commits

Author SHA1 Message Date
clang-format c57bbca827 clang-format root 2018-07-23 16:00:14 +02:00
Michael Steenbeek 16f5c92bde Fix copy-paste error 2018-06-20 17:55:34 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Hielke Morsink 6b22a9d38b
Merge pull request #7586 from Broxzier/refactor/banner-ride-index
Banner code cleanups
2018-06-13 21:48:04 +02:00
pkubaj fae367ccf9 Fix compilation with FreeBSD (#7668) 2018-06-12 20:46:34 +01:00
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Michał Janiszewski 2545d01db4 Use libc++-provided strndup on Android 2018-03-21 16:05:00 +01:00
LRFLEW d4cfad8ab2 Fix 'different language linkage' error with Xcode 2018-03-18 23:29:13 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 5c6e28284b Move cstddef out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 54cc1ebcdf Reduce includes in common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 9e1dfffee8 Remove unnecessary checks for __cplusplus 2018-03-14 22:11:30 +01:00
Michał Janiszewski c27307820e Remove more C-only code from common header 2018-03-14 22:11:30 +01:00
Michał Janiszewski 789c176517 Update common header 2018-03-14 22:11:30 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Richard Jenkins 9a10218275 Update official domain 2018-02-05 13:32:53 +01:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Michał Janiszewski 1fdc8ef49e Move definition of OPENRCT2_X86 macro 2018-01-01 23:49:09 +01:00
Hielke Morsink 3770b46e46 Replace 1 and 0 constants with bool where applicable 2017-12-21 23:47:30 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Ethan Smith 76434c0eb6 Reword comment 2017-12-07 22:04:33 +00:00
Ethan Smith 64f2778c10 Refactor MAX_PATH to be in common.h 2017-12-07 22:04:33 +00:00
Ted John 99d7aaa2d6 Remove RCT2 interop 2017-12-04 19:04:06 +00:00
Michał Janiszewski 6943a45b19 Remove limits.h from common.h 2017-11-26 20:36:03 +01:00
Michael Steenbeek ac7652f61d Create define for MONEY16_UNDEFINED 2017-10-18 08:06:16 +02:00
Ted John 4e765a81b1 Tabs to spaces
[ci skip]
2017-10-05 10:42:44 +02:00
Michał Janiszewski 5103113740 Mark Factory variables as maybe_unused 2017-10-05 10:42:38 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
rwjuk 7094bbf74a Fix #5635, overflow when calculating loan interest
Introduces 64-bit money type
2017-06-17 12:20:22 +02:00
Ted John 7e9f7df7d1 Use standard platform defines 2017-06-12 18:01:51 +01:00
Michał Janiszewski 61d38511bc Expand tabs to spaces
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.

Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.

Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +02:00
Ted John 9a619b3e0a Clean up branch 2017-06-05 17:38:14 +01:00
Ted John d65d31f632 Fix test expectations and describe ride types 2017-06-04 00:47:33 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John ee9aa55083 Fix more warnings 2017-05-29 22:38:45 +02:00
Ted John 0ec43e3611 Improve String::Split and add tests 2017-03-08 19:06:42 +00:00
wolfreak99 77c08837f4 Make MSVC use C11's `static_assert` 2017-02-17 23:46:23 +01:00
Ted John e649e7ad4a Move creation of version string to Version.cpp 2017-02-09 17:58:19 +00:00
Broxzier d857ebb2ad Move type definitions before the first include
This way the last remaining uses of int could be replaced with sint32 as
well. Before this change there was a circular dependancy which made the
types unknown in diagnostic.h.
2017-01-14 12:37:32 +01:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00
Renamed from src/common.h (Browse further)