aboutsummaryrefslogtreecommitdiff
path: root/include/sg_unaligned.h
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-02-19 05:55:24 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-02-19 05:55:24 +0000
commit39ea1b548f21c006c311ace897b221b100bfa88d (patch)
tree764ecee434b161b62c41182a6bc09ce950b85258 /include/sg_unaligned.h
parent5bdce507b09d32f452a390c22cb98ae7f840c151 (diff)
downloadsg3_utils-39ea1b548f21c006c311ace897b221b100bfa88d.tar.gz
sg_raw: add --raw option (for CF in binary); sg_lib: add sg_get_nvme_opcode_name() and sg_is_aligned(); sg_vpd: fully implement Device Constituents vpage
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@753 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include/sg_unaligned.h')
-rw-r--r--include/sg_unaligned.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sg_unaligned.h b/include/sg_unaligned.h
index 3b2c70ae..0a5c92f1 100644
--- a/include/sg_unaligned.h
+++ b/include/sg_unaligned.h
@@ -2,7 +2,7 @@
#define SG_UNALIGNED_H
/*
- * Copyright (c) 2014-2017 Douglas Gilbert.
+ * Copyright (c) 2014-2018 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
@@ -46,8 +46,8 @@ static inline uint64_t __get_unaligned_be64(const uint8_t *p)
static inline void __put_unaligned_be16(uint16_t val, uint8_t *p)
{
- *p++ = val >> 8;
- *p++ = val;
+ *p++ = (uint8_t)(val >> 8);
+ *p++ = (uint8_t)val;
}
static inline void __put_unaligned_be32(uint32_t val, uint8_t *p)