Skip to content

Commit

Permalink
Silence some gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fish-Git committed Sep 10, 2018
1 parent c3bbcfe commit a8aa159
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
8 changes: 8 additions & 0 deletions ccfixme.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
#ifndef _CCFIXME_H_
#define _CCFIXME_H_

/*-------------------------------------------------------------------*/
/* Construct a GCC "version" constant for easier gcc version testing */
/*-------------------------------------------------------------------*/
#if defined( __GNUC__ )
#define GCC_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif

/*-------------------------------------------------------------------*/
/* Macros for issuing compiler messages */
/*-------------------------------------------------------------------*/
Expand Down
5 changes: 5 additions & 0 deletions ccnowarn.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
DISABLE_GCC_WARNING( "-Wmissing-field-initializers" )
DISABLE_GCC_WARNING( "-Wmissing-braces" )

#if defined( GCC_VERSION ) && GCC_VERSION >= 40800 /* gcc >= 4.8.0 */
/* Silence warnings about CASSERT macro usage within functions too */
DISABLE_GCC_WARNING( "-Wunused-local-typedefs" )
#endif

/*-----------------------------------------------------------------*/
/* define support for other compilers here */
/*-----------------------------------------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions ckddasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ int trks; /* #of tracks in CKD file */
int cyls; /* #of cylinders in CKD file */
int highcyl; /* Highest cyl# in CKD file */
char *cu = NULL; /* Specified control unit */
char *kw = NULL; /* Argument keyword */
int cckd=0; /* 1 if compressed CKD */
char filename[FILENAME_MAX]; /* work area for display */
char *strtok_str = NULL; /* save last position */
Expand Down Expand Up @@ -348,7 +347,7 @@ char *strtok_str = NULL; /* save last position */
if (strlen (argv[i]) > 3
&& memcmp("cu=", argv[i], 3) == 0)
{
kw = strtok_r (argv[i], "=", &strtok_str);
cu = strtok_r (argv[i], "=", &strtok_str);
cu = strtok_r (NULL, " \t", &strtok_str);
continue;
}
Expand Down Expand Up @@ -710,6 +709,7 @@ DEVBLK *dev = data; /* -> device block */

UNREFERENCED(answer);
CKD_CACHE_GETKEY(i, devnum, trk);
UNREFERENCED( trk ); // (silence "set but not used" warning)
if (dev->devnum == devnum)
cache_release (ix, i, CACHE_FREEBUF);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions comm3705.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ char group[16]; /* Console group */

if (len < sizeof(buf))
{
buf[len++] = IAC;
buf[len++] = (char) IAC;
}
else
{
Expand All @@ -757,7 +757,7 @@ char group[16]; /* Console group */

if (len < sizeof(buf))
{
buf[len++] = EOR_MARK;
buf[len++] = (char) EOR_MARK;
}
else
{
Expand Down
25 changes: 16 additions & 9 deletions tapedev.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,22 @@ CASSERT( sizeof(TAPERDC) == sizeof(((DEVBLK*)0)->devchar), tapedev_h );
/*-------------------------------------------------------------------*/
/* Helper macros to check RDC for feature support / enablement */
/*-------------------------------------------------------------------*/
#define TAPERDC_FEAT( feats, flags ) \
\
(CSWAP32(*((U32*)((TAPERDC*)&dev->devchar[0])->feats)) & (flags))

#define SIC_SUPPORTED() TAPERDC_FEAT( feats1, TRDC_SIC )
#define IDR_SUPPORTED() TAPERDC_FEAT( feats1, TRDC_IDR )
#define SVF_ENABLED() TAPERDC_FEAT( feats1, TRDC_SVF )
#define RDFWD_SUPPORTED() TAPERDC_FEAT( feats2, TRDC_RDFWD )
#define MEDSNS_SUPPORTED() TAPERDC_FEAT( feats2, TRDC_MEDSNS )
static inline bool is_tape_feat( const BYTE* feats, U32 flags )
{
U32 work;
memcpy( &work, feats, sizeof( U32 ));
return (CSWAP32( work ) & flags) ? true : false;
}

#define TAPERDC_FEATS1 &dev->devchar[0] + offsetof( TAPERDC, feats1 )
#define TAPERDC_FEATS2 &dev->devchar[0] + offsetof( TAPERDC, feats2 )

#define SIC_SUPPORTED() is_tape_feat( TAPERDC_FEATS1, TRDC_SIC )
#define IDR_SUPPORTED() is_tape_feat( TAPERDC_FEATS1, TRDC_IDR )
#define SVF_ENABLED() is_tape_feat( TAPERDC_FEATS1, TRDC_SVF )
#define RDFWD_SUPPORTED() is_tape_feat( TAPERDC_FEATS2, TRDC_RDFWD )
#define MEDSNS_SUPPORTED() is_tape_feat( TAPERDC_FEATS2, TRDC_MEDSNS )


/*-------------------------------------------------------------------*/
/* Definitions for 3420/3480 sense bytes */
Expand Down

0 comments on commit a8aa159

Please sign in to comment.