diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-06-03 14:01:31 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-03 15:09:09 +0200 |
commit | 628082158aecf3d5aeb8732d7ddf5dacc45e4d18 (patch) | |
tree | 50790dbdcccc3a55f433a102bce68d66d1845bf4 /soltools | |
parent | ff525d0d70ea9d189a430bde944b56d048b03e55 (diff) |
Revert "Better use size_t for malloc_size"
This reverts commit 652e4ee372e8939f48f69411b6326b237c6d9e4b. Turns out on
Windows read (aka _read) actually has a parameter of type unsigned, not size_t,
(<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-read?view=msvc-170>
"read"), so this started to cause
> C:/cygwin/home/tdf/jenkins/workspace/lo_tb_master_win64_dbg/soltools/mkdepend/main.c(504): error C2220: the following warning is treated as an error
> C:/cygwin/home/tdf/jenkins/workspace/lo_tb_master_win64_dbg/soltools/mkdepend/main.c(504): warning C4267: 'function': conversion from 'size_t' to 'unsigned int', possible loss of data
(<https://ci.libreoffice.org/job/lo_tb_master_win64_dbg/34368/>) for MSVC builds
targeting x64.
Change-Id: Ica821c8b32e225b7ebbfcbd33d8b7d55515ab3e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135270
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/mkdepend/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index 58633c830115..b8b84b453476 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -473,7 +473,7 @@ struct filepointer *getfile(char *file) struct stat st; off_t size_backup; ssize_t bytes_read; - size_t malloc_size; + unsigned malloc_size; content = (struct filepointer *)malloc(sizeof(struct filepointer)); if ((fd = open(file, O_RDONLY)) < 0) { @@ -486,7 +486,7 @@ struct filepointer *getfile(char *file) size_backup = st.st_size; malloc_size = size_backup; - /* Since off_t usually is larger than size_t, need to test for + /* Since off_t usually is larger than unsigned, need to test for * truncation. */ if ( (off_t)malloc_size != size_backup ) |