summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-06 16:22:01 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:19:43 +0200
commitdf609c5f9dbf07fc7a18075911f5eaefdeea3ffd (patch)
treef7b07e3d3d8508015b6cbd9c6b1c9ea9c4e436f0 /pp_pack.c
parent3cc90e2e712615f2081743c38153954d60e3f0df (diff)
downloadperl-df609c5f9dbf07fc7a18075911f5eaefdeea3ffd.tar.gz
In pp_pack.c, refactor DO_BO_(UN)?PACK_N to use sizeof() on the variable.
Previously they were using sizeof() on the type argument passed to the macro. This change makes their implementation more like DO_BO_(UN)?PACK and DO_BO_(UN)?PACK_PTR.
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 2690b5562b..8a59e69307 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -270,14 +270,14 @@ S_mul128(pTHX_ SV *sv, U8 m)
# define DO_BO_UNPACK_N(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_LITTLE_ENDIAN) { \
- my_letohn(&var, sizeof(type)); \
+ my_letohn(&var, sizeof(var)); \
} \
} STMT_END
# define DO_BO_PACK_N(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_LITTLE_ENDIAN) { \
- my_htolen(&var, sizeof(type)); \
+ my_htolen(&var, sizeof(var)); \
} \
} STMT_END
@@ -314,14 +314,14 @@ S_mul128(pTHX_ SV *sv, U8 m)
# define DO_BO_UNPACK_N(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_BIG_ENDIAN) { \
- my_betohn(&var, sizeof(type)); \
+ my_betohn(&var, sizeof(var)); \
} \
} STMT_END
# define DO_BO_PACK_N(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_BIG_ENDIAN) { \
- my_htoben(&var, sizeof(type)); \
+ my_htoben(&var, sizeof(var)); \
} \
} STMT_END