1
0
forked from 0ad/0ad
Commit Graph

16 Commits

Author SHA1 Message Date
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
7a4dd7b473 Set svn:eol-style=native
This was SVN commit r6828.
2009-04-18 16:14:48 +00:00
c4654fd8fa bits: avoid sign conversion warning
debug: cleanup
ogl_tex, tex: use full-width types to avoid truncation warnings
wdbg_sym.cpp: skip __suppress and __profile symbols; add additional hex
display for floats; cleanup
wdll_ver.cpp: cppdoc+cleanup (remove non-reentrant C interface, replace
with std::string)
sysdep: add cppdoc

everything else: flag parameters are now consistently size_t instead of
int (avoids warnings, allows slightly better code on x64)

This was SVN commit r6392.
2008-09-18 11:27:55 +00:00
2624069993 replace most BIT macros with a Bit() template for better 64-bit safety
test_bits: add tests for all routines in bits.h
hpet: add safety check
unit.h, bits.h, DOMEvent.h: change T(~0) to ~T(0) (required when T is
64-bit)

This was SVN commit r6335.
2008-09-06 21:15:53 +00:00
0994b71316 fixes
bits: avoid warning, document ceil_log2 corner case
cpu, x86_x64: remove unused cpu_MemoryFence
wdbg_heap: avoid warning
test_bits: fix incorrect test values
TerrainOverlay: fix use of struct vs. class, correct unintended
search&destroy of intended->ssize_tended (LOL)

This was SVN commit r6119.
2008-06-26 20:12:42 +00:00
028a92375f fixes from work:
- aligned_allocator.h: use _mm_malloc instead of _aligned_malloc
(somewhat more portable)
bits: fix incorrect handling of bit_mask(0)
- archive_zip.cpp: fix ArchiveWriter_Zip (wasn't opening its output
file, ECDR record wasn't at end of file due to padding)
- io_align.cpp: move routines to header (DLL export)
- wdbg_heap.cpp: avoid crash in report hook if CRT memory block is
invalid

This was SVN commit r6030.
2008-06-16 18:36:36 +00:00
5d80d2ee5d fixes+improvements from work:
- add AlignedAllocator - an STL allocator that returns
cache-line-aligned objects (required to avoid RFOs when threads write to
various independent items in a container)
- bits: bit_mask can now be used for N=0..numBits (works around
full-word-shifts-are-undefined issue)
- precompiled.h: remove scoped_ptr, add function-related stuff from TR1
- numa:
  . add numa_IsMemoryInterleaved
  . numa_Allocate is now able to allocate large pages as well (reduces
TLB misses)
- os_cpu: interface change to support 32-bit apps running on WoW64
systems with > 4 GB of memory
- topology: use new x86_x64_EnumerateCaches API; fix detection of cache
ID
- x86_x64: provide the means of enumerating all caches returned by CPUID
and detect L1 cache size

This was SVN commit r6004.
2008-06-01 08:25:12 +00:00
d1a9348b91 major refactor of topology.cpp: each piece of information is detected separately on-demand (reduces coupling and static data)
fix documentation of ceil_log2 relating to input=0
remove os_cpu_SetThreadAffinity (redundant)
wcpu: make max # processors available via os_cpu.h; remove warning if
process affinity is restricted

This was SVN commit r5951.
2008-05-13 05:51:25 +00:00
ffdff6888d add NUMA and shared-L2-cache detect code (required at work)
enable most of IA-32 specific code to be used in amd64 (resides in
directory lib/sysdep/x86_x64)

bits: add IsBitSet
remove mem_PageSize (use os_cpu_PageSize instead)
cpuid: change interface to allow gracefully supporting later
subfunctions that require input parameters
amd64_asm.asm: add amd64 implementation of cpuid
cpu: move functions provided by OS to sysdep/os_cpu.cpp
cpu topology: avoid trouble when process affinity is set by remapping
processor numbers to 0..PopulationCount(processAffinity)
topology.cpp: move ex-ia32 topology code here.

This was SVN commit r5945.
2008-05-12 18:15:08 +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
cc243f67eb fixes/improvements made at work:
- fix lots of 64-bit warnings
- round_up/down now templates
- avoid warning with definition of byte swap functions; remove
duplication of that in wsdl
- codec_zlib.cpp: avoid domination warning
- vfs/file_cache: VFS is now responsible for handling zero-length files
(no longer considered an error; just returns zero pointer and size=0)
- cpu: export all functions (thus obviating cpu_memcpy_thunk). this
required renaming asm functions and adding thunk functions that call
them
- winit: fix segment merge statement, reinstate /include (otherwise init
functions are stripped by linker)
- wstartup: VC CRT init section definitions have changed in amd64 build;
match their definition
- wsysdep.cpp: more descriptive text for osError = 0

This was SVN commit r5899.
2008-05-01 15:41:42 +00:00
a9fcc1a87c small fixes required by use of lib codebase at work
This was SVN commit r5796.
2008-03-29 18:29:26 +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
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
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