Commit graph

65 commits

Author SHA1 Message Date
turleypol
43b776b94d
New format lib version (#592)
* renamed include guard to be able to use both format lib versions in
parallel

* build Fmt lib and link it into clib

* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib

* use new logging variant for two logs

* always add \n to flush log, lets see if the assumption holds

* use new lib for tostring

* replaced all INFO_PRINTS in clib

* formatter for Token, BObject and BObjectImp

* started with bsccript

* use function instead of actual object for logging

* remaining bscript, started plib

* logvariant without newline added, more template magic

* format support for base types, added test for format padding
new version for fdump

* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE

* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool

* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE

* gitignore for fmt lib

* cleanup vim leftovers
2024-01-10 18:29:10 +01:00
turleypol
902c9cbfde first version of ++i and --i unary operator 2019-09-21 14:56:06 +02:00
turleypol
ea9f5afd45 moved default deconstructors into header to let them count as trivial. 2018-11-03 15:00:44 +01:00
turleypol
0d4cca785d cleanup of compilerspecifics, ancient compilers arent supported.
ran tidy to use bools instead of ints
2018-11-03 13:14:53 +01:00
turleypol
a5e6206164 Added cmake option to run clang-tidy
used everywhere nullptr
2018-10-09 16:36:35 +02:00
turleypol
0a39af15a1 Changed classes to be final if possible, removed override macro 2018-10-09 09:47:27 +02:00
turleypol
0aea78c405 added array.sorted_insert to insert into an already sorted array.
Added a few finals and defaults
2018-10-07 21:05:02 +02:00
Gabriele Tozzi
b72f725e02 Whitespace fixes 2018-04-03 04:13:03 +02:00
turleypol
3afc41241b
CMake on windows (#48)
CMake can now also be used for windows
2018-02-24 22:34:55 +01:00
turleypol
e54d5144ba FunctionObject doc
fixed parser to allow functionobjects directly as function paraeters
increased ecompile versionnumber to force recompilation
corrected fileaccess.cfg: without directory entry behaves like before
giving full access
2018-02-06 21:38:07 +01:00
turleypol
2ba436bd56 protected functionref to be executed in a different script
added testscripts
2018-02-04 16:08:03 +01:00
turleypol
9d3cd4ffd5 fixed unittests, removed remaining debug prints 2018-02-04 12:56:08 +01:00
turleypol
d7fbb4ac8e cleanup debug prints
fixed funcref implementation
2018-02-04 11:58:26 +01:00
turleypol
0d04d5e19b Current FunctionRef status. Mixed with a few more cmake stuff 2018-02-03 19:05:22 +01:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turleypol
ef208fff40 fixed a few warnings 2018-01-06 12:45:04 +01:00
turleypol
ef2108c9f7 New objecttype Boolean.
create via basic::Boolean(1/0)
only == != ! operators are implemented.
2018-01-05 20:04:01 +01:00
turleypol
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +01:00
turley
b94da772b3 added new optional parameter to array.sort(sub_index). If given sorts
an array of arrays via the given index.
2017-09-23 13:50:02 +02:00
turley
f9c3db9e41 Modules share the same (helper) template base class
Optimize function name search for all modules not only uo by using an additional map, replaced c array with vector for functionsdef.
Simplified pragma pack order. (MSVC version is supported in all
compilers)
Removed compilerassert.h (asserteql,..) replaced with static_assert
Removed some old #ifs
2016-12-20 23:53:32 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
Gabriele Tozzi
6a90be8a97 Merge remote-tracking branch 'upstream/master'
Conflicts:
    pol-core/bscript/object.cpp
	pol-core/pol/accounts/account.cpp
	pol-core/pol/gameclck.cpp
	pol-core/pol/miscmsg.cpp
	pol-core/pol/module/polsystemmod.h
	pol-core/pol/proplist.cpp
	pol-core/pol/proplist.h
    pol-core/support/scripts/polsys.em
2016-02-12 17:37:27 +01:00
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
Gabriele Tozzi
ff64e3b2b4 Minor: forcing SpinLock to be used only via SpinLockGuard 2016-02-03 06:08:26 +01:00
Gabriele Tozzi
fd24da5cd1 Documentation: reformatting some comment blocks 2016-01-25 01:17:56 +01:00
Gabriele Tozzi
530790c8f8 Comparison operators refactor: better handle weird cases, cleaning
- obj.isLesserThan() and obj.ieEqual() are now replaced by < and ==
- Removed obsolete isLT(), isLE(), isGT(), isGE()
- Also implemented comparison operators for BObjectImp
- These operators may now be fully overriden in child classes
- Default implementations are derived from == and < operators
- As a general rule (that fit into "undefined" behavior":
-- Objects are == if having the same address
-- Objects are < based on their type ID, except of Error and Uninit
   that always are < everything else.
-- Objects are supposed to implement their own < and fall back to
   base class. If not implemented, as a last fallback, the object's
   address in memory is used to do the comparison
- Added test case for comparison operators
2016-01-24 22:22:45 +01:00
Gabriele Tozzi
45959b92d2 Small memory improvement: BObjectImp.type_ is now u8 instead of int
It is very unlikely to grow to more than 256 elements any time soon.
This should save 3 bytes for every single object that derived from it.
Also added explicit int conversions and a not, for better robustness.
2015-12-29 03:21:02 +01:00
Thomas Volkert
f32001a63d Avoid compiler warnings 2015-11-01 01:04:29 +01:00
turley
c755d44e75 Added: array.cycle([count])
will move array backwards or forwards in-place as it were a conveyor belt.
{1, 2, 3}.cycle()
Will make it:
{3, 1, 2}
Accepts a negative value as a shift to move different direction
Changed: string.format()
Now actually faster than string concatenation in eScript
Fixes a bug where {:d} formating could cause an arbitrary number shown instead of a real value
tag errors are slightly more intuitive and compact.
Note: Patches submitted by andenixa
2015-07-27 19:17:49 +02:00
turley
dc3c54d3f0 misc stuff:
explicit initialization of some members
fixed a define
target cursor ids are now send 1-based instead of 0-based
clean up refpointers in sellhandlers after use (and not before)
iostats changed to atomics
2015-03-15 13:39:34 +01:00
turley
b77a13073c corrected several data races 2015-03-14 11:45:14 +01:00
turley
2ca9cac2e0 Moved fileaccess storage 2015-01-02 16:31:10 +01:00
turley
c67d744afb fixed debug build 2014-11-23 15:22:57 +01:00
frozenblit
943b820eba More and more cleanups
Added some missing include guards, corrected wrong include guard names.
Removed more stl_inc.h includes.
2014-11-02 19:40:40 +01:00
turley
54b4691bdd c++11 random mersenne twister usage added (patch submitted by Kimungu)
started to split the packet build logic into own classes (SendWorldItem/Multi checks itself which packet version needs to be build)
2014-08-01 17:05:58 +00:00
turley
331792c755 added more memoryusage estimation 2014-06-07 09:00:37 +00:00
turley
31ee263a45 activated new logging facility 2014-01-18 13:29:38 +00:00
turley
99d7dc3037 namespaces...finally :)
Hard part is finished every file is touched. Namespaces are currently rough named by directory name.
Maybe we could split it more
2013-12-21 09:10:46 +00:00
turley
b0338db350 some c++11 changes 2013-09-21 09:45:04 +00:00
turley
bed4a8ef19 automatically install clang,gcc4.8,vim
modified makefile to switch between gcc4.6,4.8 and clang (currently clang as default (nicer error msgs)
win32 default to xp toolset
more #define cleanup
replaced hash_map with c++11 unordered_map
2013-09-14 10:52:15 +00:00
turley
90f1fc9248 implemented the std mutex 2013-09-13 19:03:25 +00:00
turley
4c7f70fc79 first version of a generic message_queue (currently not lockfree, need to test more)
replaced old auto_ptr with unique_ptr
2013-09-13 18:07:19 +00:00
turley
593bea8cea the first version of the leak fix was of cause to easy... 2013-08-31 16:27:31 +00:00
turley
9d5c26cbed fixed escript memoryleak with array_assign and set_member
called on strings it always leaked, different objects only on failure.
2013-08-31 10:19:09 +00:00
turley
49b6d30aaa Some code cleanups
fixed possible crash with speech tokens
2012-09-28 16:58:05 +00:00
turley
dd214ec227 endless loop also in -= and *=
added testscript for all the 'senseless' operations
2012-02-17 19:08:42 +00:00
turley
0e1b6329fd fixed possible endless loop in - and * operator 2012-02-17 17:39:26 +00:00
turley
115dd7b2cc some more threadsafe stuff 2012-01-04 13:11:43 +00:00
turley
09800feec7 stackoverflow fix aka endlessloop 2012-01-03 14:22:53 +00:00
turley
65d51103fa major rewrite of primitive operators
major speedup of +=,-=,...
2012-01-03 11:32:26 +00:00