From c0d5b4718e4d1c4fe2e5eeab31247acf1e7c2668 Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Wed, 15 Feb 2023 23:24:40 +0000 Subject: [PATCH] Nullability check for wctype module Bugs: b/245972273 Test: adb shell Change-Id: Ic60a1b77e3f16bc9c3808ab4f772d6f174116a75 --- libc/include/wctype.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libc/include/wctype.h b/libc/include/wctype.h index 58510ae75..7da2bb4f5 100644 --- a/libc/include/wctype.h +++ b/libc/include/wctype.h @@ -36,30 +36,30 @@ __BEGIN_DECLS #if __ANDROID_API__ >= 21 -int iswalnum_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswalpha_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswblank_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswcntrl_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswdigit_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswgraph_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswlower_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswprint_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswpunct_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswspace_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswupper_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -int iswxdigit_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); +int iswalnum_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswalpha_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswblank_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswcntrl_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswdigit_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswgraph_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswlower_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswprint_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswpunct_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswspace_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswupper_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswxdigit_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); -wint_t towlower_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); -wint_t towupper_l(wint_t __wc, locale_t __l) __INTRODUCED_IN(21); +wint_t towlower_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); +wint_t towupper_l(wint_t __wc, locale_t _Nonnull __l) __INTRODUCED_IN(21); #else // Implemented as static inlines before 21. #endif -wint_t towctrans_l(wint_t __wc, wctrans_t __transform, locale_t __l) __INTRODUCED_IN(26); -wctrans_t wctrans_l(const char* __name, locale_t __l) __INTRODUCED_IN(26); +wint_t towctrans_l(wint_t __wc, wctrans_t _Nonnull __transform, locale_t _Nonnull __l) __INTRODUCED_IN(26); +wctrans_t _Nonnull wctrans_l(const char* _Nonnull __name, locale_t _Nonnull __l) __INTRODUCED_IN(26); -wctype_t wctype_l(const char* __name, locale_t __l) __INTRODUCED_IN(21); -int iswctype_l(wint_t __wc, wctype_t __transform, locale_t __l) __INTRODUCED_IN(21); +wctype_t wctype_l(const char* _Nonnull __name, locale_t _Nonnull __l) __INTRODUCED_IN(21); +int iswctype_l(wint_t __wc, wctype_t __transform, locale_t _Nonnull __l) __INTRODUCED_IN(21); __END_DECLS