From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5B4E7426A8 for ; Wed, 25 May 2022 19:17:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD28668B53E; Wed, 25 May 2022 22:17:30 +0300 (EEST) Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7008F68B3A3 for ; Wed, 25 May 2022 22:17:24 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1653506243; bh=+mLUdXhYJW7fEmPk9dS8sjM0MoqqhS1/NU3WVPN0Czc=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NgrsJLY7fPBux2i1GP2eTufiMqG1X42fjF3mnhAO+MVOMFeiZE4U6fKmZNV/ikgQZ +7BQqcAXRWOIXtnLvfqq9lVTffjW4IIPLYztQsBwaT5DaEJbH+S0+tVTgKHUhBEChN HQO4tQgFRGJc2q3kdD+cgqUwM70hbbLmX+Sn30ew= Received: by www-7.mailo.com with http webmail; Wed, 25 May 2022 21:17:23 +0200 (CEST) X-EA-Auth: z35mgAUUMxg5XEcFqSODYMFlgvg0kwQP9ZjKsnEqXzhcjWHRVW9egD6Lk9JhHuiXNReSQrEtXO/yDOpZ+djT+RXOjT1Pc8pX From: nil-admirari@mailo.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 May 2022 21:17:23 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v7 2/3] avformat/os_support: Support long file names on Windows X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > No, it is intended and expected that the structs are different. > ... > That's why the structs are different and the fields of > win32_stat always large enough, no matter which struct > is being used internally. Please document that there is a potential difference in time types and that the difference is intentional, and that the chosen time type is always large enough. Probably it's worthwhile to document that the entire machinery was created because of POSIX stat function and struct being identically named, which is not possible to accommodate by a simple macro. > > > +static inline int win32_access(const char *filename_utf8, int par) > > > +static inline void copy_stat(struct _stati64 *winstat, struct > > win32_stat *par) > > > +static inline int win32_stat(const char *filename_utf8, struct > > win32_stat *par) > > > +static inline int win32_fstat(int fd, struct win32_stat *par) > > > > How about renaming par to something more appropriate? > > How? And why? > > These functions were always named like that (it just wasn't visible > as these were constructed through macros). _access argument is called mode: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess?view=msvc-170. _stat and _fstat argument is called a buffer: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=msvc-170 https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32?view=msvc-170 It's no better than par, but you don't have to follow MS. Somehow winstat refers to parameters of type _stati64, not win32_stat. I would've called win32_stat params winstat, and _stati64 params crtstat, but you can always come up with better names. Inside a macro generic parameter names are a necessity. Functions better be more specific. _______________________________________________ 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".