Commit graph

56 commits

Author SHA1 Message Date
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0
(cherry-picked from commit bc4d22dc72)
2018-10-07 03:23:36 +00:00
Charles Dang
d9fb6c0bf5 Catch all exceptions (where possible) as const references
A few catch blocks modify something in their exceptions, so those are kept non-const.

(cherry-picked from commit 2bf4d68c87)
2018-10-07 03:20:58 +00:00
josteph
0228706f31 Revert "Lexical Cast: remove use of boost::mpl"
This reverts commit 88299f13869a8c32d859ec314356db6cb7e204a6.

(cherry-picked from commit 56e7b01ac4)
2018-10-07 03:19:27 +00:00
josteph
c35ab93ff5 Revert "Fixup c57a175fee701b4d19c09653a5c9445b778d139e"
This reverts commit 9d0c70fb4861cec7a9f46443f1e59c5ace6ada5d.

That commit was wrong.
std::is_same<char, std::remove_const_t<std::remove_pointer_t<From>>>::value
is not equivalent to
boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value
because the former is true not just for 'char*' and 'const char*' but
also for 'char'.

(cherry-picked from commit eacbc5f695)
2018-10-07 03:19:26 +00:00
Charles Dang
1a41e8f7f4 Fixup c57a175fee
Turns out remove_const alone only removes the const from the pointer, not from the type
itself, so the expression wasn't returning true. This strips the pointer out before removing
const and matches against char instead of char*

(cherry-picked from commit a7e1ff85ed)
2018-10-07 03:19:26 +00:00
Charles Dang
16643649ee Lexical Cast: remove use of boost::mpl
The code was checking that the From type was either char* or const char*. Replaced it
with an equality check against char* with the const stripped from From so both match.

(cherry-picked from commit c57a175fee)
2018-10-07 03:19:25 +00:00
Charles Dang
7785d711ed Removed the type trait alias wrappers
This completely removes the wrappers for aliases included in c++14. It also enables
use of the value alias wrappers, since we now have variable templates.

(cherry-picked from commit c1fcba17b7)
2018-10-07 03:17:55 +00:00
Charles Dang
24cc0b01d4 Used constexpr and noexcept keywords directly
We can do this now since were bumping min compiler support.

(cherry-picked from commit 8120843b2e)
2018-10-07 03:17:55 +00:00
Charles Dang
950a156712 Addressed most of the remaining whitespace issues from #2613
[ci skip]
2018-03-11 14:59:37 +11:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Jyrki Vesterinen
0c137c79cf Globally suppress -Wmaybe-uninitialized
We have needed to suppress it in a bunch of places because GCC has kept
giving false positives depending on optimization settings. When I noticed
yet another false positive when I attempted to build the game with PGO
profiling data using CMake, it was the last straw.

Let's just suppress the warning globally and move on with our lives.
2017-10-27 21:28:06 +03:00
Jyrki Vesterinen
d480df850a Fix build with -Og -Werror=maybe-uninitialized on GCC 7.2.0
It's getting tempting to just suppress -Wmaybe-uninitialized globally...
2017-10-20 20:58:30 +03:00
Gregory A Lundberg
78764f8547 Suppress warning about possibly uninitialized by initializing 2017-07-25 12:12:09 -05:00
Gregory A Lundberg
23e972cba8 Correct lexical_cast for long double implicit conversion 2017-07-25 12:12:09 -05:00
Charles Dang
4d17fa12cf Deployed type trait aliases 2017-05-16 02:41:57 +11:00
Charles Dang
b461854f3f Revert 2101353 for lexical_cast header
`#pragma once` isn't a good fit for this file since it's designed to be parsed multiple times if
LEXICAL_CAST_DEBUG is defined. pragma does not allow that once `once` has been encountered once.
2017-05-09 20:55:34 +11:00
Charles Dang
2101353d36 Convert include guards to the shorter #pragma once
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.

For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
2017-05-09 19:41:37 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Jyrki Vesterinen
3dfd421191 Address some cppcheck suggestions
I addressed the suggestions in files which I know well enough to feel
highly comfortable to edit them.

Thanks to @matthiaskrgr for the cppcheck run.
2017-03-18 12:28:41 +02:00
Jyrki Vesterinen
bfeea42938 Reimplement lexical_cast
The new implementation doesn't drop fractional part of floating point
numbers, and handles overflow correctly.
2016-12-08 23:17:42 +02:00
gfgtdf
3e4d10e100 fix lexical_cast<long long> 2016-12-08 15:41:56 +01:00
Charles Dang
10abf90ff3 Implement lexical_cast_default as its own function
As pointed out, it makes slightly more sense to keep it as two functions than one function that could
throw if the second argument were not provided. Another benefit is it allows lexical_cast_default to retain
the default T() fallback in the case where no manual fallback were provided. Whether this is desirable
behavior can be looked at later

This commit also fixes a problem in 87405f8f89 where the fallback value wasn't propagated through certain
specializations that called lexical_cast instead of performing the conversion themselves.
2016-12-08 14:21:15 +11:00
Celtic Minstrel
e6cae2e16e Fix lexical_cast compiler errors on MSVC 2013 2016-12-07 18:49:32 -05:00
Charles Dang
87405f8f89 Added optional second fallback value argument to lexical_cast
This is meant to serve as a replacement for lexical_cast_default.
2016-12-08 01:46:03 +11:00
Charles Dang
7664147cdc lexical_cast: removed some legacy MSVC defines
These functions (or at least strtoll) were implemented in MSVC 2013, the minimum we currently support.
2016-12-07 20:57:42 +11:00
Charles Dang
2eeec1cf7a lexical_cast: made use of noexcept as recommended 2016-12-07 20:20:12 +11:00
Charles Dang
626d6c63cb Made use of the "new" lexical_cast implementation
Note the "old" implementation of lexical_cast_default is still used since the new code doesn't have
the equivalent functionality yet.
2016-12-07 19:23:39 +11:00
Celtic Minstrel
3da8a27ae7 Fix unit tests 2016-11-09 12:52:41 -05:00
Celtic Minstrel
5392e306b9 Misc renaming of types to drop t- prefix 2016-11-09 01:13:17 -05:00
Celtic Minstrel
e6b8681de8 Boost type traits / enable_if -> <type_traits> 2016-07-25 01:31:43 -04:00
Celtic Minstrel
d3cd314f46 Revert "Cleaned up cstdlib includes"
This reverts commit 7b21849487.

The commit was ill-advised in the first place and appears to cause issues
with the XCode build.
2016-06-06 21:08:44 -04:00
Charles Dang
7b21849487 Cleaned up cstdlib includes 2016-06-07 03:12:04 +11:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Ignacio R. Morelle
e6ece8f147 Fix missing strtoll declaration with MinGW-w64 2015-07-21 22:39:58 -03:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Chris Beck
49dc82b5d8 bad_lexical_cast derives from std::exception 2014-05-17 19:19:52 -04:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
fendrin
fa86e2e350 Fix some wrong spelling, mostly in comments. 2013-06-23 17:18:49 +02:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
Steven Panek
ee23d7a632 'honour' -> 'honor' in the source code. 2012-11-21 15:41:43 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Anonymissimus
399e3ecb79 mute MSVC warnings by including global.hpp 2011-11-28 15:52:16 +00:00
Anonymissimus
a8ad747435 fix compilation in MSVC 2011-11-28 15:52:13 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Mark de Wever
a99c78e0d8 Update doxygen comment.
The filename after the @file comment is optional (spotted by alink).
2010-07-26 21:32:18 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
671b0b256c Strip trailing whitespace. 2009-08-29 18:46:38 +00:00
Iurii Chernyi
b1b383f83a fix compilation on FreeBSD by defining a symbol...
...which enables strtoll and strtoull routines
2009-07-02 21:04:23 +00:00