aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2017-12-30 00:53:28 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2017-12-30 00:53:28 +0000
commitdb09526533daf4cd4886195a5f752fc35c399168 (patch)
tree3acef022e0419a2525b97cf96da4bd57bc36f1cc /src
parentb29ef85867d5347e8fed4c603986964868cba801 (diff)
downloadsg3_utils-db09526533daf4cd4886195a5f752fc35c399168.tar.gz
minor cleanup (compile warnings) for Windows
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@739 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src')
-rw-r--r--src/sg_inq.c28
-rw-r--r--src/sg_raw.c17
-rw-r--r--src/sg_write_x.c12
3 files changed, 18 insertions, 39 deletions
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 0c5b9677..423c0fbf 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -46,7 +46,7 @@
#include "sg_pt_nvme.h"
#endif
-static const char * version_str = "1.79 20171227"; /* SPC-5 rev 17 */
+static const char * version_str = "1.80 20171229"; /* SPC-5 rev 17 */
/* INQUIRY notes:
* It is recommended that the initial allocation length given to a
@@ -4090,19 +4090,7 @@ err_out:
free(free_id_dinp);
return ret;
}
-
-#else
-
-static int
-do_nvme_identify(int pt_fd, const struct opts_t * op)
-{
- pr2serr("%s: not implemented, no <linux/nvme_ioctl.h>\n", __func__);
- if (op->do_verbose)
- pr2serr("Need to build on system with NVMe development headers "
- "(pt_fd=%d)\n", pt_fd);
- return 0;
-}
-#endif
+#endif /* HAVE_NVME */
int
@@ -4351,7 +4339,7 @@ main(int argc, char * argv[])
n = check_pt_file_handle(sg_fd, op->device_name, op->do_verbose);
if ((3 == n) || (4 == n)) { /* NVMe char or NVMe block */
ret = do_nvme_identify(sg_fd, op);
- goto fini;
+ goto fini2;
}
#endif
@@ -4365,7 +4353,7 @@ main(int argc, char * argv[])
ret = SG_LIB_CAT_OTHER;
} else
ret = 0;
- goto fini;
+ goto fini3;
}
#endif
@@ -4392,7 +4380,13 @@ main(int argc, char * argv[])
}
}
-fini:
+#ifdef HAVE_NVME
+fini2:
+#endif
+#if defined(SG_LIB_LINUX) && defined(SG_SCSI_STRINGS)
+fini3:
+#endif
+
err_out:
res = sg_cmds_close_device(sg_fd);
if (res < 0) {
diff --git a/src/sg_raw.c b/src/sg_raw.c
index 537b9b1d..9ea07065 100644
--- a/src/sg_raw.c
+++ b/src/sg_raw.c
@@ -32,22 +32,7 @@
#include "sg_pr2serr.h"
#include "sg_unaligned.h"
-#define SG_RAW_VERSION "0.4.19 (2017-12-06)"
-
-#ifdef SG_LIB_WIN32
-#ifndef HAVE_SYSCONF
-#include <windows.h>
-
-static size_t
-win_pagesize(void)
-{
- SYSTEM_INFO sys_info;
-
- GetSystemInfo(&sys_info);
- return sys_info.dwPageSize;
-}
-#endif
-#endif
+#define SG_RAW_VERSION "0.4.20 (2017-12-29)"
#define DEFAULT_TIMEOUT 20
#define MIN_SCSI_CDBSZ 6
diff --git a/src/sg_write_x.c b/src/sg_write_x.c
index 4effbde1..d5381d52 100644
--- a/src/sg_write_x.c
+++ b/src/sg_write_x.c
@@ -36,7 +36,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.09 20171222";
+static const char * version_str = "1.10 20171229";
/* Protection Information refers to 8 bytes of extra information usually
* associated with each logical block and is often abbreviated to PI while
@@ -1506,7 +1506,7 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[],
break;
case 'a':
j = sg_get_num(optarg);
- if ((j < 0) || (j > UINT16_MAX)) {
+ if ((j < 0) || (j > (int)UINT16_MAX)) {
pr2serr("bad argument to '--app-tag='. Expect 0 to 0xffff "
"inclusive\n");
return SG_LIB_SYNTAX_ERROR;
@@ -1515,7 +1515,7 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[],
break;
case 'A':
j = sg_get_num(optarg);
- if ((j < 0) || (j > UINT16_MAX)) {
+ if ((j < 0) || (j > (int)UINT16_MAX)) {
pr2serr("bad argument to '--atomic='. Expect 0 to 0xffff "
"inclusive\n");
return SG_LIB_SYNTAX_ERROR;
@@ -1720,7 +1720,7 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[],
break;
case 'S':
j = sg_get_num(optarg);
- if ((j < 0) || (j > UINT16_MAX)) {
+ if ((j < 0) || (j > (int)UINT16_MAX)) {
pr2serr("bad argument to '--scattered='. Expect 0 to 0xffff "
"inclusive\n");
return SG_LIB_SYNTAX_ERROR;
@@ -1731,7 +1731,7 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[],
break;
case 't': /* same as --tag-mask= */
j = sg_get_num(optarg);
- if ((j < 0) || (j > UINT16_MAX)) {
+ if ((j < 0) || (j > (int)UINT16_MAX)) {
pr2serr("bad argument to '--tag-mask='. Expect 0 to 0xffff "
"inclusive\n");
return SG_LIB_SYNTAX_ERROR;
@@ -1740,7 +1740,7 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[],
break;
case 'T': /* WRITE STREAM */
j = sg_get_num(optarg);
- if ((j < 0) || (j > UINT16_MAX)) {
+ if ((j < 0) || (j > (int)UINT16_MAX)) {
pr2serr("bad argument to '--stream=', expect 0 to 65535\n");
return SG_LIB_SYNTAX_ERROR;
}