ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Devel-FindRef/FindRef.xs
(Generate patch)

Comparing Devel-FindRef/FindRef.xs (file contents):
Revision 1.17 by root, Wed Jul 1 08:25:04 2009 UTC vs.
Revision 1.22 by root, Thu Apr 28 06:39:42 2011 UTC

37 av_push (av, newSVpv (text, 0)); \ 37 av_push (av, newSVpv (text, 0)); \
38 av_push (about, newRV_noinc ((SV *)av)); \ 38 av_push (about, newRV_noinc ((SV *)av)); \
39 } while (0) 39 } while (0)
40 40
41#define res_gv(sigil) \ 41#define res_gv(sigil) \
42 res_text (form ("in the global %c%s::%.*s", sigil, \ 42 res_text (form ("the global %c%s::%.*s", sigil, \
43 HvNAME (GvSTASH (sv)), \ 43 HvNAME (GvSTASH (sv)), \
44 GvNAME_HEK (sv) ? GvNAMELEN (sv) : 11, \ 44 GvNAME_HEK (sv) ? GvNAMELEN (sv) : 11, \
45 GvNAME_HEK (sv) ? GvNAME (sv) : "<anonymous>")) 45 GvNAME_HEK (sv) ? GvNAME (sv) : "<anonymous>"))
46 46
47MODULE = Devel::FindRef PACKAGE = Devel::FindRef 47MODULE = Devel::FindRef PACKAGE = Devel::FindRef
132 { 132 {
133 case SVt_PVAV: 133 case SVt_PVAV:
134 if (AvREAL (sv)) 134 if (AvREAL (sv))
135 for (i = AvFILLp (sv) + 1; i--; ) 135 for (i = AvFILLp (sv) + 1; i--; )
136 if (AvARRAY (sv)[i] == targ) 136 if (AvARRAY (sv)[i] == targ)
137 res_pair (form ("in array element %d of", i)); 137 res_pair (form ("the array element %d of", i));
138 138
139 break; 139 break;
140 140
141 case SVt_PVHV: 141 case SVt_PVHV:
142 if (hv_iterinit ((HV *)sv)) 142 if (hv_iterinit ((HV *)sv))
143 { 143 {
144 HE *he; 144 HE *he;
145 145
146 while ((he = hv_iternext ((HV *)sv))) 146 while ((he = hv_iternext ((HV *)sv)))
147 if (HeVAL (he) == targ) 147 if (HeVAL (he) == targ)
148 res_pair (form ("in the member '%.*s' of", HeKLEN (he), HeKEY (he))); 148 res_pair (form ("the hash member '%.*s' of", HeKLEN (he), HeKEY (he)));
149 } 149 }
150 150
151 break; 151 break;
152 152
153 case SVt_PVCV: 153 case SVt_PVCV:
177 { 177 {
178 /* Values from constant functions are stored in the pad without any name */ 178 /* Values from constant functions are stored in the pad without any name */
179 SV *name_sv = AvARRAY (AvARRAY (padlist)[0])[i]; 179 SV *name_sv = AvARRAY (AvARRAY (padlist)[0])[i];
180 180
181 if (name_sv && SvPOK (name_sv)) 181 if (name_sv && SvPOK (name_sv))
182 res_pair (form ("in the lexical '%s' in", SvPVX (name_sv))); 182 res_pair (form ("the lexical '%s' in", SvPVX (name_sv)));
183 else 183 else
184 res_pair ("in an unnamed lexical in"); 184 res_pair ("an unnamed lexical in");
185 } 185 }
186 186
187 --depth; 187 --depth;
188 } 188 }
189 } 189 }
226 { 226 {
227 MAGIC *mg = mg_find (sv, PERL_MAGIC_defelem); 227 MAGIC *mg = mg_find (sv, PERL_MAGIC_defelem);
228 228
229 if (mg && mg->mg_obj) 229 if (mg && mg->mg_obj)
230 res_pair (form ("the target for the lvalue hash element '%.*s',", 230 res_pair (form ("the target for the lvalue hash element '%.*s',",
231 SvCUR (mg->mg_obj), SvPV_nolen (mg->mg_obj))); 231 (int)SvCUR (mg->mg_obj), SvPV_nolen (mg->mg_obj)));
232 else 232 else
233 res_pair (form ("the target for the lvalue array element #%d,", LvTARGOFF (sv))); 233 res_pair (form ("the target for the lvalue array element #%d,", LvTARGOFF (sv)));
234 } 234 }
235 else 235 else
236 res_pair (form ("an lvalue reference target (type '%c', ofs %d, len %d),", 236 res_pair (form ("an lvalue reference target (type '%c', ofs %d, len %d),",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines