summaryrefslogtreecommitdiff
path: root/hv_macro.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-06-23 17:04:58 -0700
committerPaul Evans <leonerd@leonerd.org.uk>2022-12-13 12:59:04 +0000
commit1829598c6e4e29da89d73624e461aaffd983fde3 (patch)
tree8cf466ee9f1029ecdfdf12bffb15b3e753f90d50 /hv_macro.h
parent84fa78b4832e64bc0dfc0ea25843d48b4d9782c7 (diff)
downloadperl-1829598c6e4e29da89d73624e461aaffd983fde3.tar.gz
Do not cast away constness
Fix most compiler warnings caused by building Perl extensions with -Wcast-qual. This is realized by changing the type of multiple T * arguments into const T * and by changing a few (T *) casts into (const T *).
Diffstat (limited to 'hv_macro.h')
-rw-r--r--hv_macro.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hv_macro.h b/hv_macro.h
index 3f75cdb860..c052653c35 100644
--- a/hv_macro.h
+++ b/hv_macro.h
@@ -30,7 +30,7 @@
*/
#ifndef U8TO16_LE
- #define _shifted_octet(type,ptr,idx,shift) (((type)(((U8*)(ptr))[(idx)]))<<(shift))
+ #define _shifted_octet(type,ptr,idx,shift) (((type)(((const U8*)(ptr))[(idx)]))<<(shift))
#if defined(USE_UNALIGNED_PTR_DEREF) && (BYTEORDER == 0x1234 || BYTEORDER == 0x12345678)
#define U8TO16_LE(ptr) (*((const U16*)(ptr)))
#define U8TO32_LE(ptr) (*((const U32*)(ptr)))