On Sun, 2022-12-18 at 02:29 +0100, Markus Heidelberg wrote:
>
> Am Samstag, 17. Dezember 2022, 20:26:42 CET schrieb Gerhard Sittig:
> > On Fri, 2022-12-16 at 19:37 +0100, Gerhard Sittig wrote:
> > >
> > > On Sun, 2022-12-11 at 02:30 +0100, Markus Heidelberg wrote:
> > > >
> > > > I found some crashes using PulseView with specific command line options.
> > > >
> > > > https://github.com/sigrokproject/libsigrok/pull/202
> > >
> > > Am in the process of taking the part that I'm confident about,
> > > the trace32 input. Samplerates should be u64 everywhere, no
> > > questions asked.
> > >
> > > Am more reluctant on the bindings, since I don't know and don't
> > > use most of them. Would be good to have more eyes on this part of
> > > your submission.
> >
> > Can you check
> > https://repo.or.cz/libsigrok/gsi.git/shortlog/refs/heads/binding-u32
> > and ACK or NAK the squash that I would apply to take it mainline?
> > As usual, alternatively provide something different which I
> > should then take instead.
>
> Oh, using "stoui" wasn't a typo, but intention. I should have made this
> clearer with a comment at least.
>
> The block in question is actually a replacement for stoui(), which is
> missing in the C++ standard:
>
>     unsigned long tmp = stoul(value);
>     if (tmp > std::numeric_limits<uint32_t>::max()) {
>       throw std::out_of_range("stoui");
>     }

Have pushed 2e379708554e to my binding-u32 branch. That hopefully
better fits what's currently in mainline. Your u32 path is the
first to actually check for the specific _u32_ value range.
Others check for something more generic like "int" instead, and
then propagate values through types. If more checks are desired,
I suggest to put them in followup commits and into separate
conversion helpers, to keep the data type dispatch routine as
short and uniform as it currently is.

Have changed stoui to stou32 because that specific u32 range is
checked for.

> ACK for rewording of the commit message.

Thank you for checking.


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to