summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-07 11:53:17 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:19:43 +0200
commit7285e3f43c94010f09aa1b7a3ccbdbe7de1aa3e8 (patch)
tree75dac77a79fe666712ea73194211d0e996c8da2e /pp_pack.c
parente396d2357dcec18c01b1cc78d9edc80a3aa4066d (diff)
downloadperl-7285e3f43c94010f09aa1b7a3ccbdbe7de1aa3e8.tar.gz
Re-implement SHIFT16 and SHIFT32 as wrappers to SHIFT_BYTES.
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 4062832faa..98481f6cbf 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -129,26 +129,6 @@ typedef union {
# define OFF32(p) ((char *) (p))
#endif
-/* Only to be used inside a loop (see the break) */
-#define SHIFT16(utf8, s, strend, p, datumtype) STMT_START { \
- if (utf8) { \
- if (!uni_to_bytes(aTHX_ &(s), strend, OFF16(p), SIZE16, datumtype)) break; \
- } else { \
- Copy(s, OFF16(p), SIZE16, char); \
- (s) += SIZE16; \
- } \
-} STMT_END
-
-/* Only to be used inside a loop (see the break) */
-#define SHIFT32(utf8, s, strend, p, datumtype) STMT_START { \
- if (utf8) { \
- if (!uni_to_bytes(aTHX_ &(s), strend, OFF32(p), SIZE32, datumtype)) break; \
- } else { \
- Copy(s, OFF32(p), SIZE32, char); \
- (s) += SIZE32; \
- } \
-} STMT_END
-
#define PUSH16(utf8, cur, p) PUSH_BYTES(utf8, cur, OFF16(p), SIZE16)
#define PUSH32(utf8, cur, p) PUSH_BYTES(utf8, cur, OFF32(p), SIZE32)
@@ -173,6 +153,12 @@ STMT_START { \
} \
} STMT_END
+#define SHIFT16(utf8, s, strend, p, datumtype) \
+ SHIFT_BYTES(utf8, s, strend, OFF16(p), SIZE16, datumtype)
+
+#define SHIFT32(utf8, s, strend, p, datumtype) \
+ SHIFT_BYTES(utf8, s, strend, OFF32(p), SIZE32, datumtype)
+
#define SHIFT_VAR(utf8, s, strend, var, datumtype) \
SHIFT_BYTES(utf8, s, strend, &(var), sizeof(var), datumtype)