1
0
forked from 0ad/0ad
0ad/source/lib
elexis 3028551b91 MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText.
Introduce MOVABLE idiom indicating that a class can use move semantics.
Make values of CGUI struct maps holding XML data const to ensure at the
root that the data is not modified.
Use NONCOPYABLE and MOVABLE for SGUIIcon and SGUIStyle to enforce the
non-copy policy on the compiler level (until someone changes the GUI
design to make modifications needed).

As indicated by that:
  Replace copy operations by in place move operations for these CGUI
struct maps in the CGUI Xeromyces XML loading functions.
  Replace copy operations by const references for CSize and SGUIIcon in
CGUIString::GenerateTextCall and CGUI::GenerateText.
  This avoids copying of non primitive members, such as the strings and
containers of strings.

Further related cleanup to be kept separated for auditability.

Differential Revision: https://code.wildfiregames.com/D2163
Few comments on IRC by: wraitii, Itms
Tested on: gcc 9, Jenkins, partially VS2015

Refs #1984,
  NONCOPYABLE CGUISpriteInstances: 0a7d0ecdde, 8f4f8e240f, c19f3608a5
  NONCOPYABLE Image, Sprite: fb8032043b
  NONCOPYABLE GUI page: 94c57085e9
  NONCOPYABLE GUIManager: 7c2e9027c2
  NONCOPYABLE macro: 16ccae10cd

This was SVN commit r22637.
2019-08-09 17:25:55 +00:00
..
adts Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
allocators Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
external_libraries Update precompiled win32 libogg to 1.3.3 and libvorbis to 1.3.6, building them with VS2015, refs #5379. 2019-06-27 22:36:04 +00:00
file Don't clear pathnames in vfs::GetPathnames so it can be called several times. 2019-05-28 10:18:04 +00:00
pch Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
posix Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
res Remove unused texture test helper function obsolete since dee3cb84b5 and ef888367aa that throws a compiler warning with gcc 7 and beyond. 2019-08-06 21:00:36 +00:00
sysdep Removes clipboard debug logging on X11, fixes #5535 2019-07-25 05:34:04 +00:00
tests Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
tex Fixes some ambiguous calls of abs(). 2019-07-17 22:39:30 +00:00
alignment.h Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
app_hooks.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
app_hooks.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
base32.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
base32.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
bits.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
bits.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
byte_order.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
byte_order.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
code_annotation.h MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText. 2019-08-09 17:25:55 +00:00
code_generation.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
config2.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
config.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
debug_stl.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
debug_stl.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
debug.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
debug.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
fnv_hash.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
fnv_hash.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
frequency_filter.cpp Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
frequency_filter.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
input.cpp Bump year number of files changed this year in the license headers. 2017-05-01 14:28:22 +00:00
input.h Bump year number of files changed this year in the license headers. 2017-05-01 14:28:22 +00:00
lib_api.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
lib.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
lib.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
module_init.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
module_init.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
ogl.cpp Bump year number of files changed this year in the license headers. 2017-05-01 14:28:22 +00:00
ogl.h Bump year number of files changed this year in the license headers. 2017-05-01 14:28:22 +00:00
os_path.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
path.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
path.h Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times. 2019-07-09 00:18:48 +00:00
precompiled.h Update precompiled headers to improve build times. 2019-05-26 07:21:12 +00:00
rand.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
rand.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
regex.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
regex.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
secure_crt.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
secure_crt.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
self_test.h Adds Camera test for ortho projection. 2019-06-05 19:55:37 +00:00
snd.cpp Fix crash at start in snd_detect(), fixes #4786. 2018-02-01 18:12:53 +00:00
snd.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
status.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
status.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
svn_revision.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
svn_revision.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
timer.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
timer.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
types.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
utf8.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
utf8.h Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
wsecure_crt.cpp Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00