Skip to content

Commit

Permalink
Cygwin: Fix warning about narrowing conversions in tape options
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jon-turney committed Aug 6, 2024
1 parent 696cd4e commit f0c79f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions winsup/cygwin/fhandler/tape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion winsup/cygwin/local_includes/mtinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f0c79f8

Please sign in to comment.