]> Kevux Git Server - rit/commit
mingw.c: Fix complier warnings for a 64 bit msvc
authorSören Krecker <soekkle@freenet.de>
Thu, 17 Oct 2024 17:18:20 +0000 (19:18 +0200)
committerTaylor Blau <me@ttaylorr.com>
Thu, 17 Oct 2024 18:42:27 +0000 (14:42 -0400)
commit386d372031a76e508591090b09630e1af72c5c9d
treed962948a7944fdac28625745df1a43743eef65d3
parent15030f9556f545b167b1879b877a5d780252dc16
mingw.c: Fix complier warnings for a 64 bit msvc

Remove some complier warnings from msvc in compat/mingw.c for value
truncation from 64 bit to 32 bit integers.

Compiling compat/mingw.c under a 64 bit version of msvc produces
warnings. An "int" is 32 bit, and ssize_t or size_t should be 64 bit
long. Prepare compat/vcbuild/include/unistd.h to have a 64 bit type
_ssize_t, when _WIN64 is defined and 32 bit otherwise.

Further down in this include file, as before, ssize_t is defined as
_ssize_t, if needed.

Use size_t instead of int for all variables that hold the result of
strlen() or wcslen() (which cannot be negative).

Use ssize_t to hold the return value of read().

Signed-off-by: Sören Krecker <soekkle@freenet.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
compat/compiler.h
compat/mingw.c
compat/vcbuild/include/unistd.h