diff options
author | Karl Williamson <khw@cpan.org> | 2022-03-02 11:08:58 -0700 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-03-03 02:42:27 +0100 |
commit | ca0572d7d359fdfdcdfa2ef0624fe9b9da3af2d6 (patch) | |
tree | cd938dc4e8292e1aa2e973137e1ca257e7d49af9 /hv.h | |
parent | 198c4f174582886fed1dd36610fff68fbe836c8e (diff) | |
download | perl-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.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) \ |