<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Jan 2022, 08:13 Gao Xiang, <<a href="mailto:hsiangkao@linux.alibaba.com" target="_blank" rel="noreferrer">hsiangkao@linux.alibaba.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Jan 29, 2022 at 01:56:30PM +0800, Gao Xiang wrote:<br>
> On Sat, Jan 29, 2022 at 07:47:31AM +0200, Igor Eisberg wrote:<br>
> > Point regarding conclusive messages taken, will revert the relevant lines.<br>
> <br>
> Thank.<br>
> <br>
> > As for the time variable, all I did was to match it to the format as in the<br>
> > case of HAVE_UTIMENSAT, just above it.<br>
> > Although the variable isn't used further, inlining it is unreadable.<br>
> > <br>
> <br>
> Please don't. Otherwise, complier will complain<br>
> "mixed declarations and code"<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Why would it? Declaration of const struct timespec times is inside #ifdef...#else, while the declaration for const struct utimebuf time is inside #else...#endif.</div><div dir="auto">The compiler won't complain because after the preprocessor is done, the compiler only gets one of them, never both. There is no "mixed declarations and code" thanks to the preprocessor...</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> <br>
> and I don't want to initialize such structures at the beginning of any<br>
> block.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">What exactly is "such structures"? I pointed you to an example where you did just that with struct z_erofs_decompress_req rq variable, I'm just following your code style, and this one stood out as unusual for your code style. Please count how many anonymous struct initializations you have across the whole erofs-utils project. I count only this one, and another in lib/data.c. Everything else is initialized as named variables.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Add some word.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">I didn't understand that...</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Actually, I'd like to add:<br>
if (!fsckcfg.extract_path)<br>
        return;<br>
<br>
at the beginning of erofsfsck_set_attributes() instead of<br>
using "if (!ret && fsckcfg.extract_path)" in the caller.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">OK, but then we will have mixed declarations and code, because then we won't be at the beginning of the block...</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So the HAVE_UTIMENSAT case needs to be resolved as well.<br>
<br>
Btw, I have no idea why it could become unreadable to you, first,<br>
it would avoid "mixed declarations and code" unless defining them at the<br>
beginning of blocks,</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Again, there is nothing mixed here, because preprocessor.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and I don't like memset(.., 0, ) and set<br>
independently since memset generally is a library function (unless<br>
compliers do some built-in tricks) rather than a language feature.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Forgive me but I don't remember seeing any mention of memset in the whole fsck.c file, so I have no idea why you're telling me this.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Gao Xiang</blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> <br>
> Thanks,<br>
> Gao Xiang<br>
</blockquote></div></div></div>