[Debburn-devel] [PATCH] cleanup: Use ANSI-style function definitions in cdrecord.c

Peter Samuelson peter at p12n.org
Tue Sep 5 23:28:42 UTC 2006


[Christian Fromme]
>  
>  EXPORT int
> -main(ac, av)
> -	int	ac;
> -	char	*av[];
> +main(int argc, char *argv[])

At that point I'd take the opportunity to remove the EXPORT.  'int
main(...)' is correct ANSI C.

In fact, I think it is probably worthwhile to remove _all_ mentions of
'EXPORT', or at least change all mentions of 'LOCAL' to 'static'.
(There may be some sort of Windows DLL reason to retain 'EXPORT', I do
not know.)  And a change to the function signature is a perfect
opportunity to also do the EXPORT/LOCAL change since it touches exactly
the same bits of code.

All this will happen on a branch at some point.  I'll be happy to head
up such a branch if I get commit access.


> -	ispacket = gargs(ac, av, &tracks, track, &dev, &timeout, &dp, &speed, &flags,
> +	ispacket = gargs(argc, argv, &tracks, track, &dev, &timeout, &dp, &speed, &flags,
>  							&blanktype, &formattype);

Yes, I know this line was already longer than 80 columns, but don't make it worse, ok?  This would be the right time to do this:

+	ispacket = gargs(argc, argv, &tracks, track, &dev, &timeout,
+			 &dp, &speed, &flags, &blanktype, &formattype);


> +write_secs(SCSI *scgp, cdr_t *dp, char *bp, long startsec, int bytespt, 
> +        int secspt, BOOL islast)

> +pad_track(SCSI *scgp, cdr_t	*dp, track_t *trackp, long startsec, Llong amt,
> +	BOOL dolast, Llong *bytesp)

> +write_buf(SCSI *scgp, cdr_t *dp, track_t *trackp, char *bp, long startsec, 
> +        Llong amt, int secsize, BOOL dolast, Llong *bytesp)

Again, please don't make the formatting worse than it already was.
Lining up the second line below "SCSI" is the usually accepted format.
Or if you want to use a constant amount of space, make sure it's really
constant.  (:

> +print_track(int track, long lba, struct msf *msp, int adr, int control, int mode)

80 columns, if you would, please.

I'm actually not insistent upon the 80-column rule - we do all have
resizable xterms in this day and age - but it _is_ a good general rule
of thumb, to keep lines from becoming unreadably long.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debburn-devel/attachments/20060905/aa7cd884/attachment.pgp


More information about the Debburn-devel mailing list