From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 4/6] wstring: add helper is_wchar_type()
Date: Sat, 8 Aug 2020 18:11:41 +0200 [thread overview]
Message-ID: <20200808161143.28272-5-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200808161143.28272-1-luc.vanoostenryck@gmail.com>
Like is_byte_type() but for wide chars.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
symbol.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/symbol.h b/symbol.h
index 8e7a286019c7..0e15f7bf6ba8 100644
--- a/symbol.h
+++ b/symbol.h
@@ -430,6 +430,13 @@ static inline int is_byte_type(struct symbol *type)
return type->bit_size == bits_in_char && type->type != SYM_BITFIELD;
}
+static inline int is_wchar_type(struct symbol *type)
+{
+ if (type->type == SYM_NODE)
+ type = type->ctype.base_type;
+ return type == wchar_ctype;
+}
+
static inline int is_void_type(struct symbol *type)
{
if (type->type == SYM_NODE)
--
2.28.0
next prev parent reply other threads:[~2020-08-08 16:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-08 16:11 [PATCH 0/6] teach sparse about wide string initializers Luc Van Oostenryck
2020-08-08 16:11 ` [PATCH 1/6] wstring: add support for evaluation of wide string Luc Van Oostenryck
2020-08-08 16:11 ` [PATCH 2/6] wstring: add support for checking size in string initializer Luc Van Oostenryck
2020-08-08 16:11 ` [PATCH 3/6] wstring: add support for examination of string initialization Luc Van Oostenryck
2020-08-08 16:11 ` Luc Van Oostenryck [this message]
2020-08-08 16:11 ` [PATCH 5/6] wstring: extend is_string_type() to also detect wide strings Luc Van Oostenryck
2020-08-08 16:11 ` [PATCH 6/6] wstring: call is_string_type() only when needed Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200808161143.28272-5-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).