Pierre Ossman
5c1ac16776
Return static char buffer from some methods
This mimics how some system functions (like inet_ntop()) work, and
avoids complexity around ownership of the returned string buffer.
The downside is that the string must be consumed directly as it will be
overwritten on the next call, but that is not an issue with the current
usage.
1 year ago
Pierre Ossman
1af2a56f75
Replace tabs with spaces
Use the same indentation we use in all other files.
1 year ago
Pierre Ossman
818694ba6a
Use string literal instead of dynamic buffer
These don't need to be changed, so let's just keep it simple with a
constant string literal.
1 year ago
Pierre Ossman
51347ef875
Remove unneded string duplication
It's unclear why this was initially added. The function takes string
constants, so it is not going to modify these.
1 year ago
Pierre Ossman
7f20bff356
Remove unneeded CharArray:s
Avoid complicating things by moving things in to a second buffer here as
there is no need for it.
1 year ago
Pierre Ossman
741300728a
Use StringParameters directly
We don't need to make extra copies of the string in most cases, so let's
simplify the code and access the string directly when we can.
1 year ago
Pierre Ossman
77f0a61ec8
Get rid of TCHAR magic
We never use Windows' "UNICODE" mode anyway, so let's get rid of this
complexity.
1 year ago
Pierre Ossman
2047dae22f
Return std::vector instead of dynamic allocation
This makes memory management more clear and robust when using these
helper functions.
1 year ago
Pierre Ossman
ea6afa9b79
Avoid duplicating configuration setting
Let the string helpers call the more fancy setParam(). This makes sure
we can avoid duplicating things.
1 year ago
Pierre Ossman
cee09051e6
Make sure length is reset on assignment
Otherwise the old length is preserved, which will result in NULL pointer
dereferencing if the parameter is ever accessed.
1 year ago
Pierre Ossman
cf931f8c9a
Clean up BinaryParameter typing
This is explicitly a byte sequence, so let's try to keep a consistent
typing.
1 year ago
Pierre Ossman
07e541678c
Move hex conversion helpers to util
These are used here and there so let's make them more general rather
than hiding them in the stream classes.
1 year ago
Fabio T
4895f53aef
Update Friulian translation
1 year ago
Pierre Ossman
d98720b736
Use std::vector for basic data arrays
Avoid our own custom types in favour of what's already included with
C++.
1 year ago
Pierre Ossman
6881c895ab
Use stdint types
Avoid having our own custom stuff and instead use the modern, standard
types, for familiarity.
1 year ago
Pierre Ossman
baca73d032
Use templates for optimized code
Avoid preprocessor magic and instead rely on templating to generate
optimized functions for performance critical code.
1 year ago
Pierre Ossman
cb4f920199
Remove old mingw CMake checks
This should have been removed with the code using these defines in
03ca975
.
1 year ago
Pierre Ossman
bf0fb9129d
Fix CRLF line endings
Everything else uses LF line endings, so fix up the few stray ones.
1 year ago
Pierre Ossman
a434ef3377
Merge branch 'libtool' of https://github.com/CendioOssman/tigervnc
1 year ago
Pierre Ossman
0043c557fc
Create .la files at the end of the cmake run
We might not have all the necessary information, e.g. all targets might
not exist yet, until we're done going through all CMakeLists.
1 year ago
Pierre Ossman
11ebff62d7
Bail on missing libraries
They may be crucial, so refuse to continue if this happens.
1 year ago
Pierre Ossman
e78ebbcb19
Fall back to dynamic libraries in .la files
This is what the linker does, so we should do the same for correct
behaviour.
1 year ago
Pierre Ossman
651e763338
Respect library search paths
Things might be in odd places, so make sure we respect where we're told
to look for libraries.
1 year ago
Pierre Ossman
b1943de686
Include other targets in .la files
We have internal dependencies that should be respected, as otherwise it
will be up to the user of the .la file to figure out the correct order
of the libraries.
1 year ago
Pierre Ossman
e41b082928
Handle alternative library suffixes
I think this only affects macOS at the moment where they also have .tbd
files for linking.
1 year ago
Pierre Ossman
6ff7f2e54b
Make sure frameworks are included in .la files
We don't really use the .la files for macOS at the moment, but let's try
to be prepared.
1 year ago
Pierre Ossman
f2a89fbec8
Remove unnecessary regexp \\
This serves no useful purpose as we have no reason to suspect there will
be a dangerous first character in these variables.
1 year ago
Pierre Ossman
d25c04808f
Fix static library check regexp
Not sure how the old one ever worked as it incorrectly just tried to
match last character and nothing else.
1 year ago
Pierre Ossman
533bf22864
Get target libraries from INTERFACE_LINK_LIBRARIES
<target>_LIB_DEPENDS is an internal variable that contains lots of other
weird stuff.
1 year ago
Pierre Ossman
c293cbdf9e
Use correct FATAL_ERROR CMake option
1 year ago
Pierre Ossman
27262aeabf
Merge branch 'wextra' of https://github.com/CendioOssman/tigervnc
1 year ago
Pierre Ossman
7a36fb8ca7
Use __attribute__:s directly
These are supported by gcc and clang, and I don't think MSVC works well
with our code anyway, so let's keep things simple and use these
directly.
1 year ago
Pierre Ossman
ebfd56106d
Enable more warnings by default
These are also useful warnings that tend to find real bugs, so let's
enable then.
The downside is they require us to mark certain things so the compiler
knows if they were on purpose or not.
1 year ago
Pierre Ossman
36f3690b09
Work around -Wcast-function-type
That warning doesn't play well with Windows' GetProcAddress(), so add
some extra casting to work around it.
1 year ago
Pierre Ossman
03ca97526b
Remove old mingw compatibility code
This isn't needed with modern build environments, and can even conflict
with them.
1 year ago
Pierre Ossman
21c57423ae
Don't partially init monitor information
gcc will complain, and we will fill out all fields later anyway.
1 year ago
Pierre Ossman
1d1f16f4ac
Fix incorrect types
These types caused an incorrect signed/unsigned behaviour, so let's make
sure we use the appropriate type.
1 year ago
Pierre Ossman
11b535fcc8
Fix order of qualifiers
gcc can get upset if they aren't in this order.
1 year ago
Pierre Ossman
cdec36858e
Protect key variables from setjmp()
If we don't mark these as volatile then they might get reset on
longjmp() and the code will misbehave.
1 year ago
Pierre Ossman
e75051a62a
Remove useless const specifiers
These are just values, so setting const on them has no effect as the
caller will get a copy.
1 year ago
Pierre Ossman
642a6b2445
Remove useless checks
These are all truisms because of the valid range of the types.
1 year ago
Pierre Ossman
23cabcaa9e
Explicitly mark switch case fall through
This allows us to separate accidental fall through from explicit ones,
which allows us to turn on such checks in the compiler.
1 year ago
Pierre Ossman
e866c7de65
Fix RSA-AES state machines
If there isn't enough data, then the client reading the hash will fall
down and try to read the subtype instead, which isn't correct.
Invert the logic so we get a more consistent way through where we only
break out when there is insufficient data.
Do the same for the server code, for consistency.
1 year ago
Yuri Kozlov
4701b05b78
Update Russian translation
1 year ago
Pierre Ossman
eb684b9979
Add missing breaks to Windows key grab code
These were not meant to fall through. Likely didn't have any adverse
effects, but let's fix it anyway.
1 year ago
Pierre Ossman
3a1c46ff75
Explicitly mark unused parameters
This allows us to separate accidentally unused, from explicitly unused
parameters, which allows us to turn on such checks in the compiler.
1 year ago
Pierre Ossman
225e1516f9
Respect given server name
No practical difference currently, but let's respect what this API was
supposed to do.
1 year ago
Pierre Ossman
3f98b29bd7
Don't include unused file path parameter
1 year ago
Pierre Ossman
a4fa1d7188
Don't include palette to full color methods
They have no need for it, so let's simplify things.
1 year ago
Pierre Ossman
01afd4a74d
Remove unused flags to decoder contexts
Everything in flags is already handled at a higher level.
1 year ago