Commit Graph

63 Commits (master)

Author SHA1 Message Date
Tushar Maheshwari a661eab867 Automatic fixes using clang-tidy for header files
A follow-up on a previous PR GH-41. The discussion in the forum can be
viewed at http://forum.openclonk.org/topic_show.pl?pid=33086.
Run clang-tidy (without auto, pass-by-value and using checks) to fix the
header files not modified in the previous PR.

Summary of the changes:

 - C++11 member initialization.
 - nullptr instead of 0 for pointers.
 - override for functions declared virtual in base class.
 - default trivial special member functions
2017-05-15 13:46:46 +02:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Lukas Werling abef0da0aa Fix RestartApplication on Linux
(and hopefully don't break it on Windows)
2016-08-11 22:11:15 +02:00
Sven Eberhardt 4869eff787 Allow joining to editor games through startup network dialogue 2016-08-10 19:35:39 -04:00
Lukas Werling b7359e0c27 Remove the GTK platform (USE_GTK)
The GTK code does not work with the Qt editor. The simpler SDL2 platform
does, so we have little reason to keep the GTK code.

Note that GTK is still a dependency for mape.

Discussion: http://forum.openclonk.org/topic_show.pl?tid=3328
2016-08-03 16:25:46 +02:00
Nicolas Hake f963a398aa Define NORETURN annotation for MSVC 2016-04-07 20:52:28 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Günther Brammer 59e5a327b2 gtk: Add support for microsoft windows 2016-02-06 16:47:44 +01:00
Günther Brammer 93f12150c4 CMake: Remove obsolete USE_X11 option and add USE_WIN32_WINDOWS
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
2016-01-23 20:36:34 +01:00
Günther Brammer 77a71c39d3 Require some C++14 support (make_unique, index_sequence) 2015-12-29 15:47:55 +01:00
Nicolas Hake 9f03209ed7 Stop checking for nullptr
We're already requiring the compiler to implement C++11, so checking for
nullptr support again is useless.
2015-10-12 17:34:28 +02:00
Julius Michaelis ee859d85e0 Remove boost any usage of boost libraries 2015-09-30 00:16:12 +02:00
Nicolas Hake 6a11e3e811 Stop checking for rvalue ref support
We already require support for std::unique_ptr, which itself requires
support for rvalue references. As such, we know we can use rvalue
references, and thus don't have to keep carrying dead code around.
2015-09-20 13:27:14 +02:00
Nicolas Hake d1313f622f Drop hack that allowed taking a reference to a temporary value
This has never been legal C++, and the compilers where it was necessary
are no longer supported.
2015-09-20 13:27:13 +02:00
Sven Eberhardt 5f0b96d11b Fix empty controlled statement on undefined BREAKPOINT_HERE. 2015-09-06 22:56:14 -04:00
Sven Eberhardt 535fc79c0f Silence a few compiler warnings. 2015-08-29 08:33:00 -04:00
Nicolas Hake db295b8678 Add emulation of C++14's std::make_unique
Unlike std::make_shared, std::make_unique was unfortunately missing from
C++11. It's a useful utility though.
Technically, declaring a new name in the std namespace is undefined, but
the other way to make make_unique available to all callers regardless of
C++ version, putting it into a distinct utility namespace and importing
the declaration from std if available, makes for more ugly code.
2015-02-25 23:37:04 +01:00
Günther Brammer 8b927d142c win32: Use stdint.h instead of windows-only compiler extensions 2014-04-19 19:02:22 +02:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
Nicolas Hake 15fcd8c51d Add missing <time.h> include 2013-12-01 13:09:39 +01:00
Nicolas Hake 52fd2679cd Fix line endings broken by ecf538c, 7b9c1d5, and ceca8b8 2013-11-29 14:18:48 +01:00
Tobias Zwick 7b9c1d5a9e refactor: consistently use time_t t... variables for times in network system, scheduler, gui
The network used to cast GetTime() to int, but GetTime() is an unsigned long. This might cause problems if GetTime() returns big integers (see #251). To solve this, the StdSchedulerProc interface had to be extended with another function in order to eliminate the magic return value -1 of GetNextTick for "no scheduled execution".
2013-11-29 17:28:04 +07:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 41c88ba863 Use _snwprintf instead of swprintf
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.

src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
2012-12-31 22:03:12 +01:00
Günther Brammer cb74726158 Fix some BSD portability issues
Thanks to mdg on the forum and the Debian buildd.
2012-11-19 17:23:31 +01:00
Günther Brammer 40de33ca3c win32: Make sdl-mainloop option work
As it doesn't have the editor, this is only useful for compiling
more of our code on more platforms.
2012-03-23 22:53:56 +01:00
Günther Brammer b4fd8fcd15 linux: Add O_CLOEXEC to various open calls
This should prevent some file descriptor leakage from forks that
some libraries we use do.
2012-03-05 01:33:02 +01:00
Günther Brammer 8e8e965b8b win32: #define _UNICODE
We apparently do not use any of the C library function this affects, so
this only silences some warnings some versions of some windows headers
produce when only UNICODE is defined.
2012-03-04 19:16:30 +01:00
Nicolas Hake aa8f8b0a43 Silence clang's "conversion to self will not be used" warning
clang defines macros pretending to be GCC 4.2, but it supports
rvalue references so the conversion operator is superfluous
2011-09-28 00:15:59 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Nicolas Hake c62190c693 win32: Define target windows version before including any MinGW header 2011-08-15 00:28:52 +02:00
Armin Burgmeier 81cd645fae Use a wrapper function instead of a #define for swprintf
For some obscure reason the boost headers remove the swprintf #define
2011-07-16 13:53:26 +02:00
Sven Eberhardt 339cceb6d4 MinGW fix for swprintf 2011-07-16 12:56:41 +02:00
Sven Eberhardt 269c7b208c control config dialog 2011-03-30 22:11:47 +02:00
Günther Brammer 2d1ea830ec win32: Do not include windows header from PlatformAbstraction.h 2011-03-13 22:21:16 +01:00
Günther Brammer 05146718c0 Remove RECT structure from platformindependant code 2011-03-13 20:45:30 +01:00
Günther Brammer 6c2a89eaf8 Replace timeGetTime with a platformneutral GetTime wrapper 2011-03-13 17:25:35 +01:00
Günther Brammer 21a8f337d5 win32: avoid winbase.h in PlatformAbstraction.h 2011-03-12 15:29:21 +01:00
Günther Brammer 62bcf4d5c2 win32: move StdStrBuf(const wchar_t*) to StdBuf.cpp to avoid winnls.h 2011-03-12 15:26:35 +01:00
Günther Brammer 8569eaab8c win32: Do not include windows.h from PlatformAbstraction.h
A few windows headers are still included, but not the big offenders
rpcndr.h, wingdi.h and winuser.h. Unfortunately, the latter two need to be
included from StdWindow.h, so still wind up in a lot files, which means
some of the #defines in them need to be undone. To avoid doing that in
multiple places, a few more files include StdWindow.h now.
2011-03-11 03:48:25 +01:00
Günther Brammer 23eedce46a Make RECT use int32_t instead of long 2011-03-12 15:31:37 +01:00
Günther Brammer 040ebfa612 Replace ZeroMemory(p,l) with memset(p,0,l) 2011-03-12 14:59:41 +01:00
Günther Brammer 81d64df737 Do not use Windows' RGB macros for BGR colors 2011-03-11 03:37:27 +01:00
Günther Brammer 6912b118e5 If boost uses static_assert, do not make static_assert use boost 2011-03-11 14:58:58 +01:00
Nicolas Hake 62f840412e Check for static_assert support 2010-05-29 14:44:16 +02:00
Günther Brammer 6d3feabe69 Reduce #includes so that C4Include.h doesn't include C4Value.h
This should avoid many complete rebuilds.
2011-01-08 17:04:20 +01:00
Martin Plicht cc95f8231f Add IsGermanSystem as forward declaration to PlatformAbstraction.h and implement IsGermanSystem, OpenURL and EraseItemSafe in platform-specific files (StdWindow.cpp/StdGtkWindow.cpp etc) 2010-12-27 03:19:19 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00