diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2013-05-08 13:21:30 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2013-05-08 13:21:30 +0000 |
commit | 02ec79b083e6bd32b71937f0b3b6b0108769c184 (patch) | |
tree | cfdea6d63740f214ba6de984af36df0df265587d /lib | |
parent | eac58c25208cc3d1ef6a7f4feaf711c161350451 (diff) | |
download | sg3_utils-02ec79b083e6bd32b71937f0b3b6b0108769c184.tar.gz |
sg_xcopy: add --on_src and --on_dst options; C++ cleanup
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@494 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/Makefile.in | 3 | ||||
-rw-r--r-- | lib/sg_cmds_basic.c | 4 | ||||
-rw-r--r-- | lib/sg_lib.c | 12 | ||||
-rw-r--r-- | lib/sg_lib_data.c | 2 | ||||
-rw-r--r-- | lib/sg_pt_linux.c | 6 |
6 files changed, 17 insertions, 12 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 14e1c3f0..f23668f9 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -138,6 +138,8 @@ EXTRA_libsgutils2_la_SOURCES = \ endif +# For C++ testing +# CC = g++ # -std=<s> can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same) AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W diff --git a/lib/Makefile.in b/lib/Makefile.in index 95b4eb99..f315a8b9 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -397,6 +397,9 @@ top_srcdir = @top_srcdir@ @OS_WIN32_MINGW_TRUE@ getopt_long.c +# For C++ testing +# CC = g++ + # -std=<s> can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same) AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W # AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -pedantic -std=c99 diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c index 2c4b9448..fbbb774e 100644 --- a/lib/sg_cmds_basic.c +++ b/lib/sg_cmds_basic.c @@ -27,7 +27,7 @@ #endif -static char * version_str = "1.61 20130311"; +static const char * version_str = "1.61 20130507"; #define SENSE_BUFF_LEN 64 /* Arbitrary, could be larger */ @@ -100,7 +100,7 @@ sg_cmds_process_helper(const char * leadin, int mx_di_len, int resid, case SG_LIB_CAT_RECOVERED: case SG_LIB_CAT_MEDIUM_HARD: ++check_data_in; - /* drop through */ + /* drop through */ case SG_LIB_CAT_UNIT_ATTENTION: default: n = noisy; diff --git a/lib/sg_lib.c b/lib/sg_lib.c index 9e49392d..748d9831 100644 --- a/lib/sg_lib.c +++ b/lib/sg_lib.c @@ -1685,9 +1685,9 @@ sg_get_num(const char * buf) return num * 1073741824; return -1; case 'X': - cp = strchr(buf, 'x'); + cp = (char *)strchr(buf, 'x'); if (NULL == cp) - cp = strchr(buf, 'X'); + cp = (char *)strchr(buf, 'X'); if (cp) { n = sg_get_num(cp + 1); if (-1 != n) @@ -1712,12 +1712,12 @@ sg_get_num_nomult(const char * buf) { int res, len, num; unsigned int unum; - const char * commap; + char * commap; if ((NULL == buf) || ('\0' == buf[0])) return -1; len = strlen(buf); - commap = strchr(buf + 1, ','); + commap = (char *)strchr(buf + 1, ','); if (('0' == buf[0]) && (('x' == buf[1]) || ('X' == buf[1]))) { res = sscanf(buf + 2, "%x", &unum); num = unum; @@ -1817,9 +1817,9 @@ sg_get_llnum(const char * buf) return num * 1099511627776LL * 1024; return -1LL; case 'X': - cp = strchr(buf, 'x'); + cp = (char *)strchr(buf, 'x'); if (NULL == cp) - cp = strchr(buf, 'X'); + cp = (char *)strchr(buf, 'X'); if (cp) { ll = sg_get_llnum(cp + 1); if (-1LL != ll) diff --git a/lib/sg_lib_data.c b/lib/sg_lib_data.c index c4200527..bc3b6216 100644 --- a/lib/sg_lib_data.c +++ b/lib/sg_lib_data.c @@ -15,7 +15,7 @@ #endif -const char * sg_lib_version_str = "1.81 20130307"; /* spc4r36, sbc3r32 */ +const char * sg_lib_version_str = "1.82 20130507"; /* spc4r36, sbc3r32 */ #ifdef SG_SCSI_STRINGS struct sg_lib_value_name_t sg_lib_normal_opcodes[] = { diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c index b5390577..cf1f6ada 100644 --- a/lib/sg_pt_linux.c +++ b/lib/sg_pt_linux.c @@ -5,7 +5,7 @@ * license that can be found in the BSD_LICENSE file. */ -/* sg_pt_linux version 1.18 20130120 */ +/* sg_pt_linux version 1.19 20130507 */ #include <stdio.h> @@ -910,7 +910,7 @@ do_scsi_pt_v3(struct sg_pt_linux_scsi * ptp, int fd, int time_secs, /* convert v4 to v3 header */ v3_hdr.interface_id = 'S'; v3_hdr.dxfer_direction = SG_DXFER_NONE; - v3_hdr.cmdp = (void *)(long)ptp->io_hdr.request; + v3_hdr.cmdp = (unsigned char *)(long)ptp->io_hdr.request; v3_hdr.cmd_len = (unsigned char)ptp->io_hdr.request_len; if (ptp->io_hdr.din_xfer_len > 0) { if (ptp->io_hdr.dout_xfer_len > 0) { @@ -927,7 +927,7 @@ do_scsi_pt_v3(struct sg_pt_linux_scsi * ptp, int fd, int time_secs, v3_hdr.dxfer_direction = SG_DXFER_TO_DEV; } if (ptp->io_hdr.response && (ptp->io_hdr.max_response_len > 0)) { - v3_hdr.sbp = (void *)(long)ptp->io_hdr.response; + v3_hdr.sbp = (unsigned char *)(long)ptp->io_hdr.response; v3_hdr.mx_sb_len = (unsigned char)ptp->io_hdr.max_response_len; } v3_hdr.pack_id = (int)ptp->io_hdr.spare_in; |