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 A7CC842B43 for ; Thu, 26 May 2022 05:09:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 84DFC68B4E7; Thu, 26 May 2022 08:09:42 +0300 (EEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07olkn2018.outbound.protection.outlook.com [40.92.15.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86CAF68B4AB for ; Thu, 26 May 2022 08:09:36 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CA72cLcgRszL3a2GPAALQDbicemlyPk8gNDKlb0gD5TXSdeoqEfEJqvjfMOZ9c3qArQehaujxwzDu2XQRk2beeDZV0lXdXET8aueP1+LCb6LChqpHel6f9cPlwtzt5c5Jfl/C/WpvEqy5W6xtL/fC+4stIgbd2dYcz5CEXFE12zRtTtE5R+pwEY8c2n6T98Eqc1NXU2Xr7UQ56fDmSg4bZ0k+9EUhK+cZEiMujXkheFU16IDGlv1u3QwDelkRaDB+kxqnfyj3ec1+8n70nymw6qChDD4Xm724cp5OLDlofdEBZOTYdadGxly8ATNBo0CFJY/AI4+sVAY64Z5p6GM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yskE+9ULHtUP8OO+pBiK1as+xAEJeTMCsbAQa4uYWCM=; b=KrWrg1YJ7Hc6oyOvFbpNaVM7Jg+xbMcC3QE3J7MKk9+0kk7QbsI5ndEzfcDDXUArHmjoqsyU4Hyp8YLzYFcpoL5l0j2K6j3v3tycbVlf3dAkkqVc3DYfRwbDNXjaEOmbvHNeMjUUN/c2cEax7Nj3sW8F0aDyQbNrYlJBvtU99nyE1wnqS/5PsL/nRk2/bVcbOpvggwTCR6rG6HNCsx6UDedtyxbvZfznFnRBcmC0hJHCDyXhsseh0Uw6CtgU28ft6w+WjKIJTUqHUggccT/0CftAxynC7zVmj2ODGT2JwUwYYYa2fgo66E4HgtL22YoI9E3saKOATIW+rHBNfZAfUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yskE+9ULHtUP8OO+pBiK1as+xAEJeTMCsbAQa4uYWCM=; b=JLFe0764NN6FRLKlI9bGBVWTkL5zaP5FF2J2jJTlk2xRuTvAaCmo/nBhm1XCOpIH1ToJQdIGxQRrnOrQf4vajSe9MDpgLrZNlyEaxyO+586l5IL0gPCVrhorHLA+wjpmoryLq+p0AIw4S03krWmhdt5vujqmzJ+Oa7J+fXFehQTi+oCMtPSpLNHee84t3Eea1i99B4Kns4DaNaeZ4ktzQiflwlWZJXsP0nYHWxMErcdWOtYvOU2QflRjMEvcp7S0TWohfEnun6rL91qY8jAUEIU2bf7p5qXsHO9U3TtMiW1OGsyS7HTcR+6KsF80NwpdLZshH2ARWIbjEopaU65YnA== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DS7P223MB0480.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:98::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 05:09:34 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::f144:21f9:cdb1:5c8a]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::f144:21f9:cdb1:5c8a%7]) with mapi id 15.20.5293.013; Thu, 26 May 2022 05:09:34 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH v7 2/3] avformat/os_support: Support long file names on Windows Thread-Index: AQHYb7yJuBML25MNo0OXZrIvuacPB60vrVyAgAAJuLCAAEGSgIAAmUXw Date: Thu, 26 May 2022 05:09:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [pG1TJYy9FB/CCm79l1nZ2jr2shVMheXY] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6abfa6fa-86d1-45f7-c9e7-08da3ed5ec62 x-ms-traffictypediagnostic: DS7P223MB0480:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HbCgqleuaLdhRB911IZ6g7C5gR6yD2dF9/8sl2l+Y3FMlMtLyQOPYm0+xXQa4BkwUYLcSm4oJGwn0UhlzhJEOwBmEzSG8CcgiQZT6W1ImoDJyg/1qsFGpmfihGKd0XPUhI0E7eLG/qyw81FCKVSqCBk2E8dp/UL5CJsWeOZED3R6Pu6WBx48PngNb5wVIny4/KZuTzZV7Kpkj7JxWeb4DuA53RCPrcedIaQsZanvPCwaQ6XJoIdfDfbd6ynL8THAw7pQLddPIPFx9FRQZs8saq34iRdK4of2UFMDyMBhGOtM7XqQzOIt+yjXakTFYD8aTh71bGruuw+mj5jm2HrmFlx1WbeHPwmj9huYdDBx8fEF3zxzyOLIdn3PLwAdj9y77O0pMZz78jZqSHZDRamzxGXRxfbJ7aJprMnFrK8tOrgJPTDBPdMI4Sgfd/XpqpY8Z/ind70EKZ/N+rAF/ZTA/pOjIhrjg7sKdpLbW77+D1WuHRlvw6TCdguZePMC6yafI7QJy4PEMEzus96ZfP1vsYUqM8uoy0cJGK0fYaxYdUzj2zKHveP4Ar93i7xd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1dXFoczFFK3FJdEFjQnJUMWdMV09qbDY5?= =?utf-8?B?SE8xVHgxVEpZRUMvNFRzQm1DWGdRQ0o5RDB6bHZuTnE3R2pjVWFrTUk0eFU5?= =?utf-8?B?b0JoSHlNQ28vVnVKZndBNUFzYW1LOCs5akh0blBUUXF6dy9mMWdhNnpKNnZl?= =?utf-8?B?b0dmUWFVczVMblVCZE5hSWcvUjBiWUZjd2FHVG13WFJxVkY1d3piZitQUzZk?= =?utf-8?B?UnNyQkptSFdIZlc3bmZNZlhxeXRWVGVXMUg1WitxMlZyZk1PVkY5ai9hQzNm?= =?utf-8?Q?2KymweeNj0Y=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 6abfa6fa-86d1-45f7-c9e7-08da3ed5ec62 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 05:09:34.0887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7P223MB0480 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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of nil- > admirari@mailo.com > Sent: Wednesday, May 25, 2022 9:17 PM > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH v7 2/3] avformat/os_support: Support > long file names on Windows > > > 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. Yes, it makes sense to explain that a bit. Will do. > > > > +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. I misread, thinking you wanted to rename the functions. Yes, the par comes from the macro (which was for building the two functions with different parameter name). I have expanded the macro for stat, and then the macro would have only existed for access, so I did expand that one as well. So, no problem, I will rename the arguments according to posix. > Somehow winstat refers to parameters of type _stati64, not win32_stat. I named it winstat for "win api stat". When you want to go strict you could say that all the naming is incorrect, because 'win32' suggests that all those are about calls to the Win32 API, while in fact, they are calls to msvcrt. > I would've called win32_stat params winstat, and _stati64 params crtstat, > but you can always come up with better names. win32_stat has nothing to do with Windows, it is actually more a posix_stat, but it needs to have the same name as the function Even crtstat would not be quite correct and would rather need to be named msvcrtstat :-) We could drive this further and further and probably it would never be totally "right". Though, I will make the replacements you asked for, and then we'll see... Regarding your concerns about _USE_32BIT_TIME_T, I wanted to mention that we still have an alternative, to get around this. Currently, we are using _wstati64, _ffstati64 and _stati64. All of those are re-defined depending on whether _USE_32BIT_TIME_T is defined or not. Instead of that, we could use _wstat64, _ffstat64 and _stat64. In this case, we would always get 64bit time values, independent of the definition of _USE_32BIT_TIME_T. The only difference it makes would be whether we can have file times beyond the year 2038. I'm fine with the way it is right now, I just wanted to have mentioned it. Thanks for reviewing, softworkz _______________________________________________ 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".