Commit graph

14 commits

Author SHA1 Message Date
0252fd13e7 utils: add ScopeGuard 2024-08-05 16:45:41 +02:00
outfoxxed
a950624669
math: add Edges (#10) 2024-07-27 17:38:55 +01:00
6174a2a25f
path: add findConfig and dir utils (#8) 2024-07-09 19:11:16 +02:00
a8c3a13570 math/region: add expand 2024-07-05 20:17:24 +02:00
Maximilian Seidler
259ecfa098
string: respect removeEmpty when VarList input is empty (#7) 2024-07-04 18:04:41 +02:00
Tom Englund
7e1b6610a2
memory: avoid undefined behaviour from downcasting ptr implentation (#5)
* sharedptr: dont downcast ptr implentation

avoid runtime errors of wrong downcasts by adding a underlaying ptr data
getter and only cast the data, downcasting the implentation type isnt
inherited from eachother, while the intention was do upcast/downcast
a derived class to a base class. found with UBSAN "runtime error:
downcast of address which does not point to an object of type
"CSharedPointer_::impl<IKeyboard>" note: object is of type
"Hyprutils::Memory::CSharedPointer_::impl<CKeyboard>"

also make dataNonNull check against != nullptr.

* sharedptr: use reinterpret_cast instead of c style

make it more type safe, C style casts tries every single one until one
works, or not. compilers also produces better warnings/errors when using
c++ casts in favour of C style ones.
2024-06-28 18:49:58 +02:00
Jasson Cordones
7a2c2c96ec
Math: Some more box improvements and test cases (#3)
* Added some constants to handle floating point presicion comparisons and other calculations plus some refactoring

* Removed validation

* Added comments to understand how box header works

* Extended the EXPECT macro to evaluate Vector2D test cases

* Added box.cpp test cases

* Applied clang-format
2024-06-25 01:17:44 +02:00
725f63aabc vector: prefix macros with AQ_ 2024-06-19 23:16:16 +02:00
b4b5389bc1 Math: add an int ctor to vec 2024-06-18 18:17:55 +02:00
e9d4a99e13 Math: init Region, Vector2D and Box 2024-06-18 14:10:18 +02:00
Tom Englund
1f4743a1f7
sharedptr: decrement on destruction (#1)
if we dont decrement the sharedptr on destruction any weakptr remaining
will have an impl_ with a ref of 1 and upon destruction of the weakptr
it wont delete the implentation because it thinks a shared pointer still
exist.
2024-06-13 11:29:50 +02:00
f73a28ca03 string: add replaceInString 2024-06-08 22:35:40 +02:00
138408125c string: add VarList 2024-06-08 22:24:55 +02:00
bf73356d39 utils: Initial Commit 2024-06-08 19:37:15 +02:00