summaryrefslogtreecommitdiff
path: root/src/common/cbasetypes.h
AgeCommit message (Collapse)AuthorFilesLines
2018-05-312012-2018 !Maytichai Saowa1-1/+1
2017-08-08Disable warning -Wdiscarded-qualifiers in hpm code for now.Andrei Karas1-0/+7
2016-12-03Add support for static assertions (on compilers that support them)Haru1-0/+27
This introduces the macro `STATIC_ASSERT(ex, msg)`, that works like its C11 counterpart `_Static_assert(ex, msg)`, on compilers that support it. Support is provided, depending on the compiler: - When in C11 mode, use the native `_Static_assert` - If the compiler advertises having the `c_static_assert` feature, use `_Static_assert` (according to the clang documentation). - If the compiler is GCC >= 4.7 (tested to be compatible), use `_Static_assert` (nonstandard extension, C11 feature available in C99). - If the compiler is MSVC (all the currently supported versions have been tested to be compatible), then use `static_assert` (nonstandard extension, C++ feature) - Otherwise, define it as a no-op macro. Signed-off-by: Haru <haru@dotalux.com>
2016-10-28Fixed copyright year for 2016Lemongrass31101-1/+1
2016-10-02Changed _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") to target GCC 4.6 ↵Haru1-6/+6
instead of 4.5 - The support on GCC 4.5 is incomplete, and in order to build Hercules, GCC >= 4.6 is recommended Signed-off-by: Haru <haru@dotalux.com>
2016-09-30Add different fixes for gcc 7 warnings.Andrei Karas1-0/+7
Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings.
2016-05-14Removed dead leftover code from some testing a while ago.Matheus Macabu1-18/+0
2016-05-08Removed some legacy checks for MSVC <= 2003Haru1-4/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-05-08Removed 'temporary fix for bugreport:4961', no longer necessaryHaru1-10/+0
- The provided test cases return success on all currently supported FreeBSD versions (9 and 10) - Fixes #1283
2016-04-05Disabled some #pragma GCC diagnostic on versions that don't support themHaru1-0/+15
- Fixes compilation on gcc 4.4 for the brave ones who still want to use it (we recommend gcc 4.7 or newer) - Removes some warnings about unknown pragmas on MSVC Signed-off-by: Haru <haru@dotalux.com>
2016-02-20Added explicit c99 mode to CFLAGS in the configure scriptHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-0/+19
Signed-off-by: Haru <haru@dotalux.com>
2015-12-02Fixed compile errors on very old PACKETVERsHaru1-0/+3
- Fixes #903 and other similar problems Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed VECTOR/BHEAP/ARRAY macros to discourage usage of unsigned loop counters.Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Added support for visual Studio 2015Haru1-0/+2
Please report any issues Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Cleaned up some #includesHaru1-0/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-05-20* Fixed a compile error.Michieru1-1/+1
Thanks to Haru
2015-05-19Fixed some issues reported by coverity scan [3/3]Haru1-0/+6
- Automatically zeroed variables are now zeroed in the correct size, regardless of padding. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2015-01-12Removed unused (re)definition of NBBY from cbasetypes.hHaru1-6/+0
Signed-off-by: Haru <haru@dotalux.com>
2014-11-16Whitespace cleanup (no code changes)Haru1-57/+56
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-08-07Corrected several format-string errors through the codeHaru1-0/+13
- Functions that expect a printf-style format string are now marked as such, so that gcc/clang will emit a warning warn you if you mismatch format string and arguments. Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Removed some c++ compatibility definitionsHaru1-36/+0
- Neither our code nor 3rdparty code is, (or will compile as) C++, regardless of those checks. - Special thanks to panikon. Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Fixed reserved __identifier violationsHaru1-5/+5
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
2014-05-13Removed trailing whitespace (sources)Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-0/+6
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-6/+0
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-0/+6
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2014-03-07Tweaked a platform check to support ARMv6+Haru1-0/+12
Signed-off-by: Haru <haru@dotalux.com>
2014-02-02Introducing HPM Datacheckshennetsind1-3/+3
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/ Signed-off-by: shennetsind <ind@henn.et>
2014-01-23Compatibility fixes for NetBSD and SolarisHaru1-0/+5
- Fixed some warnings in NetBSD (5.x and 6.x) and Solaris (11) Signed-off-by: Haru <haru@dotalux.com>
2013-12-17Fixed several compiler warningsHaru1-0/+7
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
2013-12-17Added support for non-aborting assertionsHaru1-18/+1
- Added Assert_ret, Assert_retv, Assert_retb, Assert_retr, working similarly to the corresponding nullpo_ functions. - Moved Assert-related macros to nullpo.h, since they share some functions. Signed-off-by: Haru <haru@dotalux.com>
2013-11-19Sanitized and improved several macros through the codeHaru1-4/+6
- Sanitized all potentially unsafe macros (related eA:15259) - Improved some function-like macros to evaluate their argument only once and keep it in a temporary variable. This improves performance in the damage calculation related code. Signed-off-by: Haru <haru@dotalux.com>
2013-11-05cbasetypes.h updateshennetsind1-6/+6
partial usage of ea:15242 (ai4rei) -- will revisit the remaining. Signed-off-by: shennetsind <ind@henn.et>
2013-08-26Merged strtoll MSVC fix from Ind's ScriptEngineUpdateP1 branchHaru1-0/+1
Credits to Ind for the fix, thanks to Takkun for reporting it Signed-off-by: Haru <haru@dotalux.com>
2013-08-12Replaced own bool typedef with <stdbool.h> where availableHaru1-0/+12
Fixes bugreport:7645 http://hercules.ws/board/tracker/issue-7645-rev-12302-compiler-error-and-warnings-on-gcc-49 Special thanks to Takkun for VS2012 testing and info Signed-off-by: Haru <haru@dotalux.com>
2013-07-22Binary heap fix & improvement.Piotr Hałaczkiewicz1-0/+2
Fixed a bug when removing last element of binary heap (its parent would be removed instead if it had the same value). Binary heap now allows custom swapper function/macro. Added `swap_ptr` macro to swap two pointers in place (`swap` is not suitable for pointers). This allows to store pointers in binary heap.
2013-05-19Added new packets for 2013-05-15aRagexe (thanks to Shakto!).Matheus Macabu1-0/+18
Signed-off-by: Matheus Macabu <mkbu95@gmail.com>
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-75/+72
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-72/+75
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-09-29* Merged eAthena changeset ea:15190. (bugreport:5138)eathenabot1-0/+14
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-10added mutex && cond var abstraction ( for pthread / winapi )blacksirius1-0/+24
added type 'sysint' to cbasetypes, which's the width of the platform the release gets compiled for. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16256 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03fixed portability issue. (As long as we support other compilers than MSC/ICC ↵blacksirius1-1/+1
we have to check explicitly for compiler and not only on Platform ... ) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-02feature merge bs-coreoptimize->trunk: added some compiler abstractionsblacksirius1-1/+9
- forceinline -> will force the compiler to always inline the given method - ra_algin(n) -> align to (n) .. (see: http://msdn.microsoft.com/en-us/library/83ythb65(v=vs.80).aspx for more informations). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16215 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-09-08* Fix C++ compilation issues.flaviojs1-0/+29
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14955 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-10* Temporary fix for bugreport:4961 (unintended conversion from signed to ↵flaviojs1-0/+10
unsigned). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14896 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Reimplemented integer typedefs in cbasetypes.h in terms of standard ones in ↵ultramage1-56/+33
stdint.h. Used the INT*_C() macro to give the MIN/MAX constants a proper size suffix. Merged the 64bit integers section with the main integer section. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14875 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Added back intptr/uintptr typedefs for backwards compatibility.ultramage1-0/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14874 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-24/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-21* Added msinttypes (rev. 26, http://msinttypes.googlecode.com/svn/trunk/) ↵ai4rei1-5/+8
portability framework for Visual C++ compilers (related bugreport:4059). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14478 54d463be-8e91-2dee-dedb-b68131a5f0ec