summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-03-02 11:08:58 -0700
committerYves Orton <demerphq@gmail.com>2022-03-03 02:42:27 +0100
commitca0572d7d359fdfdcdfa2ef0624fe9b9da3af2d6 (patch)
treecd938dc4e8292e1aa2e973137e1ca257e7d49af9 /hv.h
parent198c4f174582886fed1dd36610fff68fbe836c8e (diff)
downloadperl-ca0572d7d359fdfdcdfa2ef0624fe9b9da3af2d6.tar.gz
Add 'ASSERT_IS_LITERAL' macro
This is intended to make it obvious what this relatively obscure C construct is doing.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/hv.h b/hv.h
index c7aeb7de57..4e427b4a36 100644
--- a/hv.h
+++ b/hv.h
@@ -498,19 +498,19 @@ See L</hv_fill>.
* chars). See STR_WITH_LEN in handy.h - because these are macros we cant use
* STR_WITH_LEN to do the work, we have to unroll it. */
#define hv_existss(hv, key) \
- hv_exists((hv), ("" key ""), (sizeof(key)-1))
+ hv_exists((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1))
#define hv_fetchs(hv, key, lval) \
- hv_fetch((hv), ("" key ""), (sizeof(key)-1), (lval))
+ hv_fetch((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (lval))
#define hv_deletes(hv, key, flags) \
- hv_delete((hv), ("" key ""), (sizeof(key)-1), (flags))
+ hv_delete((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (flags))
#define hv_name_sets(hv, name, flags) \
- hv_name_set((hv),("" name ""),(sizeof(name)-1), flags)
+ hv_name_set((hv),ASSERT_IS_LITERAL(name),(sizeof(name)-1), flags)
#define hv_stores(hv, key, val) \
- hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
+ hv_store((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (val), 0)
#ifdef PERL_CORE
# define hv_storehek(hv, hek, val) \