[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to p
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2 |
Date: |
Fri, 14 Jul 2017 01:41:58 +0300 |
On Thu, Jul 13, 2017 at 12:17:40PM -0300, Eduardo Habkost wrote:
> > > Oh right. So you need to find dots and split at these points.
> > > Something like the below? Completely untested.
> > >
> > > int mstcmp(const char *s1, const char *s2)
> > > {
> > > const char *e1, *e2;
> > > int l1, l2, c;
> > >
> > > do {
> > > e1 = strchr(s1, '.');
> > > e2 = strchr(s2, '.');
> > >
> > > l1 = e1 ? e1 - s1 + 1 : strlen(s1);
> > > l2 = e2 ? e2 - s2 + 1 : strlen(s2);
> > >
> > > /* compare numerically: shorter strings give smaller numbers */
> > > if (l1 != l2) {
> > > break;
> > > }
> > > c = strncmp(s1, s2, l1);
> > > if (c) {
> > > return c;
> > > }
> > > s1 += l1;
> > > s2 += l1;
> > > } while (l1);
> > >
> > > return l1 - l2;
> > > }
>
> I believe copying strverscmp() from gnulib as-is is better than
> reimplementing a subset of it.
I would then probably copy it unconditionally.
>
> --
> Eduardo
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, (continued)
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Eduardo Habkost, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Eduardo Habkost, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Laszlo Ersek, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/07/12
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Eduardo Habkost, 2017/07/13
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Laszlo Ersek, 2017/07/13
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Eduardo Habkost, 2017/07/14
- Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Eric Blake, 2017/07/13
Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Markus Armbruster, 2017/07/12
Re: [Qemu-devel] [PATCH v3] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Daniel P. Berrange, 2017/07/12