Re: [Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-03-01 Thread Hans de Goede
Hi, On 02/28/2013 05:50 PM, Christophe Fergeau wrote: On Thu, Feb 28, 2013 at 10:14:46AM +0100, Hans de Goede wrote: On 02/20/2013 06:09 PM, Hans de Goede wrote: On 02/20/2013 11:35 AM, Marc-André Lureau wrote: I think that should be: "(char*)p2 - (char*)p1" So that if the address of p2 is big

Re: [Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-02-28 Thread Christophe Fergeau
On Thu, Feb 28, 2013 at 10:14:46AM +0100, Hans de Goede wrote: > On 02/20/2013 06:09 PM, Hans de Goede wrote: > >On 02/20/2013 11:35 AM, Marc-André Lureau wrote: > >I think that should be: "(char*)p2 - (char*)p1" So that if the > >address of p2 is bigger they compare as p2 > p1, and qsort will > >k

Re: [Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-02-28 Thread Hans de Goede
Hi, On 02/20/2013 06:09 PM, Hans de Goede wrote: Hi, On 02/20/2013 11:35 AM, Marc-André Lureau wrote: If monitors are equal, compare them by their addresses, to get the effect of a stable sort. --- gtk/channel-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/

Re: [Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-02-27 Thread Marc-André Lureau
Pushed as is after discussion with Hans. -- Marc-André Lureau ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel

Re: [Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-02-20 Thread Hans de Goede
Hi, On 02/20/2013 11:35 AM, Marc-André Lureau wrote: If monitors are equal, compare them by their addresses, to get the effect of a stable sort. --- gtk/channel-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index fe57684..

[Spice-devel] [PATCH spice-gtk] main: use stable comparison function for monitors

2013-02-20 Thread Marc-André Lureau
If monitors are equal, compare them by their addresses, to get the effect of a stable sort. --- gtk/channel-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index fe57684..f86e81d 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-