diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2017-10-13 02:04:33 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2017-10-13 02:04:33 +0000 |
commit | 23712b6e6d5ee067cf7a740ef10e4dbea90dd179 (patch) | |
tree | c323728be100cf78adade4d95987826a5819fc7a /src/sg_rbuf.c | |
parent | 2715125260da177d9869321027ef22a9f49fde1b (diff) | |
download | sg3_utils-23712b6e6d5ee067cf7a740ef10e4dbea90dd179.tar.gz |
further two valued ints converted to bool
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@721 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_rbuf.c')
-rw-r--r-- | src/sg_rbuf.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sg_rbuf.c b/src/sg_rbuf.c index be6709aa..3b15d26c 100644 --- a/src/sg_rbuf.c +++ b/src/sg_rbuf.c @@ -57,7 +57,7 @@ #endif -static const char * version_str = "4.99 20171007"; +static const char * version_str = "5.00 20171010"; static struct option long_options[] = { {"buffer", required_argument, 0, 'b'}, @@ -350,24 +350,24 @@ process_cl(struct opts_t * optsp, int argc, char * argv[]) int main(int argc, char * argv[]) { +#ifdef SG_DEBUG + bool clear = true; +#endif + bool dio_incomplete = false; int sg_fd, res, j; + int buf_capacity = 0; + int buf_size = 0; + size_t psz; unsigned int k, num; - unsigned char rb_cdb [RB_CMD_LEN]; + int64_t total_size = RB_DEF_SIZE; + struct opts_t * op; unsigned char * rbBuff = NULL; void * rawp = NULL; unsigned char sense_buffer[32]; - int buf_capacity = 0; - int buf_size = 0; - int64_t total_size = RB_DEF_SIZE; - size_t psz; - int dio_incomplete = 0; + unsigned char rb_cdb [RB_CMD_LEN]; struct sg_io_hdr io_hdr; struct timeval start_tm, end_tm; -#ifdef SG_DEBUG - int clear = 1; -#endif struct opts_t opts; - struct opts_t * op; #if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) psz = sysconf(_SC_PAGESIZE); /* POSIX.1 (was getpagesize()) */ @@ -606,13 +606,13 @@ main(int argc, char * argv[]) } if (op->do_dio && ((io_hdr.info & SG_INFO_DIRECT_IO_MASK) != SG_INFO_DIRECT_IO)) - dio_incomplete = 1; /* flag that dio not done (completely) */ + dio_incomplete = true; /* flag that dio not done (completely) */ #ifdef SG_DEBUG if (clear) { for (j = 0; j < buf_size; ++j) { if (rbBuff[j] != 0) { - clear = 0; + clear = false; break; } } |