From: Father Chrysostomos Date: Sat, 18 Aug 2012 20:16:31 +0000 (-0700) Subject: Move S_CvDEPTHp from cv.h to inline.h; shrink macros X-Git-Tag: upstream/5.20.0~5692^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1afe1db112afcab7a87a011bd5c02cf0cc8ea95c;p=platform%2Fupstream%2Fperl.git Move S_CvDEPTHp from cv.h to inline.h; shrink macros This allows us to use assert() inside S_CvDEPTHp, so we no longer need GCC and non-GCC variants of the macro that calls it. --- diff --git a/cv.h b/cv.h index 36a3592..7c06727 100644 --- a/cv.h +++ b/cv.h @@ -61,22 +61,7 @@ See L. (CvFILE(sv) = CopFILE(cop), CvDYNFILE_off(sv)) #endif #define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))) -PERL_STATIC_INLINE I32 * -S_CvDEPTHp(const CV * const sv) -{ - return SvTYPE(sv) == SVt_PVCV - ? &((XPVCV*)SvANY(sv))->xcv_depth - : &((XPVCV*)SvANY(sv))->xpv_fmdepth; -} -#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) -# define CvDEPTH(sv) (*({const CV *const _cvdepth = (const CV *)sv; \ - assert(SvTYPE(_cvdepth) == SVt_PVCV \ - || SvTYPE(_cvdepth) == SVt_PVFM); \ - S_CvDEPTHp(_cvdepth); \ - })) -#else -# define CvDEPTH(sv) (*S_CvDEPTHp((const CV *)sv)) -#endif +#define CvDEPTH(sv) (*S_CvDEPTHp((const CV *)sv)) #define CvPADLIST(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_padlist #define CvOUTSIDE(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_outside #define CvFLAGS(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_flags diff --git a/inline.h b/inline.h index eee1097..2b988a2 100644 --- a/inline.h +++ b/inline.h @@ -12,6 +12,17 @@ * Each section names the header file that the functions "belong" to. */ +/* ------------------------------- cv.h ------------------------------- */ + +PERL_STATIC_INLINE I32 * +S_CvDEPTHp(const CV * const sv) +{ + assert(SvTYPE(sv) == SVt_PVCV || SvTYPE(sv) == SVt_PVFM); + return SvTYPE(sv) == SVt_PVCV + ? &((XPVCV*)SvANY(sv))->xcv_depth + : &((XPVCV*)SvANY(sv))->xpv_fmdepth; +} + /* ------------------------------- sv.h ------------------------------- */ PERL_STATIC_INLINE SV *