* [PATCH] simplify mw_perl_src_file_cstr to avoid gcc warning
@ 2023-01-09 7:40 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-01-09 7:40 UTC (permalink / raw)
To: mwrap-perl
This works around a gcc (Debian 10.2.1-6) warning,
and is less code, even
---
mwrap_core.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mwrap_core.h b/mwrap_core.h
index 15df857..deb3bb3 100644
--- a/mwrap_core.h
+++ b/mwrap_core.h
@@ -389,10 +389,8 @@ static const char *mw_perl_src_file_cstr(unsigned *lineno)
{
const COP *cop = mwp_curcop();
if (!cop) return NULL;
- const char *fn = CopFILE(cop);
- if (!fn) return NULL;
*lineno = CopLINE(cop);
- return fn;
+ return CopFILE(cop);
}
# define SRC_FILE_CSTR(lineno) mw_perl_src_file_cstr(lineno)
#endif /* MWRAP_PERL */
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-09 7:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 7:40 [PATCH] simplify mw_perl_src_file_cstr to avoid gcc warning Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/mwrap-perl.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).