summaryrefslogtreecommitdiff
path: root/src/common/timer.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-312012-2018 !Maytichai Saowa1-1/+1
2016-10-28Fixed copyright year for 2016Lemongrass31101-1/+1
2016-10-07Fixed some issues detected by clang's static analyzer (Xcode 8/macOS Sierra)Haru1-4/+0
Signed-off-by: Haru <haru@dotalux.com>
2016-04-27Add checks for wrong timer id. Some times in code it can be 0 and not -1.Andrei Karas1-2/+8
Now tid is illegal, and tid start counting from 1.
2016-02-05Clear timer function after auto remove timer ended.Andrei Karas1-0/+1
2016-02-05Add missing checks into timer.cAndrei Karas1-5/+58
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-10-11Changed VECTOR/BHEAP/ARRAY macros to discourage usage of unsigned loop counters.Haru1-9/+25
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Cleaned up some #includesHaru1-1/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-11/+11
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2014-12-31Add some missing null pointer checks after automatic checks.Andrei Karas1-0/+1
2014-11-16Whitespace cleanup (no code changes)Haru1-18/+18
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-2/+3
- 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-11Explicitly specify 'void' when a function expects no argumentsHaru1-2/+2
- See CERT DCL20-C. 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-30Fixed typos inside src/Shido1-3/+3
2014-05-13Removed trailing whitespace (sources)Haru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2014-05-13Fixed some charset issuesHaru1-1/+1
- Fixed files with mixed character set or invalid CP949 characters. - Uncommented '#music' script in the_sign_quest.txt (now the soundeffect filename should be fixed). - Added a note to the header of CP949 files not to read or save them as UTF8, since it'd break their encoding. It should be safe enough to read them as EUC-KR if your text editor doesn't offer CP949 as an option. - Added FIXME notes about untranslated strings in assassin_skills.txt and WolfchevLaboratory.txt. Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-8/+11
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-11/+8
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-8/+11
- 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-01-18Socket interfacedshennetsind1-1/+1
We designed this one with having as little changes required elsewhere in mind, thus the way most socket-related things are called has not changed. Plugins may now take a greater advantage of the socket features. Signed-off-by: shennetsind <ind@henn.et>
2013-12-17Fixed some additional linux warningsHaru1-4/+4
- Fixed some warnings we had missed. - Improved -W cflag detection routines. - Only use -Wshadow if it's actually useful. Signed-off-by: Haru <haru@dotalux.com>
2013-10-30Follow-up to 44c33fda3614d588e6bf6cee1cf884e98f1531f0Haru1-4/+4
Corrected some leftover 32bit typecasts. Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2013-10-26Changed 'tick' variables to 64 bitHaru1-24/+62
- This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Renamed iTimer interface to timer.shennetsind1-16/+18
Also removed duplicate mentions of timer within calls to shorten.
2013-07-22Binary heap fix & improvement.Piotr Hałaczkiewicz1-4/+4
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-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-13/+24
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-16Fixed Bug #7249shennetsind1-4/+4
System-dependent function name conflict solved. http://hercules.ws/board/tracker/issue-7249-error-compiling-timerc/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-15HPM Updateshennetsind1-72/+63
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-236/+243
[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-243/+236
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03cleaned up windows header usage (added one central file to use windows / ↵blacksirius1-2/+1
winapi specific stuff, to be able to set the appropriate flags before including it correctly) Note: this may screw up mingw or cygwin building, ill fix it later... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-30- Removed trailing tabs, and fixed some spacing.brianluau1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15524 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-05* Moved detection of monotonic clock support to the configure script, which ↵ai4rei1-1/+1
also checks, whether or not it actually works (bugreport:1003, related r11912 and r11983). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14767 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-03-16added --enable-rdtsc configure option to enhance timer performance, ↵Yommy1-0/+45
especially in virtualized environments; default disabled - credits to sirius_black git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14265 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-01-21* Replaced the fake timer heap (sorted array) with a real heap. (improves ↵FlavioJS1-98/+38
performance) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13465 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-11-22* Hunted down the simpler 64bit pointer truncations.FlavioJS1-6/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13380 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-26Partially reverted the timer code changes from r12926 - r12969.ultramage1-224/+110
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12999 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-20ops ('|'->'&' in delete_timer debug code)FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-20* Simplified the search in pop_timer_heap and added more debug info to help ↵FlavioJS1-6/+15
determine the source condition of timer errors. (bugreport:1860) * Fixed crash in skill_castend_id. (bugreport:1860) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-16* Added a check to make sure only released timers are acquired from the free ↵FlavioJS1-3/+3
list. * Changed TIMER_MAX_INTERVAL to 1 second (was set to 1 minute by mistake). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12963 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-15* Fixed pop_timer_heap using max heap comparisons instead of min heap ↵FlavioJS1-21/+40
comparisons and protected timer functions against improper use. (should fix bugreport:1833 bugreport:1841) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12956 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-09* Added const to the return value of get_timer.FlavioJS1-147/+232
* Added a maximum timer interval. Avoids server shutdowns being delayed for ~10 seconds under some circumstances on windows. * Replaced the fake timer heap (ordered array) with a binary min heap. (actually, this is just a merge and has been in use for months) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12926 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-06-18Fixed a bug in the timer code which made it impossible to delete a timer ↵ultramage1-1/+1
with id '0' (since pre-svn, still present in jAthena). Fixed wrong order of parameters in a ShowWarning call when freeing a locked DBMap, which caused a segfault when executed (since initial implementation in r4859). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12854 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-27Removed the calc_times() no-op (bugreport:1289)ultramage1-7/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12668 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-21* Changed the data field of timers from int to intptr.FlavioJS1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12633 54d463be-8e91-2dee-dedb-b68131a5f0ec