1
0
forked from 0ad/0ad
Commit Graph

60 Commits

Author SHA1 Message Date
0bbb99c3cd move M_PI etc. to wposix.h to ensure they're always present on Windows (previously required MathUtil.h)
use M_PI instead of nonstandard PI

This was SVN commit r7380.
2010-03-20 20:54:03 +00:00
455137afed Fix broken tests
This was SVN commit r7211.
2009-11-24 15:36:08 +00:00
9662666403 more string drudgery
- sprintf, snprintf -> sprintf_s (ensures 0-termination of result)
- use %s instead of %hs with sprintf_s to avoid GCC warnings
- convert h_mgr's to_string to unicode

This was SVN commit r7170.
2009-11-06 10:59:10 +00:00
77d2c67ada misc. string fixes
convert remaining %s to %hs or %ls
use WPRINTF_ARGS on unicode printf functions
fix: __func__ can't be widened via preprocessor (-> revert to char*)
convert remaining external_[directory|file_string to string()
Util: don't mix fwprintf and fprintf
Formation: fix dangling pointer (storing result of c_str())

This was SVN commit r7164.
2009-11-04 15:29:28 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
fcf9db0d53 Decode invalid utf-8 more gracefully (invalid bytes becomes U+FFFD)
This was SVN commit r6999.
2009-07-16 15:52:18 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
cf21949640 Fixed a few issues for Linux build:
- Quick change of _mkdir into mkdir (really, this should be done with a
library function, which Jan is working on).
- Moved CJSComplex::GetScript() implementation into its .h file from its
.inl file to avoid some link errors in release build due to inlining.

This was SVN commit r4994.
2007-04-25 03:10:56 +00:00
8d0a7170f6 # Slightly tidied up string code.
CStr: Indented comments more consistently. Made some parameters
pass-by-reference, made some others not. Removed some useless methods -
Length (use length or empty), GetSubstring (use substr), LCase/UCase
(use LowerCase/UpperCase). Removed operator[] bounds-checking because
VS2005 does that anyway.
Maybe fixed noncopyable warnings on VS2003.

This was SVN commit r4828.
2007-02-01 14:46:14 +00:00
27b6ffe2d6 # housekeeping
sorry, update-workspaces + rebuild is necessary (moved boost/utility
into PCH)

- ps/ : committed additional documentation on behalf of Joe.
- lib/ : HAVE_C99 - replace with specific e.g. HAVE_NPRINTF; intended to
help with MacOSX compat (by no longer requiring us to lie about
STDC_VERSION)
- NO_COPY_CTOR -> boost::noncopyable

This was SVN commit r4825.
2007-02-01 01:34:17 +00:00
a265a441fd # Fixed string handling for Windows/Linux compatibility.
* vsnprintf2: Made compatible between GCC and MSVC - it now always
null-terminates the buffer, and returns -1 on overflow. Fixes #158.
Added tests.
 * MeshManager: Use shared_ptr.expired() instead of checking for
bad_weak_ptr exception.
 * Xeromyces: Added tests for GetXMBPath, because it does unusual things
in sscanf which MSVC's /analyze complains about.
 * ConfigDB, ScriptGlue: Replaced some asserts with return-on-failure,
to avoid invalid array accesses when continuing after the assert (as
complained about by /analyze).
 * CStr: Removed "using namespace std". Added tests for handling of
invalid UTF-8.

This was SVN commit r4625.
2006-11-07 21:03:13 +00:00
c817566222 # housekeeping
replaced all (*) CStr / CStrW by-value params with const reference. hoo
boy.

please always perform this optimization (actually standard idiom) when
writing the code - it takes little work, tells the next guy that the
string won't be modified, and makes a large performance difference.

(* where possible.. a few require other changes and will follow later)

This was SVN commit r4151.
2006-07-20 14:37:58 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
987a6b7d4e fixed wchar_t issues; now correctly separates utf16, CStrW and jschar.
NOTE: wchar_t should be defined as a built-in type; no more need to
define manually or change project settings.

adts: disambiguate iterator type; add operator- as required by VC8
std::equal() implementation
precompiled: squelch stupid warning (that informs us that array members
are now actually default-initialized as called for by C++)
file_cache: remove debug variable

This was SVN commit r3464.
2006-02-03 20:36:15 +00:00
2d477a09cf Profiler: Shift+F11 to save profile data into logs/profile.txt
This was SVN commit r3263.
2005-12-17 02:33:57 +00:00
4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00
b63bc42245 TextureManager: stopped memory leaks
wsdl: create window at expected size, and retrieve correct mouse coords
CStr: not ISerializable (=> not virtual)
Game: less excessive complaining, since the original problem seems to be
fixed
Entity: fixed evaluation order
Others: minor comments/etc

This was SVN commit r2591.
2005-08-09 21:26:40 +00:00
a69ac0dee9 - fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
2005-08-09 15:55:44 +00:00
ec6b78b252 rename assert2 debug_assert; use instead of all plain assert(), since there are no longer any issues (e.g. can't use while handling an exception)
This was SVN commit r2447.
2005-06-28 04:06:25 +00:00
b657a1cbca Added CStr and some other things to precompiled.h, to reduce build times.
Altered CStr/UniDoubler's macros, to avoid polluting/conflicting/etc.
Fixed headers in non-PCH builds.
Used the _d version of vorbisfile*.lib in Debug builds.

This was SVN commit r2366.
2005-06-01 20:12:45 +00:00
bc5122fa08 UTF-8->CStrW conversion; used in saved console history.
This was SVN commit r2272.
2005-05-10 18:15:03 +00:00
8b12c84df7 ScEd: allowed creation of non-entity objects, pending total entitisation
This was SVN commit r2085.
2005-03-30 05:43:22 +00:00
475dfb2c78 Partial support for new actor format. Partialer support for missing actors without crashing.
This was SVN commit r2014.
2005-03-18 22:30:23 +00:00
4720a00f98 Made ScEd output entities into an XML file.
Added CStrW::utf8() (used by XMLWriter).

This was SVN commit r1716.
2005-01-12 14:31:47 +00:00
9e2413acab Allowed \\ in tooltip text. Fixed tooltips.
This was SVN commit r1587.
2004-12-28 13:13:27 +00:00
c3fafdca99 Added CStr::FindInsensitive
This was SVN commit r1479.
2004-12-09 16:54:02 +00:00
a2a6f29ab3 s/Prometheus/Pyrogenesis/
This was SVN commit r1459.
2004-12-05 21:56:09 +00:00
e04df2616b remove redundant size_t >= 0 check to satisfy ICC
This was SVN commit r1351.
2004-11-18 20:52:27 +00:00
5e42dad394 CStr alterations
This was SVN commit r1282.
2004-10-31 20:29:09 +00:00
f791e5f665 Altered the automatic CStr8/CStrW conversion -- it seems to work now
This was SVN commit r1131.
2004-09-06 11:15:43 +00:00
29e0bfea5b Added CStr constructor for non-NULL-terminated char*s
This was SVN commit r1095.
2004-09-01 19:48:51 +00:00
4d9c7684df w00t! first batch of actual network support!
This was SVN commit r1006.
2004-08-16 15:19:17 +00:00
a823a00570 utf16() method for CStr8/W => utf16string conversion
This was SVN commit r904.
2004-08-05 12:15:53 +00:00
e71a29faf0 CStr::UpperCase now returns uppercase, not lowercase
This was SVN commit r849.
2004-07-31 10:59:27 +00:00
d38ed70623 Realised why putting utf16string into std is a silly idea
This was SVN commit r700.
2004-07-11 11:51:27 +00:00
0eecb81bac wchar_t/etc fixes
This was SVN commit r692.
2004-07-10 20:56:15 +00:00
44ad38830c made c_str() const
This was SVN commit r643.
2004-07-07 18:03:42 +00:00
32b6627645 Miscellaneous gcc fixes
This was SVN commit r541.
2004-06-18 18:56:10 +00:00
6eadce8d1d added history, following mark's example :)
This was SVN commit r532.
2004-06-18 13:33:06 +00:00
b09211c4a3 remove *tot - non-portable and inefficient. replaced with stringstream
This was SVN commit r529.
2004-06-18 13:22:26 +00:00
5276a527ae Added the UniDoubler; this means that code can use CStr or CStr8 for 8-bit ascii strings, as well as CStr16 for wchar_t strings (magic! :-P)
This was SVN commit r477.
2004-06-11 02:55:09 +00:00
MarkT
e4fe4ed602 JS Interface to entities. It even partially works now.
This was SVN commit r469.
2004-06-10 22:24:03 +00:00
bf846be6f5 removed obsoleted _int etc. typedefs
This was SVN commit r332.
2004-06-01 16:51:37 +00:00
Gee
1343010185 Some functions made const
This was SVN commit r289.
2004-05-29 03:53:38 +00:00
MarkT
6d5afc10ff Added PASAP entity systems
This was SVN commit r246.
2004-05-21 23:46:16 +00:00
notpete
e1d7bd4173 Added workaround for duplicate CStr in 3DSMAX.
This was SVN commit r230.
2004-05-15 17:48:39 +00:00
12cea7849a c_str() and _long=>size_t
This was SVN commit r169.
2004-03-04 20:27:37 +00:00
91cb7f7138 minor changes (mainly header rename) for lib overhaul
This was SVN commit r157.
2004-03-02 23:54:51 +00:00