diff options
author | David Mitchell <davem@iabyn.com> | 2013-11-12 15:39:04 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-11-13 10:38:40 +0000 |
commit | c835650ead1b96c706212d7e6d95da86cc9e8fcb (patch) | |
tree | 12342d2b372ce61459c4b68009aa276c49d5988f /gv.h | |
parent | 406e3fef7f4bebd2003087bce74d22303981ac48 (diff) | |
download | perl-c835650ead1b96c706212d7e6d95da86cc9e8fcb.tar.gz |
fix definition of GvFILEGV()
It was:
#define GvFILE(gv) (GvFILE_HEK(gv) ? HEK_KEY(GvFILE_HEK(gv)) : NULL)
#define GvFILEGV(gv) (gv_fetchfile(GvFILE(gv)))
which is a problem, since gv_fetchfile() doesn't accept a non-null
argument. Change it so that the (cond ? foo : NULL) thing is outside
gv_fetchfile(). This is all a bit academic since GvFILE_HEK should never
be null, but it at least it shuts up a compiler warning.
Diffstat (limited to 'gv.h')
-rw-r--r-- | gv.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -141,8 +141,9 @@ Return the CV from the GV. #define GvLINE(gv) (GvGP(gv)->gp_line) #define GvFILE_HEK(gv) (GvGP(gv)->gp_file_hek) -#define GvFILE(gv) (GvFILE_HEK(gv) ? HEK_KEY(GvFILE_HEK(gv)) : NULL) -#define GvFILEGV(gv) (gv_fetchfile(GvFILE(gv))) +#define GvFILEx(gv) HEK_KEY(GvFILE_HEK(gv)) +#define GvFILE(gv) (GvFILE_HEK(gv) ? GvFILEx(gv) : NULL) +#define GvFILEGV(gv) (GvFILE_HEK(gv) ? gv_fetchfile(GvFILEx(gv)) : NULL) #define GvEGV(gv) (GvGP(gv)->gp_egv) #define GvEGVx(gv) (isGV_with_GP(gv) ? GvEGV(gv) : NULL) |