1
0
forked from 0ad/0ad
Commit Graph

75 Commits

Author SHA1 Message Date
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
002e3f5606 minor fixes from work; also add sys_WideFromArgv
This was SVN commit r8856.
2011-01-04 19:53:38 +00:00
c2fd939898 license change to the more permissible Expat/MIT license for lib/ (see forum thread)
This was SVN commit r7316.
2010-02-08 16:23:39 +00:00
378bd89c1d Annotate some more printf-style functions, for type checking
This was SVN commit r7176.
2009-11-06 23:06:50 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
214b0e6683 Removed outdated licensing information
This was SVN commit r6831.
2009-04-18 17:17:34 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
9269be9ee3 remove mmgr and macros that redefine malloc/new/free
(see http://www.wildfiregames.com/forum/index.php?showtopic=11450&hl= )

clean up debug module
. no longer include platform-dependent header (-> less rebuilds)
. DISPLAY_ERROR -> DEBUG_DISPLAY_ERROR
. parts of config.h that don't affect all files moved to config.2 (->
fewer full rebuilds)
. remove creaky symbol cache (no longer needed for mmgr)
. remove TLS thread naming stuff (can use debugger's thread window
instead; no need for platform independence there)

wdbg: remove thread suspension and breakpoint APIs (not needed)

acpi: fix: u64 -> uintptr_t

wutil: fix WinScopedLock, use that instead of direct lock() functions

misc:
. get rid of SAFE_STRCPY, replace with strcpy_s
. remove _getcwd (shouldn't be used)

This was SVN commit r5563.
2008-01-19 11:33:11 +00:00
9cea581f43 config: add means of enabling/disabling wsdl (and cautionary note about SDL on windows)
wsdl: fix mouse trouble related to shutdown, use wmi instead of ddraw,
disable low-level kbd hook (not needed), cleanup

This was SVN commit r5533.
2007-12-29 16:45:22 +00:00
2e5d9452aa part2: misc source/lib fixes/improvements
move all except user-specified config choices out of config.h and into
appropriate headers
CPU_IA32 -> ARCH_IA32
wsdl: disable use of ddraw (will soon be replaced by WMI)

use shared_ptr without namespace qualifier (it's in tr1)
debug_warn -> debug_assert(0)
LIB_API to allow building as DLL
smart pointers: reduce use of .get()
cache_adt: use map instead of hash_map (avoids needing a hashCompare
class). also remove spurious warning
code_annotation.h: better cassert implementation
move FPS measuring portion of timer.cpp into frequency_filter
move include of memory headers into mmgr.h (to avoid errors, we must
ensure they are included if mmgr is used)
posix_filesystem.h: move definition of mkdir to wfilesystem
stl: disable iterator checks in release mode
wmi: fix COM init bug, use smart pointers
wutil: add code to get DLL module handle (if compiled as such), add
WinScopedLock
timer: fix handling of raw ticks

This was SVN commit r5517.
2007-12-20 20:09:19 +00:00
084ba8fcb0 cache_adt.h: add peek() routine, move CacheEntry to global scope.
config: add read-only cache option
debug: fix error code
input: remove dependency on file header
lockfree: add LF_ReferenceCounter

This was SVN commit r5448.
2007-11-10 17:47:25 +00:00
7a5655edde # major refactoring of system-dependent code (simplifies build system)
cpu.cpp: avoided the need for wrapper functions by calling the
OS-specific function directly (declared in central header, implemented
in the platform's cpp file)

avoid the need for init in cpu and ia32 via if(!init) Init() pattern.

optimized memcpy now requires SSE support

remove error-prone CAS macro; replace with cpu_CAS
config: no longer require inline asm for float->int conversions
lib_error: remove special-case in CHECK_ERR for windows (no longer
needed)

This was SVN commit r5365.
2007-09-23 15:36:29 +00:00
4d94b4f4aa config: make HAVE_MKDIR 0 on vc7 (fixes autobuilder problem)
wsnd: fix typo

This was SVN commit r5091.
2007-05-26 15:45:34 +00:00
bd42f083e0 minor cleanup+fixes+additions
bits: add a few 64-bit variants
config: add OS_WIN64
snd_mgr: make error identifiers unique; cleanup
win: enable service definitions
werrno: fix error number defines to match what winsock wants
wtime_internal: slight fix, use struct tag name instead of typedef
wutil: export LibError_from_GLE

This was SVN commit r5084.
2007-05-21 19:22:55 +00:00
7d4af5979b Fixes for the Mac.
# The engine now builds and runs on Mac OS X.

Most changes were localized to the sysdep/ folder and the build system.
This
is what porting should be like! Hopefully nothing breaks on the other
platforms though ;-)

This was SVN commit r5081.
2007-05-17 03:37:49 +00:00
b01acce45f macosx compat: separate strdup and wcsdup
This was SVN commit r5080.
2007-05-16 23:56:08 +00:00
4083e1ff48 # MacOSX compat
config, compiler: remove reliance on HAVE_C99; mention it's only for
pure C mode; make a few of the HAVE_ macro defs more clear

This was SVN commit r5076.
2007-05-16 16:32:12 +00:00
160bd14bb0 robustify CPU freq detection and timer code, hopefully solve lockup issue
cpu: cache CPU info to prevent calling freq measurement code several
times
config: mention e.g. fopen_s instead of only the secure string functions
ia32: exception-safe scheduler setting; no longer use absolute max
priority (risky, could hang machine if loop contains a bug)
wtime: add note on TSC safety, slight improvements
timer: try and prevent timer from returning the same value

This was SVN commit r5075.
2007-05-16 15:56:47 +00:00
a34b759720 . split up lib.h/.cpp, include the remnants from PCH, remove (pretty much universal) include of it.
. timer, config: fix definition of ALLOW_RDTSC
. add movsx_be64 (for whirlpool), revise implementation, move to
byte_order, add test
. MAX -> std::max, remove those macros
. add timestamp to system_info as requested by philip

This was SVN commit r5050.
2007-05-09 21:01:11 +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
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
be3f3bdbfb # SwEng / MacOSX compat
further cleanup to sysdep.h: avoid pulling in win and ia32; split header
up into stl, compiler, and the actual sys_* API. (all but the latter are
in PCH).

timer: also avoid dragging in ia32
win: move snprintf fix to posix.h
cpu: simplify reasoning about cores, now given as logicalPerCore (not
package)
vfs_optimizer: fix if archive building is partially disabled

This was SVN commit r5008.
2007-04-30 14:35:19 +00:00
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00
e8a0626248 # improvements to foundation code
(merged in from thesis project branch)

allocator: remember page-aligned size (prevent resize error)
config, sysdep, lib: add implementation of wcsdup for macosX
path_util: add path_package_copy and cleanup
file: add dir_exists, dir_create uses _mkdir (avoids mode_t param)

This was SVN commit r4984.
2007-04-22 16:43:54 +00:00
fb91d32d61 philip points out G++ will not support the restrict keyword at all.
This was SVN commit r4826.
2007-02-01 01:44:13 +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
94099e035a # housekeeping
. add note to HAVE_C99 as per last meeting.
. moved a few extern declarations to header (required for some code
analysis tools)
. tiny warning fix in SoundGroup

This was SVN commit r4772.
2007-01-14 23:13:08 +00:00
0bb0df5b2c # new year's cleanup (reduce dependencies, clean up headers)
- remove headers always included from PCH
- nommgr.h is only included ifdef REDEFINED_NEW (allows leaving out the
mmgr stuff)
- in lib/*.cpp, moved the corresponding include file to right behind the
PCH (catches headers that aren't compilable by themselves)
- byte_order no longer depends on SDL
- add debug_level (another means of filtering debug output; needed for
thesis)
- split posix stuff up into subdirs (lib/posix and sysdep/win/wposix).
makes including only some of the modules (e.g. sockets, time) much
easier.

This was SVN commit r4728.
2007-01-01 21:25:47 +00:00
4dd04f9bea lib/config.h: re #155, define HAVE_PCH on non-windows systems too, if USING_PCH
is defined (defined by the premake scripts)
FileConverter.cpp: Fix wxString-through-valist (for no better reason
than being
annoyed by the warnings...)

This was SVN commit r4643.
2006-11-12 19:55:10 +00:00
a2432adad3 # GCC 4.1.1 compatibility
which is just "class C { void C::f(); }" code, which other compilers
seem to have ignored.
Also removed HAVE_PCH from GCC because our build system doesn't have
PCH. Added necessary headers to make it compile again.

This was SVN commit r4437.
2006-09-30 15:46:40 +00:00
399e26a9c5 # macosx compat
This was SVN commit r4196.
2006-08-04 09:30:43 +00:00
3195893d1c # MacOS X compat (part 1)
- u_anim_name disambiguation
- fix implementation of finite (use our fpclassify instead of compiler's
routine)
- รค -> ae
- workaround for MAP_ANONYMOUS
- fix GLint in ogl.cpp
- add include for SIZE_MAX in string_s
- avoid PIC clobbered error and speed up rdtsc a bit
- add include for stat

This was SVN commit r4170.
2006-07-26 14:04:52 +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
836cd08d5e # add CppDoc file header to all files, along with their descriptions.
also:
- renamed wdll to delay_load, and wdll_ver to dll_ver
- removed empty wcpu

This was SVN commit r3751.
2006-04-11 23:59:08 +00:00
6eac18d9fe # housekeeping (improve unreachable code annotations and avoid compiler warnings)
adts: use SAFE_FREE
config: add CONFIG_FINAL; use it in
compression,vfs_optimizer,scriptablecomplex
lib: add discussion of unreachable code avoidance; revise UNREACHABLE
and add NODEFAULT
ogl_tex, tex_dds: remove some unnecessary UNREACHABLE
sysdep: move compiler-specific implementation of UNREACHABLE here.
use NODEFAULT in snd, wdbg, wposix, wsdl

This was SVN commit r3739.
2006-04-10 06:44:54 +00:00
f06f0c8240 adts.cpp: remove DynArray, which was an array of pages. (obsoleted by DynArray/Pool allocators)
adts.h: add Cache (landlord algorithm), move DynHashTbl here from
vfs_tree; expand RingBuf and fix its iterator
allocators: minor tweaks+bugfixes; add SingleAllocator C++ wrapper
config, types: avoid stupid ICC warnings
lib: add round_down, u32_from_u16, SAFE_FREE

This was SVN commit r3414.
2006-01-23 07:59:20 +00:00
e2f25f4598 - self test: rename stuff to SELF_TEST*; add provision for delayed all-at-once self tests (allows for init before the test and makes measuring elapsed time easier)
- config: add CONFIG_TRACE
- display_error_impl->sys_display_error
- cleaned up sysdep; add sys_ prefix everywhere and document everything
- add to vfs_load dox
- cursor: sys_cursor_load -> sys_cursor_create. sysdep code is no longer
dependent on tex; instead of calling tex_load, the caller passes a BGRA
texture in.
memcpy: huge kick in the pants for accompanying paper; now even faster.
- on_each_cpu -> sys_on_each_cpu (removed manager function also)
- wsdl: explain PeekMessage CPU usage issue

This was SVN commit r3203.
2005-12-07 03:38:39 +00:00
14c62e721d ia32, sysdep: add float->int implementation and fallback version and self-test
config: add macro that determines when it's used
Terrain, wtime: use new float->int code
detect: no longer change _MCW_RC

This was SVN commit r3114.
2005-11-07 02:04:28 +00:00
a7d6725f45 allocators, config: add CONFIG_OVERRUN_PROTECTION - allows disabling the lengthy work done by OverrunProtector
h_mgr: clarification of fn_store code
mem.cpp: fix recursive taking of a lock

This was SVN commit r3048.
2005-10-29 21:40:41 +00:00
8c437850e6 allocators: add include guard and posix.h (needed for PROT_*)
debug: add debug_is_code_ptr and debug_is_stack_ptr
config: add CONFIG_OMIT_FP (needed for ia32_stackwalk).
h_mgr: hyperparanoid overrun detection straightjacket for key2idx - now
safe to use at any time and any unexpected changes cause access
violation.
ia32: add ia32_get_call_target, which disassembles backwards and checks
for a valid CALL instruction + its target
wdbg_sym: add win-specific walk stack function. it's quite simple and
requires EBP frames (hence CONFIG_OMIT_FP). rationale: dbghelp requires
~30 seconds (!) to start up. recent changes (tracking malloc callers via
debug_get_nth_caller) made this happen on every run, so added a
fast-path stack walker to avoid this.

This was SVN commit r3043.
2005-10-29 02:32:36 +00:00
b6dfb8174f fix 64bit bug: wsdl defined SDL_Event.user.code as intptr_t, but real SDL doesn't. brought that in line and fixed GUIHotkey code.
config: proper detect for clock_gettime

file: file_rel_chdir -> file_set_root_dir; it no longer changes current
directory; instead, root dir is prepended to all paths (not that bad
perf-wise)

netlog: avoid a CRT assert if log file open failed. now that current dir
is no longer being set, we need to think about what will happen to the
logs - they either need to use file_make_full_native_path, or use the
entire file.cpp interface instead of fopen etc.

This was SVN commit r2936.
2005-10-13 19:11:22 +00:00
609be94b8c comments/cosmetics;
fix UNREACHABLE def on unix;
string_s: use HAVE_STRING_S;
wdbg_sym: fix option set code; explain why search path isn't needed
WriteScreenshot: make sure there's enough mem; use Handle to free mem
(more efficient+less error prone)

This was SVN commit r2779.
2005-09-27 15:20:56 +00:00
37e9fc0388 - update load times
- config: add proper HAVE_ macro for string_s functions rather than
checking MSC ver directly
- string_s: disable parts of the self-test that trigger errors if not
using the string_s.cpp implementation

This was SVN commit r2760.
2005-09-21 16:42:56 +00:00
808a0f7cbe config: additional macro is checked
lib: add bits() function (actually moved it from zip.cpp)
ia32: start moving code out to external asm file (will use NASM in
pre-build step; avoids needing MSC and GCC-specific inline code). move
memcpy test code out to other file

This was SVN commit r2706.
2005-09-13 04:00:41 +00:00
a0a01e7a7d Linux/GCC Compat, added some includes, ported inline assembly stuff to gnu syntax (and misc. cleanup in ia32.cpp)
This was SVN commit r2702.
2005-09-12 23:37:52 +00:00
aba23e4fdb config: got my grubby hands on a list of OS defines, so those have been assimilated. also add STL_ defines for GCC and ICC.
vfs.h: wording in dox
win.cpp: add note on suspending threads in display_error_impl

This was SVN commit r2598.
2005-08-10 20:53:52 +00:00
5299dcad86 - config: all macros are defined as 1 / 0. testing with #if allows compiler warnings (testing undefined macro) to spot misspelled macros
- debug: add provision for naming threads. allows adding current thread
name to log messages and displays their names in the debugger.
- replaced various if(err < 0) complain() sequences with new variants of
CHECK_ERR (see lib.h)
- fixes to mmgr/VC debug alloc enable code
- improved h_mgr error reporting (now complains when h_free fails)
- US -> UK english (partial)
- fix tex_load double-free bug
- move win32 mouse cursor code into sysdep
- error dialog is now topmost to make sure it's visible (was a problem)
- handle WM_QUIT before displaying error dialog (makes sure it's shown)

also as in previous 3 revisions.

This was SVN commit r2588.
2005-08-09 16:23:19 +00:00