[ag-automation] [patch 1/2] fix sign compare warnings
Wolfgang Denk
wd at denx.de
Sat May 12 00:27:53 CEST 2007
In message <20070511221259.280634753 at metis.extern.pengutronix.de> you wrote:
>
> --- cyclictest.c.orig
> +++ cyclictest.c
> @@ -117,7 +117,7 @@ static int kernvar(int mode, char *name,
> }
> } else if (mode == O_WRONLY) {
> snprintf(buffer, sizeof(buffer), "%d\n", *value);
How about making this:
int n = snprintf(buffer, sizeof(buffer), "%d\n", *value);
> - if (write(procfilepath, buffer, strlen(buffer))
> + if ((size_t)write(procfilepath, buffer, strlen(buffer))
> == strlen(buffer))
and:
if (write(procfilepath, buffer, n) == n)
to save to superflous calls to strlen and make the code more readable?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, CEO: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Any sufficiently advanced technology is indistinguishable from magic.
Clarke's Third Law - _Profiles of the Future_ (1962; rev. 1973)
``Hazards of Prophecy: The Failure of Imagination''
More information about the ag-automation
mailing list