On Wednesday, August 04, 2010 15:25:32 Mike Frysinger wrote:
> On Saturday, July 31, 2010 14:48:24 Mike Frysinger wrote:
> > On Saturday, July 31, 2010 12:08:48 Michael Walle wrote:
> > > the cable pid/vid number parsing changed on the development version.
> > > urjtag 0.10 parsed the numbers as hex string, whereas in latest
> > > development version the numbers are interpreted as decimal ones. Is
> > > this intended? In the former versions you could use the output from
> > > lsusb.
> > 
> > yes and no.  the unification of parameter parsing is what caused this.
> > while i can easily restore support for hex values starting with 0x,
> > adding support for unprefixed hex values (what lsusb shows) is a bit
> > tougher. i'm also not sure i want to.  imo, if you want to use a hex
> > value, it should have a 0x at the start to avoid ambiguity.
> > 
> > --- src/global/params.c (revision 4746)
> > +++ src/global/params.c (working copy)
> > @@ -180,7 +180,7 @@
> > 
> >  static int
> >  parse_param_lu(const char *eq, long unsigned *lu)
> >  {
> > 
> > -    if (sscanf(eq + 1, "%lu", lu) == 1)
> > +    if (sscanf(eq + 1, "%li", lu) == 1)
> > 
> >          return URJ_STATUS_OK;
> >      
> >      urj_error_set (URJ_ERROR_SYNTAX, "need unsigned int, not '%s'", eq +
> > 
> > 1);
> 
> if no one has any other feedback here, i'll just roll with this

i thought about it some more, and the move to parsing signed values didnt sit 
right with me.  so i implemented a small check where it manually looks at the 
first two chars and if they're "0x", then it scans with "%lx", otherwise it 
falls back to the standard "%lu".

and now this works:
cable ICE-100B vid=0x064b
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to