Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned up aTHX_ useage and some minor warnings.

Signed-off-by: Yuval Kogman <nothingmuch@woobling.org>
  • Loading branch information...
commit d4eb351926d7d4f5f925a838253dd4eb2b533ed2 1 parent 60839a3
Kartik Thakore authored July 09, 2010 nothingmuch committed July 13, 2010

Showing 1 changed file with 13 additions and 8 deletions. Show diff stats Hide diff stats

  1. 21  XS.xs
21  XS.xs
@@ -8,6 +8,11 @@
8 8
 
9 9
 #include "devel_stacktrace_xs.h"
10 10
 
  11
+#ifndef aTHX_
  12
+#define aTHX_
  13
+#endif
  14
+
  15
+
11 16
 #define SAVE_ERR 0x01
12 17
 #define SAVE_ARGS 0x02
13 18
 #define SAVE_CV 0x04
@@ -156,7 +161,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
156 161
     struct frames_info *fi;
157 162
     AV *refcounted = NULL;
158 163
 
159  
-    cxix = dopoptosub_at(cxstack, cxstack_ix);
  164
+    cxix = dopoptosub_at(aTHX_ cxstack, cxstack_ix);
160 165
 
161 166
     count = 0-uplevel;
162 167
 
@@ -165,7 +170,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
165 170
         while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
166 171
             top_si = top_si->si_prev;
167 172
             ccstack = top_si->si_cxstack;
168  
-            cxix = dopoptosub_at(ccstack, top_si->si_cxix);
  173
+            cxix = dopoptosub_at(aTHX_ ccstack, top_si->si_cxix);
169 174
         }
170 175
 
171 176
         if (cxix < 0)
@@ -175,7 +180,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
175 180
         if (!PL_DBsub || !GvCV(PL_DBsub) || ccstack[cxix].blk_sub.cv != GvCV(PL_DBsub))
176 181
             count++;
177 182
 
178  
-        cxix = dopoptosub_at(ccstack, cxix - 1);
  183
+        cxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
179 184
     }
180 185
 
181 186
     if ( count <= 0 )
@@ -197,7 +202,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
197 202
         }
198 203
     }
199 204
 
200  
-    cxix = dopoptosub_at(cxstack, cxstack_ix);
  205
+    cxix = dopoptosub_at(aTHX_ cxstack, cxstack_ix);
201 206
     ccstack = cxstack;
202 207
     i = 0;
203 208
     skip = uplevel;
@@ -206,7 +211,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
206 211
         while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
207 212
             top_si = top_si->si_prev;
208 213
             ccstack = top_si->si_cxstack;
209  
-            cxix = dopoptosub_at(ccstack, top_si->si_cxix);
  214
+            cxix = dopoptosub_at(aTHX_ ccstack, top_si->si_cxix);
210 215
         }
211 216
 
212 217
         if (cxix < 0)
@@ -258,7 +263,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
258 263
 
259 264
                         if ( save_refs & SAVE_CV ) {
260 265
                             if ( flags & STRINGIFY_CV ) {
261  
-                                av_push(refcounted, cv_name(cx->blk_sub.cv));
  266
+                                av_push(refcounted, cv_name(aTHX_ cx->blk_sub.cv));
262 267
                             } else {
263 268
                                 av_push(refcounted, SvREFCNT_inc((SV *)cx->blk_sub.cv));
264 269
                             }
@@ -272,7 +277,7 @@ build_trace (pTHX_ const I32 uplevel, const I32 flags) {
272 277
             }
273 278
         }
274 279
 
275  
-        cxix = dopoptosub_at(ccstack, cxix - 1);
  280
+        cxix = dopoptosub_at(aTHX_ ccstack, cxix - 1);
276 281
     }
277 282
 
278 283
     Newx(fi, 1, struct frames_info);
@@ -452,7 +457,7 @@ _get_raw_frames (self)
452 457
 
453 458
                     EXTEND(SP, fi->count);
454 459
                     for ( i = 0; i < fi->count; i++ ) {
455  
-                        AV *caller = frame_to_caller(i, fi);
  460
+                        AV *caller = frame_to_caller(aTHX_ i, fi);
456 461
                         AV *args = (CxHASARGS(&fi->frames[i]) && (fi->flags & SAVE_ARGS) ? 1 : 0 )
457 462
                             ? (AV *)*av_fetch(fi->refcounted, fi->frames[i].offset, FALSE)
458 463
                             : newAV();

0 notes on commit d4eb351

Please sign in to comment.
Something went wrong with that request. Please try again.