Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Floppy image overflow
rin@ wrote:
> http://www.netbsd.org/~rin/atari_floppy_20160208.patch
>
> On 2017/02/07 23:51, Christos Zoulas wrote:
> > I am not enamored with more ifdef's but this seems ok to me.
>
> In the new version, I've removed most of ifdef's.
> Instead, I define flags like needswap or isappleufs as (0), and unused
> functions as /* nothing */.
>> +#define ffs_cg_swap(a, b, c) /* nothing */
>> +#define ffs_csum_swap(a, b, c) /* nothing */
>> +#define ffs_sb_swap(a, b) /* nothing */
>> +#define swap_dinode1(a, b) /* nothing */
>> +#define swap_dinode2(a, b) /* nothing */
I'm afraid these unused functions should be "do {} while (/*CONSTCOND*/0)"
rather than "empty" comments because they could be used in if clauses
without braces (which is allowed in our /usr/share/misc/style):
https://nxr.netbsd.org/xref/src/sbin/fsck_ffs/inode.c?r=1.71#421
---
if (is_ufs2)
swap_dinode2(inodebuf, lastinum - inumber);
else
swap_dinode1(inodebuf, lastinum - inumber);
bwrite(fswritefd, (char *)inodebuf, dblk, size);
---
All other part looks fine.
> I've added src/distrib/x_{fsck_ffs,newfs} and brief instruction there.
>
> Note that the original Makefile in src/sbin/{fsck_ffs,newfs} has been
> split into Makefile and Makefile.common, not Makefile.inc as in the
> case of x_ifconfig. This is because Makefile.inc conflicts with
> bsd.subdir.mk. I will also rename it for x_ifconfig, and do some clean
> up after committing the main patch.
Also fine for me.
Note there was some confusion "what's Makefile.inc":
http://mail-index.netbsd.org/source-changes-d/2009/09/14/msg000944.html
http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ifconfig/Makefile.inc#rev1.7
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index