]> git.vpit.fr Git - perl/modules/Scope-Upper.git/commitdiff
Sort up Upper.xs
authorVincent Pit <vince@profvince.com>
Sun, 11 Jan 2009 11:27:15 +0000 (12:27 +0100)
committerVincent Pit <vince@profvince.com>
Sun, 11 Jan 2009 11:27:15 +0000 (12:27 +0100)
Upper.xs

index b7088ae0b622c6782e045972268d00b41db559af..8e7356d71207200ad0b2ba23af62046405cc3e3f 100644 (file)
--- a/Upper.xs
+++ b/Upper.xs
@@ -515,30 +515,7 @@ done:
  return depth;
 }
 
-#define SU_GET_LEVEL(A)  \
- if (items > A) {        \
-  SV *lsv = ST(A);       \
-  if (SvOK(lsv))         \
-   level = SvUV(lsv);    \
-  if (level < 0)         \
-   XSRETURN(0);          \
- }                       \
- if (level > cxstack_ix) \
-  level = cxstack_ix;
-
-#define SU_DOPOPTOCX(t)                    \
- STMT_START {                              \
-  I32 i, cxix = cxstack_ix, from = 0;      \
-  if (items)                               \
-   from = SvIV(ST(0));                     \
-  for (i = cxix - from; i >= 0; --i) {     \
-   if (CxTYPE(&cxstack[i]) == t) {         \
-    ST(0) = sv_2mortal(newSViv(cxix - i)); \
-    XSRETURN(1);                           \
-   }                                       \
-  }                                        \
-  XSRETURN_UNDEF;                          \
- } STMT_END
+/* --- Unwind stack -------------------------------------------------------- */
 
 typedef struct {
  I32 cxix;
@@ -580,6 +557,31 @@ STATIC void su_unwind(pTHX_ void *ud_) {
 
 /* --- XS ------------------------------------------------------------------ */
 
+#define SU_GET_LEVEL(A)  \
+ if (items > A) {        \
+  SV *lsv = ST(A);       \
+  if (SvOK(lsv))         \
+   level = SvUV(lsv);    \
+  if (level < 0)         \
+   XSRETURN(0);          \
+ }                       \
+ if (level > cxstack_ix) \
+  level = cxstack_ix;
+
+#define SU_DOPOPTOCX(t)                    \
+ STMT_START {                              \
+  I32 i, cxix = cxstack_ix, from = 0;      \
+  if (items)                               \
+   from = SvIV(ST(0));                     \
+  for (i = cxix - from; i >= 0; --i) {     \
+   if (CxTYPE(&cxstack[i]) == t) {         \
+    ST(0) = sv_2mortal(newSViv(cxix - i)); \
+    XSRETURN(1);                           \
+   }                                       \
+  }                                        \
+  XSRETURN_UNDEF;                          \
+ } STMT_END
+
 XS(XS_Scope__Upper_unwind); /* prototype to pass -Wmissing-prototypes */
 
 XS(XS_Scope__Upper_unwind) {