Commit Graph

865 Commits

Author SHA1 Message Date
akallabeth
4732f379d4 [winpr,sysinfo] unify time function use
* Add new function winpr_GetTickCount64NS for high resolution tick
  count with (up to) nanosecond resolution
* Add new function winpr_GetUnixTimeNS for high resolution system time
  as nanoseconds since 1.1.1970
* Replace use of clock_gettime and gettimeofday in whole project with
  these new functions
* Add new macros WINPR_TIME_NS_TO_* and WINPR_TIME_NS_REM_* to convert
  the nano second count to less resolution or get the remainder in the
  desired resolution
2024-03-11 09:54:10 +01:00
akallabeth
d8c0e7546e [winpr,utils] allow quoted sub arguments
fixes #9890.
2024-02-27 14:15:56 +01:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
Armin Novak
894474b161 [winpr,utils] improve winpr image API
* Add checks for bitmap read functions
* Add more unit tests
* Do not expose internals to WinPR
2024-02-22 09:33:59 +01:00
akallabeth
b894199f72 [winpr,collections] add generic string clone functions
The ArrayList, HashTable, ... New functions require
void* (*fkt)(const void* ptr) type functions. Provide a generic wrapper
for CHAR and WCHAR strdup to eliminate warnings. Also export a
corresponding free function to avoid issues with runtime
differences.
2024-02-15 11:49:16 +01:00
akallabeth
d0dc657412 [build] delete unused static functions 2024-02-15 11:49:16 +01:00
akallabeth
81d2c1f057 [clang-tidy] clang-analyzer-core.NullDereference 2024-02-15 11:49:16 +01:00
akallabeth
f69e1fe697 [clang-tidy] readability-duplicate-include 2024-02-15 11:49:16 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
Armin Novak
70f12ac871 [winpr,image] use fuzzy compare
* Add winpr_image_equal_ex to allow comparison of lossy compressed
  formats, ignoring color depth and alpha
* Adjust tests to utilize winpr_image_equal_ex
2024-02-14 19:04:50 +01:00
akallabeth
cbab66a249 [warnings] fix incompatible pointer types 2024-02-12 10:23:27 +01:00
akallabeth
78818aec34 [client,sdl] enable screensaver
by default sdl disables screensaver.
2024-02-09 10:29:08 +01:00
akallabeth
b5660035ae [winpr,image] add support for WebP, JPEG and libpng 2024-02-07 10:04:08 +01:00
akallabeth
2fffcd64b9 [winpr] use winpr_strerror instead of strerror
use the wrapper from WinPR to use the best implementation available.
2024-02-06 15:45:47 +01:00
akallabeth
c415ec1110 [winpr,utils] use strerror_s or strerror_r
prefer to use strerror_s over strerror_r and strerror to convert errno
to strings.
2024-02-06 15:45:47 +01:00
akallabeth
ba8cf8cf21 [build] fix Wmismatched-deallocator warnings
With custom malloc function attributes the fail path in the _New
functions produces warnings due to allocator mismatches. Silence them.
2024-02-05 08:16:55 +01:00
akallabeth
bb42d425ed [gcc,clang] add support for attribute(malloc)
Mark all malloc like functions and add their appropriate free function
to let the compiler complain on mismatches
2024-02-02 15:10:40 +01:00
akallabeth
1b31852d32 [git] remove .gitignore
we do no longer allow in source builds, so remove all the .gitignore
files just hiding generated files
2023-11-28 12:14:55 +01:00
akallabeth
13b44b8b77 [ifdef] properly check for defined 2023-11-10 09:58:23 +01:00
Armin Novak
60390ea40c [pragma] unify compiler diagnostics 2023-10-16 15:10:13 +02:00
Armin Novak
c91a250623 [warnings] add WINPR_FORMAT_ARG
with WINPR_FORMAT_ARG format strings are marked for MSVC to avoid
warnings
2023-10-16 15:10:13 +02:00
Armin Novak
07543a6042 [warnings] fix various warnings
* missing const in casts
* missing static for functions
* missing WINPR_ATTR_FORMAT_ARG for printf like functions
2023-10-16 15:10:13 +02:00
Armin Novak
9f7cfe51ba [pubsub] fix API definitons to avoid warnings 2023-10-16 15:10:13 +02:00
akallabeth
25f3633dc5 [systemd] moved detection to module 2023-10-10 22:59:53 +02:00
akallabeth
184e006ce5 [winpr,cmdline] fix unquoting of value
Comma separated lists of form 'a,b,\"b,c,d\"' were not correctly parsed
as the trailing quote was not consumed.
2023-09-21 10:38:30 +02:00
akallabeth
a94e14fb22 [winpr,wlog] fix format string for %fn 2023-09-11 14:20:10 +02:00
akallabeth
4e824b243f [winpr] add WINPR_ATTR_FORMAT_ARG
this macro declares the function argument (pos,arg) to be a printf
style format string and enables compiler checks for that.
2023-08-25 12:56:36 +02:00
Armin Novak
bd79d8f100 [winpr,rdtk] use png only if supported by winpr
rdtk compiles in bitmaps of fonts. if png format is supported by winpr,
prefer the png images, otherwise use bmp
2023-07-31 20:18:48 +02:00
Armin Novak
35915d3e22 [winpr] fix various warnings 2023-07-31 08:32:43 +02:00
Armin Novak
4f7a3762ae [winpr] fix cast warnings 2023-07-28 13:42:12 +02:00
Armin Novak
61625f1a2a [winpr,utils] fix cast warnings 2023-07-28 13:42:12 +02:00
Armin Novak
f2aa469700 [winpr,collections] fix cast warnings 2023-07-28 13:42:12 +02:00
Armin Novak
20653aee1d [winpr,ini] fix cast warnings 2023-07-28 13:42:12 +02:00
Armin Novak
e61880d077 [standard] replace __FUNCTION__ with __func__ 2023-07-27 20:02:43 +02:00
Armin Novak
605b6b6233 [cmake] build using external lodepng 2023-07-26 20:19:46 +02:00
akallabeth
ee078cdda4 [warnings] fix format string warnings 2023-07-20 14:20:28 +02:00
akallabeth
2521d151e5 [winpr,wlog] added %{ %} formatter
* New formatter %{xxx%} which conditionally prints xxx if the context is
  not NULL
2023-07-06 15:51:56 +02:00
akallabeth
1f3f3682cc [build] fix conversion warnings 2023-07-05 08:46:00 +02:00
Armin Novak
40ecb1df25 [winpr,ini] documentation and parameter to size_t
* document the IniFile_* fucntions
* Use size_t for size parameters
2023-06-29 14:46:41 +02:00
Armin Novak
21ea8556ce [winpr,ini] remove FILE* from struct
When reading files the FILE* is closed immediately, so this was just
confusing
2023-06-29 14:46:41 +02:00
Armin Novak
58087e544f [winpr,ini] unify buffer allocation 2023-06-29 14:46:41 +02:00
Armin Novak
37e5e2223e [winpr,ini] unify filename setting 2023-06-29 14:46:41 +02:00
Armin Novak
eb6230a563 [winpr,ini] assert arguments 2023-06-29 14:46:41 +02:00
Armin Novak
c717380020 [winpr,ini] unify reallocation of ini sections and keys 2023-06-29 14:46:41 +02:00
akallabeth
0d3b2dd3c3 [tests] fixed format strings 2023-06-29 14:30:09 +02:00
akallabeth
d0456914e5 [winpr,wlog] extend wLog to allow logging custom data
A logger allocated with WLog_Get now can have a customized context by
setting it with WLog_SetContext. Along with the newly introduced format
specifier %ctx an additional field is printed for the context.
2023-06-29 14:30:09 +02:00
akallabeth
3f78b3c379 [build] fix unused compiler warnings 2023-06-28 09:45:09 +02:00
akallabeth
0c15f72169 [winpr,collections] fixes for ListDictionary
* Make ListDictionary_Add and ListDictionary_SetItemValue arguments
  const
* Allow ListDictionary_Add to store NULL values
2023-06-28 08:19:20 +02:00
Armin Novak
b8a0091c92 [winpr,utils] add IniFile_Clone 2023-06-27 17:36:57 +02:00