diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2024-08-04 17:01:38 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2024-08-06 15:17:48 +0100 |
commit | f0c79f8ef7dad65f43bd4227ee3479c0e278781f (patch) | |
tree | e095833f0dd248cdcf3ec34a31486494791e6fd2 /winsup/cygwin | |
parent | 696cd4ee021bac9ba26b13493d60c5840f50b9bb (diff) | |
download | newlib-f0c79f8ef7dad65f43bd4227ee3479c0e278781f.zip newlib-f0c79f8ef7dad65f43bd4227ee3479c0e278781f.tar.gz newlib-f0c79f8ef7dad65f43bd4227ee3479c0e278781f.tar.bz2 |
Cygwin: Fix warning about narrowing conversions in tape options
Fix a gcc 12 warning about a narrowing conversion in case labels for
tape options.
> In file included from /wip/cygwin/src/winsup/cygwin/include/sys/mtio.h:14,
> from ../../../../src/winsup/cygwin/fhandler/tape.cc:13:
> ../../../../src/winsup/cygwin/fhandler/tape.cc: In member function ‘int mtinfo_drive::set_options(HANDLE, int32_t)’:
> ../../../../src/winsup/cygwin/fhandler/tape.cc:965:12: error: narrowing conversion of ‘4026531840’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/fhandler/tape.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/local_includes/mtinfo.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler/tape.cc b/winsup/cygwin/fhandler/tape.cc index 0e235f1..732fd1b 100644 --- a/winsup/cygwin/fhandler/tape.cc +++ b/winsup/cygwin/fhandler/tape.cc @@ -894,9 +894,9 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get) } int -mtinfo_drive::set_options (HANDLE mt, int32_t options) +mtinfo_drive::set_options (HANDLE mt, uint32_t options) { - int32_t what = (options & MT_ST_OPTIONS); + uint32_t what = (options & MT_ST_OPTIONS); bool call_setparams = false; bool set; TAPE_SET_DRIVE_PARAMETERS sdp = diff --git a/winsup/cygwin/local_includes/mtinfo.h b/winsup/cygwin/local_includes/mtinfo.h index 03aabbf..46f8b1b 100644 --- a/winsup/cygwin/local_includes/mtinfo.h +++ b/winsup/cygwin/local_includes/mtinfo.h @@ -101,7 +101,7 @@ class mtinfo_drive int set_compression (HANDLE mt, int32_t count); int set_blocksize (HANDLE mt, DWORD count); int get_status (HANDLE mt, struct mtget *get); - int set_options (HANDLE mt, int32_t options); + int set_options (HANDLE mt, uint32_t options); int async_wait (HANDLE mt, DWORD *bytes_written); public: |