Replace the oft-repeated mg_ptr incantation with
the simple MgPVKEY macro.
Rename MgPVKEY to MgPV (to match with HePV elsewhere). Add
additional parens around the "mg".
#define MgTAINTEDDIR(mg) (mg->mg_flags & MGf_TAINTEDDIR)
#define MgTAINTEDDIR_on(mg) (mg->mg_flags |= MGf_TAINTEDDIR)
+
+#define MgPV(mg) ((mg)->mg_len == HEf_SVKEY) ? \
+ SvPV((SV*)((mg)->mg_ptr),na) : \
+ (mg)->mg_ptr