Commit Graph
15 Commits
Author SHA1 Message Date
ZXShady b99a455873 Match parameter types with SFML types 2024-10-07 18:48:53 -06:00
ZXShady 884dcde3c3 Make enumeration counts constant expressions
This change allows now having these variables as array sizes that
are not Variable Length Arrays like in structs for example.

To note however that this changes the type from unsigned int to an
implementation defined type which usually `int` which is signed and
not unsigned.
2024-10-04 09:05:55 -06:00
ZXShady cc92ca36b7 Pass by reference if it is never null
sfEvent was not checked for null and was assumed to be non null in convertEvent so I made it a reference to reflect that
2024-10-03 10:42:15 -06:00
ZXShady 556ca510d4 Make ConvertEvent.hpp file in window module folder.
It is a window related module it makes more sense imo for it to be in it.

I also addded it to the cmake file so it appears in VIsual Studio
2024-10-03 10:33:51 -06:00
ZXShady 66e7af4993 check malloc return value for NULL and update docs
`sfFtpDirectoryResponse_getDirectory` can fail and return NULL becuase 'strdup' returns null on failure but `sfFtpDirectoryResponse_getDirectoryUnicode` didn't and just had UB due not checking return value of malloc.

typing NULL in the docs made me age 30 years btw
2024-09-29 11:51:53 -06:00
ZXShady b626f65ee5 Cast to larger type before doing arithmetic to avoid signed integer overflow
https://godbolt.org/z/soTad4zEq

this godbolt links shows that it is UB to multiply then cast if the amount is large enough
2024-09-28 19:45:28 -06:00
ZXShady f297287951 make static varaibles const via lamdbas
this pr also makes `sfSoundRecorder_getAvailableDevices` return a const pointer to a const char pointer so you can no longer modify where the pointers of the strings are pointing into becuase it doesn't make sense.
2024-09-28 19:21:25 -06:00
ZXShady ef81fbd337 use aggregate initialization 2024-09-27 18:42:48 -06:00
ZXShady 84f580e207 remove cstyle default init 2024-09-27 17:57:02 -06:00
ZXShady 4c818c31ed make sfTime const global variable 2024-09-27 15:11:41 -06:00
ZXShady 82e4518e93 remove unnecessary boolean comparson != 0 2024-09-27 14:41:21 -06:00
ZXShady 70397c6131 make sfRenderStates_default an extern const variable 2024-09-20 18:28:20 -05:00
ZXShady 5275e589f5 add missing asserts in Font.cpp 2024-09-18 11:32:03 -04:00
ZXShady ac477cf8b2 fix clang tidy warning about reserved identifier in WindowHandle.h 2024-09-18 11:24:01 -04:00
ZXShady 082a90ec4f use unique_ptr to handle memory of sfTexture 2024-09-18 10:52:21 -04:00