On Thursday, July 29, 2010 19:04:05 Stefano Babic wrote:
> + urj_warning (
> + _("File %s cannot be opened to (un)export GPIO %d: %d\n"),
> fname, gpio, errno);
i'm pretty sure urj_warning takes care of errno. so this message should be:
_("%s: cannot open to (un)export GPIO %d\n"), fname, gpio
same for all messages using errno/strerror.
i think this style too is "more standard" ... filename as the prefix to the
error message
> + return -1;
return URJ_STATUS_FAIL instead of -1. and URJ_STATUS_OK instead of 0. this
applies to the whole file.
> +static int gpio_get_value (int gpio)
> +{
> + char buf[8];
> + ret = fscanf (fp, "%c", buf);
i think you want:
int value;
fscanf (fp, "%i", &value);
> + if (buf[0] != '0' && buf[0] != '1') {
> + urj_warning(_("Erroneous value for gpio %d: 0x%x\n"), gpio,
> buf[0]);
> + return -1;
> + }
i'd just stick with returning "value" and not worrying about the actual value
> +}
> +
> +
> +
> +static int
too many newlines
one more patch and i think we'll be there ;)
-mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm
_______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
