From: Marton Balint <cus@passwd.hu> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH v3 1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno Date: Tue, 7 May 2024 23:05:18 +0200 (CEST) Message-ID: <94b3be81-0777-fbc1-8ba8-a39a8f6397d4@passwd.hu> (raw) In-Reply-To: <ZjovgaV8Xiqa8DUl@andrews-2024-laptop.sayers> On Tue, 7 May 2024, Andrew Sayers wrote: > On Sun, May 05, 2024 at 09:59:28PM +0200, Marton Balint wrote: >> >> >> On Fri, 19 Apr 2024, Andrew Sayers wrote: >> >>> For example, WSAStartup()'s documentation says: >>> >>> "A call to the WSAGetLastError function is not needed and should not be used" >>> --- >>> libavformat/network.c | 7 ++++++- >>> 1 file changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/libavformat/network.c b/libavformat/network.c >>> index f752efc411..fb70f9cafc 100644 >>> --- a/libavformat/network.c >>> +++ b/libavformat/network.c >>> @@ -121,9 +121,14 @@ void ff_network_close(void) >>> } >>> >>> #if HAVE_WINSOCK2_H >>> + >>> +} >>> int ff_neterrno(void) >>> { >>> - int err = WSAGetLastError(); >>> + return ff_neterrno2(WSAGetLastError()); >>> +} >>> +int ff_neterrno2(int err) >> >> ff_neterror(int err) would be a better name, since it has nothing to do with >> errno. >> >> Regards. >> Marton > > Not sure which one you're proposing to rename, > but if the original > ff_neterrno() was documented, I think it would say something like: > > /* > * @brief AVERROR for the latest network function > * @return AVERROR based on `WSAGetLastError()` (Windows) or `errno` (otherwise) > */ > > ... and neterrno2 would be something like: > > /* > * @brief ff_neterrno()-style AVERROR > * @param err error code (usually an errno or Windows Sockets Error Code) > * @return AVERROR equivalent to err > */ > > So neither necessarily have anything to do with errno. How about adding the > above documentation then doing s/ff_neterrno(2?)/ff_neterror\1/g ? Okay, indeed that makes the most sense. Since the function renames will affect a lot of existing files, it should be a separate patch with no functional changes. Thanks, Marton > > Note: this was supposed to be a quick patch documenting the existing behaviour > of a single function, and has now scope-crept up to a fairly sizeable refactor > of a barely-related function. I don't mind working on this sort of thing in > principle, but would like to land this particular patch before things get too > much further out of hand. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-05-07 21:05 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-19 16:59 [FFmpeg-devel] [PATCH 1/2] avformat/utils: handle errors > 0 in avformat_network_init() Andrew Sayers 2024-04-19 16:59 ` [FFmpeg-devel] [PATCH 2/2] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers 2024-04-19 17:04 ` [FFmpeg-devel] [PATCH 1/2] avformat/utils: handle errors > 0 in avformat_network_init() James Almer 2024-04-19 17:23 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/network: Return a proper negative error code from ff_network_init() Andrew Sayers 2024-04-19 17:23 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers 2024-04-19 17:37 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/network: Return a proper negative error code from ff_network_init() James Almer 2024-04-19 19:07 ` [FFmpeg-devel] [PATCH v3 1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno Andrew Sayers 2024-04-19 19:08 ` [FFmpeg-devel] [PATCH v3 2/3] avformat/network: Return 0/AVERROR from ff_network_init() Andrew Sayers 2024-04-19 19:08 ` [FFmpeg-devel] [PATCH v3 3/3] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers 2024-04-20 7:57 ` [FFmpeg-devel] [PATCH v3 1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno Stefano Sabatini 2024-04-20 13:24 ` [FFmpeg-devel] [PATCH v4 " Andrew Sayers 2024-04-20 13:25 ` [FFmpeg-devel] [PATCH v4 2/3] avformat/network: Return 0/AVERROR from ff_network_init() Andrew Sayers 2024-05-05 20:05 ` Marton Balint 2024-05-07 13:12 ` Andrew Sayers 2024-04-20 13:25 ` [FFmpeg-devel] [PATCH v4 3/3] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers 2024-04-27 8:46 ` [FFmpeg-devel] [PATCH v4 1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno Andrew Sayers 2024-05-05 19:59 ` [FFmpeg-devel] [PATCH v3 " Marton Balint 2024-05-07 13:41 ` Andrew Sayers 2024-05-07 21:05 ` Marton Balint [this message] 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 0/5] avformat/network: improve ff_neterrno() Andrew Sayers 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 1/5] Add documentation for ff_neterrno() Andrew Sayers 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 2/5] Rename "ff_neterrno()" to "ff_neterror()" Andrew Sayers 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 3/5] avformat/network: add ff_neterror2() for cases where we already have an error Andrew Sayers 2024-05-16 10:42 ` Rémi Denis-Courmont 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 0/6] avformat/network: improve ff_neterrno() Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 1/6] Add documentation for ff_neterrno() Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 2/6] Rename "ff_neterrno()" to "ff_neterror()" Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 3/6] avformat/network: add ff_neterror2() for cases that don't use WSAGetLastError Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 4/6] avformat/network: add ff_neterror2() for compatibility with Windows Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 5/6] avformat/network: Return 0/AVERROR from ff_network_init() Andrew Sayers 2024-05-16 11:59 ` [FFmpeg-devel] [PATCH v5 6/6] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers 2024-05-31 9:07 ` [FFmpeg-devel] [PATCH v5 0/6] avformat/network: improve ff_neterrno() Andrew Sayers 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 4/5] avformat/network: Return 0/AVERROR from ff_network_init() Andrew Sayers 2024-05-16 9:33 ` [FFmpeg-devel] [PATCH v4 5/5] avformat/avformat: Document return codes for av_format_(de)init Andrew Sayers
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=94b3be81-0777-fbc1-8ba8-a39a8f6397d4@passwd.hu \ --to=cus@passwd.hu \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git