Commit graph

54 commits

Author SHA1 Message Date
Robert Beckebans
a315630d7d Changed astyle-code.sh script to use the system astyle which is 2.03 on Kubuntu 13.10 2014-02-23 15:19:11 +01:00
Andreas Bergmeier
4d9970b148 Properly handle format analysis
Rename ATTRIBUTE_PRINTF to
- ID_STATIC_ATTRIBUTE_PRINTF
- ID_INSTANCE_ATTRIBUTE_PRINTF
since for instance functions, this has to be taken into account, too.
Add format analysis to idLib, DeclManager and idTokenParser functions.
Add support for clang.
2014-02-22 17:02:06 +01:00
Christoph Korn
264ffcb6f7 Fix typos
Just fix some typos.
2013-12-31 02:23:16 +01:00
Jonathan Young
1c500b710b Mirror source code directory structure in generated MSVC projects. 2013-09-16 17:54:14 +10:00
Daniel Gibson
88b23611f9 Fix DEBUG_THREADS on FreeBSD
There was a typo in an #include, furthermore FreeBSD has no
pthread_getname_np equivalent.

I added Sys_GetThreadName() so the code is a bit cleaner.
2013-06-23 19:16:23 +02:00
Robert Beckebans
3b67eabf79 Fixed critical bug in the generic C++ code of DotProduct_SIMD that caused massive errors in the physics system 2013-06-01 18:29:12 +02:00
Robert Beckebans
db715535cc Merged generic C++ fallbacks for SSE optimized code to allow support for non-x86 based platforms like ARM 2013-06-01 15:13:00 +02:00
Robert Beckebans
3023533e57 Added pthread priority code but it is disabled by default because it requires root privileges 2013-03-26 13:43:30 +01:00
Daniel Gibson
3c755e490b change threadnames so they fit into 15chars
+ terminating null byte - that's the limit of threadnames on linux

Furthermore: idJobThread::Start used va() to create the threadname.
va() isn't threadsafe... so I replaced it with a local buffer and
idStr::snPrintf()
2013-03-26 00:36:04 +01:00
Daniel Gibson
da9ab07e9c Refactor setting threadname on POSIX systems
* setting threadname is now done in a seperate function
* if setting the threadname fails, it just prints a warning now
  instead of terminating the game with a FatalError
2013-03-26 00:36:04 +01:00
Daniel Gibson
fe18a49303 Improve POSIX threading code
* setting threadname is now done in a seperate function so it's a bit
cleaner (it's different for every platform..)
* replace/refactor signaling code (based on my SDL threading branch and
  the old pthread signaling code from RB):
  - The interface is like on win32 now (Sys_Signal* functions instead of
    overwriting idSysSignal class)
  - created a custom signalHandle_t struct for that, which contains all
    needed information
  - Mimic Windows functions used in win32 implementation more closely,
    e.g. signal all waiting threads on manualReset signalRaise, count
    waiting threads etc. I'm pretty sure the behavior on Win32 and POSIX
    now is identical (as far as possible).
2013-03-25 22:05:02 +01:00
Daniel Gibson
9aa63e4074 Some timer-related improvements for POSIX
* idSysSignal::Wait should now handle timeouts > 1s better (or at all)
* Use clock_gettime for Sys_Milliseconds()
* Use CLOCK_MONOTONIC_RAW (and CLOCK_MONOTONIC as fallback if
  that's not available) for Sys_Milliseconds() and Sys_Microseconds()
  CLOCK_MONOTONIC can behave strange when NTP is used
* Small fixes in Sys_Microseconds(): use 64bit int to store time
  (like return type...), divide by 1000 (not 1000000) for nsec=>musec
2013-03-16 14:32:47 +01:00
Daniel Gibson
4040a3a9ef shut up compiler warnings
and a small comment
2013-03-16 14:32:47 +01:00
Yamagi Burmeister
63b1816be6 Add an explicit cast to shut up g++47 on FreeBSD 2013-03-16 14:32:47 +01:00
Yamagi Burmeister
649577e9be Include stddef.h for ptrdiff_t on FreeBSD 2013-03-16 14:32:46 +01:00
Yamagi Burmeister
f51688a470 Add FreeBSD defines 2013-03-16 14:32:46 +01:00
Yamagi Burmeister
da31237ed0 Replace malloc.h by stdlib.h
On true unices malloc.h was never available and on Linux one should
include stdlib.h instead. While this change is necessary to build
rbdoom3 on FreeBSD and other true unices, the big question is what
it means to Windows.
2013-03-16 01:38:53 +01:00
Daniel Gibson
c58f0d4749 Precompiled Headers for GCC+Clang 2013-01-04 17:01:40 +01:00
Daniel Gibson
ca112294b8 Update unzip code to minizip 1.1
.. from zlib-1.2.7/contrib/minizip/
The original source was minizip 0.15beta from 1998.

This update brings zip64 support (untested) and cleaner code.

Furthermore, updates to future minizip should be much easier now, as
my changes to the original source files from minizip are quite small.

To make diffing to upstream minizip-src easier, I added the minizip
source as exceptions in the astyle-scripts and left them in their own
directory.

Two custom functions from idSoftware - unzSetCurrentFileInfoPosition()
and unzGetCurrentFileInfoPosition() - aren't needed anymore as
minizip 1.1 has functions that do the same.
2013-01-02 05:29:56 +01:00
Daniel Gibson
f77ca851d5 Small fix in Mem_Alloc16(): int->size_t 2012-12-29 04:27:01 +01:00
Robert Beckebans
e3584014b9 Fixed MSVC C++ exception warnings 2012-12-24 12:34:18 +01:00
Daniel Gibson
cca3053069 Prevent segfault on shutdown
This should also happen on Windows, I'm really surprised
this hasn't been noticed there
2012-12-23 06:40:48 +01:00
Daniel Gibson
ba126dde3a Fixed various warnings from clang 2012-12-23 06:40:47 +01:00
Robert Beckebans
9280732913 Fixed Linux build. 2012-12-22 16:34:02 +01:00
Robert Beckebans
dd9b8a8710 Added support for precompiled headers for MSVC which reduced the compiled time from 4 minutes to 67 seconds. 2012-12-22 16:18:19 +01:00
Robert Beckebans
865ee792c0 Disabled usage of pthread_{get,set}_name because it does not work on all Linux systems. 2012-12-22 13:15:47 +01:00
Robert Beckebans
99166faf71 Fixed compile problems on Win64 2012-12-17 12:24:31 +01:00
Robert Beckebans
63f9d4000f First playable version on Linux. 2012-12-16 17:31:21 +01:00
Robert Beckebans
b7d3481f57 Fixed missing 16 byte alignment on 32 bit Linux for SSE structs. 2012-12-15 14:53:11 +01:00
Robert Beckebans
8b8cfe7d25 Small changes to pthreads. 2012-12-14 13:10:52 +01:00
Robert Beckebans
7b43a34f37 Changed idSysSignal pthread implementation to consider the manualReset parameter 2012-12-14 11:50:20 +01:00
Daniel Gibson
ee88148bd1 eliminate more longs
for 64bit compatibility.
2012-12-13 01:28:41 +01:00
Robert Beckebans
86deed26b8 Merged 64 bit fixes. 2012-12-12 12:11:55 +01:00
Robert Beckebans
2952f227ea Merge remote-tracking branch 'DanielGibson/linux' into linux 2012-12-12 11:35:19 +01:00
Robert Beckebans
baac8780a5 Fixed some bugs in idSysSignal. 2012-12-12 11:29:55 +01:00
Daniel Gibson
9eeea7adf3 Fix tons of compiler warnings
mostly -Wreorder, use const char* instead of char* for "static strings",
fix inappropriate usage of NULL (e.g. instead of '\0' or (int)0)
2012-12-11 23:57:05 +01:00
Robert Beckebans
a1730fa430 Supplemented Linux backend with missing functions. -> [100%] Built target RBDoom3 on Kubuntu 12.10 2012-12-11 23:17:23 +01:00
Robert Beckebans
6d70f04cc9 Ported the Win32 threads to POSIX pthreads. 2012-12-09 01:55:59 +01:00
Robert Beckebans
3b0dabe30a Formatted code. 2012-12-08 18:20:13 +01:00
Robert Beckebans
8812f6f0a4 Merge branch 'linux' of https://github.com/RobertBeckebans/RBDOOM-3-BFG into linux 2012-12-07 21:25:01 +01:00
Robert Beckebans
bc6d7fbb8c Fixed wrong assert 2012-12-07 21:24:45 +01:00
Robert Beckebans
948865123d More Linux specific fixes, especially 64 bit 2012-12-07 17:06:44 +01:00
Robert Beckebans
9cc36a111e More Linux specific fixes. idlib compiles on Kubuntu 12.10 64 bit 2012-12-06 21:31:33 +01:00
Robert Beckebans
37a6018233 Added some macro defines for Linux. 2012-12-06 01:00:05 +01:00
Robert Beckebans
afaf66ef40 Formatted code 2012-12-04 12:11:14 +01:00
Robert Beckebans
e0c79bd2d2 More work on MinGW support. 2012-12-03 23:55:27 +01:00
Robert Beckebans
5e05fa58c3 Added Doom 3 GCC compile options. 2012-12-03 14:21:45 +01:00
Daniel Gibson
d949bc9410 Fix compiler warnings and errors in MinGW
many of the warnings -Wreorder and #includes with invalid path because of
case-errors (windows may not care, but linux does)
2012-12-03 09:29:14 +01:00
Robert Beckebans
b6dd24ec4e More MinGW specific compile fixes. 2012-12-02 06:00:07 +01:00
Robert Beckebans
536de6932a Added missing #include <stdint.h> for uinptr_t with MinGW. 2012-12-02 06:00:06 +01:00