Re: [Spice-devel] [PATCH spice-streaming-agent] Update old style header guards

2018-02-14 Thread Victor Toso
Hi, On Thu, Feb 15, 2018 at 07:14:14AM +, Frediano Ziglio wrote: > Some header used some slightly different naming style for > header guards. > Update the names to make them more coherent. > > Signed-off-by: Frediano Ziglio > --- > src/hexdump.h | 4 ++-- > src/jpeg.hpp | 4 ++-- > 2 files

[Spice-devel] [PATCH spice-streaming-agent] Update old style header guards

2018-02-14 Thread Frediano Ziglio
Some header used some slightly different naming style for header guards. Update the names to make them more coherent. Signed-off-by: Frediano Ziglio --- src/hexdump.h | 4 ++-- src/jpeg.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hexdump.h b/src/hexdump.h in

Re: [Spice-devel] [PATCH 10/14] Remove clang warning on missing 'override'

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > In file included from mjpeg-fallback.cpp:8: > ./mjpeg-fallback.hpp:28:25: warning: 'VideoCodecType' overrides a member > function but is not marked 'override' [-Winconsistent-missing-override] > SpiceVideoCodecType VideoCodecType() const; >

Re: [Spice-devel] [PATCH 14/14] Do not test twice for the same condition

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp > index 7a3a46d..e825565 100644 > --- a/

Re: [Spice-devel] [PATCH 13/14] Use C++ style for cursor message initialization instead of C style

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 49 > +-- > 1 file changed, 29 insertions(+), 20 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.

Re: [Spice-devel] [PATCH 12/14] Get rid of C-style memset initializations, use C++ style aggregates

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 43 > --- > 1 file changed, 24 insertions(+), 19 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.

Re: [Spice-devel] [PATCH 11/14] Replace inefficient C-style initialization with C++-style

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp > index e9ef310..9a5c4fa 100644 > --- a/s

Re: [Spice-devel] [PATCH 10/14] Remove clang warning on missing 'override'

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > In file included from mjpeg-fallback.cpp:8: > ./mjpeg-fallback.hpp:28:25: warning: 'VideoCodecType' overrides a member > function but is not marked 'override' [-Winconsistent-missing-override] > SpiceVideoCodecType VideoCodecType() const; >

Re: [Spice-devel] [PATCH 09/14] Remove clang warning on marking a function const

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > ./static-plugin.hpp:29:5: warning: 'const' qualifier on function type > 'PluginInitFunc' (aka 'bool (spice::streaming_agent::Agent *)') has no > effect [-Wignored-qualifiers] > const PluginInitFunc* const init_func; > ^~ > > Signed-off-by: Christ

Re: [Spice-devel] [PATCH 06/14] log_binary is really a boolean

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp > index e345d99..8f25940 100644 > ---

Re: [Spice-devel] [PATCH 07/14] Do not create std::string for constants

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > As per e-mail discussions (https://patchwork.freedesktop.org/patch/200629/), > using std::string for C-style string constants is against C++ good practices, > see > https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rstr-zstring > fo

Re: [Spice-devel] [PATCH 05/14] Rename 'quit' to 'quit_requested' for consistency with 'streaming_requested'

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp > index 5fb20d1..e345d99 100

Re: [Spice-devel] [PATCH 04/14] Add PRIu64 format for uint64_t

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Otherwise, clang complains: > > spice-streaming-agent.cpp:414:66: warning: format specifies type 'unsigned > long' but the argument has type 'uint64_t' (aka 'unsigned long long') > [-Wformat] > fprintf(f_log, "%lu: Frame of %zu bytes:\n",

Re: [Spice-devel] [PATCH 02/14] Capture 'cursor' by value

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > We should really not be capturing cursor by reference here, > since that value could be changed by the surrounding loop and sending > the data could some day be made asynchronous. > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.

Re: [Spice-devel] [PATCH 03/14] streaming_requested is really a bool

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > src/spice-streaming-agent.cpp | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp > index c4c52ef..760c211 100644 > ---

Re: [Spice-devel] [PATCH 01/14] Add required header

2018-02-14 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > Without this, clang emits among others: > > spice-streaming-agent.cpp:355:31: error: implicit instantiation of undefined > template 'std::__1::basic_string, > std::__1::allocator >' > streamfd = open(streamport.c_str(), O_RDWR); >

Re: [Spice-devel] [PATCH spice-server v2 1/2] stream-device: handle cursor from device

2018-02-14 Thread Christophe de Dinechin
> On 9 Feb 2018, at 17:59, Frediano Ziglio wrote: > > + > +// read part of the message till we get all > +if (dev->msg_len < dev->hdr.size) { > +dev->msg = g_realloc(dev->msg, dev->hdr.size); > +dev->msg_len = dev->hdr.size; > +} >

Re: [Spice-devel] [PATCH v3 11/11] Rewrite the style guide for headers

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 14:35, Christophe Fergeau wrote: > > This one sounds more like an RFC to me Well, this is really a bug fix in the documentation more than a RFC. > , as from a quick look in server/, > this is not the style currently in use. As I pointed out in earlier discussions, this s

Re: [Spice-devel] [PATCH v3 10/11] Add guidelines about warnings and whitespaces

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 14:37, Christophe Fergeau wrote: > > On Thu, Feb 08, 2018 at 12:25:30PM +0100, Christophe de Dinechin wrote: >> From: Christophe de Dinechin >> >> The objective of these guidelines is that: >> - We avoid introducing new warnings >> - We know how to fix old ones >> - We do

Re: [Spice-devel] [spice-server] style: Slight tweak to the header guard section

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 17:29, Christophe Fergeau wrote: > > This changes the suggested style to what is currently used in > spice-server codebase. This also removes a few sentences which > are not really related to how one should format their header guards. > > Signed-off-by: Christophe Fergeau

Re: [Spice-devel] [PATCH v3 01/11] Add .clang-format with defaults matching what's specified in the style guide

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 17:34, Christophe Fergeau wrote: > > On Wed, Feb 14, 2018 at 10:45:56AM -0500, Frediano Ziglio wrote: >>> >>> Shouldn't this go with a Makefile rule? A few lines in the log what this >>> is about, what is the goal for having this file, ... would not hurt. >>> >>> Christop

Re: [Spice-devel] [RFC PATCH 1/1] separate and encapsulate the agent business code

2018-02-14 Thread Christophe de Dinechin
I cut quite a bit for clarity. What I cut I agree with ;-) > On 14 Feb 2018, at 14:45, Lukáš Hrázký wrote: > > On Tue, 2018-02-13 at 17:10 +0100, Christophe de Dinechin wrote: >> Hi Lukas, >> > > For your comments which are unrelated to my changes, I commended > uniformly with "Was in origina

[Spice-devel] [PATCH 01/14] Add required header

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Without this, clang emits among others: spice-streaming-agent.cpp:355:31: error: implicit instantiation of undefined template 'std::__1::basic_string, std::__1::allocator >' streamfd = open(streamport.c_str(), O_RDWR); ^ Signed-of

[Spice-devel] [PATCH 04/14] Add PRIu64 format for uint64_t

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Otherwise, clang complains: spice-streaming-agent.cpp:414:66: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] fprintf(f_log, "%lu: Frame of %zu bytes:\n", get_time(), fram

[Spice-devel] [PATCH 09/14] Remove clang warning on marking a function const

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin ./static-plugin.hpp:29:5: warning: 'const' qualifier on function type 'PluginInitFunc' (aka 'bool (spice::streaming_agent::Agent *)') has no effect [-Wignored-qualifiers] const PluginInitFunc* const init_func; ^~ Signed-off-by: Christophe de Dinechin -

[Spice-devel] [PATCH 03/14] streaming_requested is really a bool

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index c4c52ef..760c211 100644 --- a/src/spice-streaming-

[Spice-devel] [PATCH 11/14] Replace inefficient C-style initialization with C++-style

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index e9ef310..9a5c4fa 100644 --- a/src/spice-streaming-agen

[Spice-devel] [PATCH 12/14] Get rid of C-style memset initializations, use C++ style aggregates

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 43 --- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index 9a5c4fa..a55

[Spice-devel] [PATCH 10/14] Remove clang warning on missing 'override'

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin In file included from mjpeg-fallback.cpp:8: ./mjpeg-fallback.hpp:28:25: warning: 'VideoCodecType' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] SpiceVideoCodecType VideoCodecType() const; ^ ../i

[Spice-devel] [PATCH 06/14] log_binary is really a boolean

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index e345d99..8f25940 100644 --- a/src/spice-streaming-a

[Spice-devel] [PATCH 00/14] Minor improvements and coding style changes to the streaming agent

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin This series implements a number of comments that were made during previous code reviews, including a reworked / udpated version of the stream RAII patch. Christophe de Dinechin (14): Add required header Capture 'cursor' by value streaming_requested is really a

[Spice-devel] [PATCH 02/14] Capture 'cursor' by value

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin We should really not be capturing cursor by reference here, since that value could be changed by the surrounding loop and sending the data could some day be made asynchronous. Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 2 +- 1 file ch

[Spice-devel] [PATCH 07/14] Do not create std::string for constants

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin As per e-mail discussions (https://patchwork.freedesktop.org/patch/200629/), using std::string for C-style string constants is against C++ good practices, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rstr-zstring for reference. S

[Spice-devel] [PATCH 13/14] Use C++ style for cursor message initialization instead of C style

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 49 +-- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index a55e1a5..7a3

[Spice-devel] [PATCH 05/14] Rename 'quit' to 'quit_requested' for consistency with 'streaming_requested'

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index 5fb20d1..e345d99 100644 --- a/src/spice-s

[Spice-devel] [PATCH 14/14] Do not test twice for the same condition

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index 7a3a46d..e825565 100644 --- a/src/spice-streaming-ag

[Spice-devel] [PATCH 08/14] Use RAII to cleanup stream in case of exception or return

2018-02-14 Thread Christophe de Dinechin
From: Christophe de Dinechin This lets us get rid of C-style 'goto done' in do_capture. Signed-off-by: Christophe de Dinechin --- src/spice-streaming-agent.cpp | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/spice-streaming-agent.cpp b

Re: [Spice-devel] [PATCH spice-streaming-agent v3] Remove reading start/stop commands from stdin

2018-02-14 Thread Frediano Ziglio
> > It was mainly a debugging feature for the early development stages. It > was agreed its usefulness is at the moment outweighed by the complexity > it brings to the code. > > Signed-off-by: Lukáš Hrázký Acked-by: Frediano Ziglio Frediano > --- > Changes since v2: > - fix grammar in the de

Re: [Spice-devel] [PATCH v2 12/13] Add guidelines about warnings and whitespaces

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 11:09:35AM +0100, Victor Toso wrote: > Hi, > > On Thu, Feb 08, 2018 at 05:01:05AM -0500, Frediano Ziglio wrote: > > > > Depends on many cases. You don't want spurious changes to make harder to > > > > look at the history for instance (that is a point for Nack). > > > > The

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Christophe Fergeau
On Wed, Feb 14, 2018 at 10:40:58AM -0500, Frediano Ziglio wrote: > > > > > On 14 Feb 2018, at 13:34, Lukáš Hrázký wrote: > > > > > > Introduce a unit test framework (Catch) to the codebase and a simple > > > unit test for parsing the options of the mjpeg plugin. > > > > > > Signed-off-by: Lukáš

Re: [Spice-devel] [PATCH v3 01/11] Add .clang-format with defaults matching what's specified in the style guide

2018-02-14 Thread Christophe Fergeau
On Wed, Feb 14, 2018 at 10:45:56AM -0500, Frediano Ziglio wrote: > > > > Shouldn't this go with a Makefile rule? A few lines in the log what this > > is about, what is the goal for having this file, ... would not hurt. > > > > Christophe > > > > I think this file is supposed to just help develo

[Spice-devel] [spice-server] style: Slight tweak to the header guard section

2018-02-14 Thread Christophe Fergeau
This changes the suggested style to what is currently used in spice-server codebase. This also removes a few sentences which are not really related to how one should format their header guards. Signed-off-by: Christophe Fergeau --- docs/spice_style.txt | 6 ++ 1 file changed, 2 insertions(+)

Re: [Spice-devel] [PATCH v3 09/11] Add mention of header guards

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 16:43, Christophe Fergeau wrote: > > On Thu, Feb 08, 2018 at 12:25:29PM +0100, Christophe de Dinechin wrote: >> From: Christophe de Dinechin >> >> Signed-off-by: Christophe de Dinechin >> --- >> docs/spice_style.txt | 19 +++ >> 1 file changed, 19 insertio

[Spice-devel] [PATCH spice-streaming-agent v3] Remove reading start/stop commands from stdin

2018-02-14 Thread Lukáš Hrázký
It was mainly a debugging feature for the early development stages. It was agreed its usefulness is at the moment outweighed by the complexity it brings to the code. Signed-off-by: Lukáš Hrázký --- Changes since v2: - fix grammar in the description - use ternary if for passing the LOG_PERROR flag

Re: [Spice-devel] [PATCH v3 01/11] Add .clang-format with defaults matching what's specified in the style guide

2018-02-14 Thread Frediano Ziglio
> > Shouldn't this go with a Makefile rule? A few lines in the log what this > is about, what is the goal for having this file, ... would not hurt. > > Christophe > I think this file is supposed to just help developers so should not be in the Makefile. I think you mean that the intention should

Re: [Spice-devel] [PATCH v3 09/11] Add mention of header guards

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 12:25:29PM +0100, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > docs/spice_style.txt | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/docs/spice_style.txt b/docs/spice_style.tx

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Frediano Ziglio
> > > On 14 Feb 2018, at 13:34, Lukáš Hrázký wrote: > > > > Introduce a unit test framework (Catch) to the codebase and a simple > > unit test for parsing the options of the mjpeg plugin. > > > > Signed-off-by: Lukáš Hrázký > > --- > > configure.ac | 3 ++ > > src/mjpe

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Lukáš Hrázký
On Wed, 2018-02-14 at 16:08 +0100, Christophe de Dinechin wrote: > > On 14 Feb 2018, at 13:34, Lukáš Hrázký wrote: > > > > Introduce a unit test framework (Catch) to the codebase and a simple > > unit test for parsing the options of the mjpeg plugin. > > > > Signed-off-by: Lukáš Hrázký > > ---

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Lukáš Hrázký
On Wed, 2018-02-14 at 09:22 -0500, Frediano Ziglio wrote: > > > > Introduce a unit test framework (Catch) to the codebase and a simple > > unit test for parsing the options of the mjpeg plugin. > > > > Signed-off-by: Lukáš Hrázký > > --- > > configure.ac | 3 ++ > > sr

Re: [Spice-devel] [PATCH spice-streaming-agent v2 3/4] use std::string where it's easy to replace

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 15:28, Christophe Fergeau wrote: > > On Thu, Feb 08, 2018 at 08:16:37AM +0100, Christophe de Dinechin wrote: >> Using std::string by default is *not* considered a good practice in >> C++. The reference for C++ good practices are probably best summarized >> by the C++ Core G

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 13:34, Lukáš Hrázký wrote: > > Introduce a unit test framework (Catch) to the codebase and a simple > unit test for parsing the options of the mjpeg plugin. > > Signed-off-by: Lukáš Hrázký > --- > configure.ac | 3 ++ > src/mjpeg-fallback.cpp

Re: [Spice-devel] [PATCH spice-streaming-agent v2 3/4] use std::string where it's easy to replace

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 08:16:37AM +0100, Christophe de Dinechin wrote: > Using std::string by default is *not* considered a good practice in > C++. The reference for C++ good practices are probably best summarized > by the C++ Core Guidelines: > https://github.com/isocpp/CppCoreGuidelines/blob/mas

Re: [Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Frediano Ziglio
> > Introduce a unit test framework (Catch) to the codebase and a simple > unit test for parsing the options of the mjpeg plugin. > > Signed-off-by: Lukáš Hrázký > --- > configure.ac | 3 ++ > src/mjpeg-fallback.cpp| 5 +++ > src/mjpeg-fallback.hpp

Re: [Spice-devel] [PATCH spice-streaming-agent] build: Do not use top_srcdir if not necessary

2018-02-14 Thread Christophe Fergeau
On Mon, Jan 29, 2018 at 05:16:12PM -0500, Frediano Ziglio wrote: > > > > > > > On 29 Jan 2018, at 12:00, Frediano Ziglio wrote: > > > > > > Signed-off-by: Frediano Ziglio > > > --- > > > Makefile.am | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/Makefi

Re: [Spice-devel] [PATCH spice-streaming-agent v2] Remove reading start/stop commands from stdin

2018-02-14 Thread Uri Lublin
On 02/14/2018 01:58 PM, Lukáš Hrázký wrote: It was mainly a debugging feature for the early development stages. It was agreed it's usefulness is at the moment outweighted by the its usefulness ... spellchecker also suggests: outweighed Looks good, see nit comment below (not important, smaller

Re: [Spice-devel] [RFC PATCH 1/1] separate and encapsulate the agent business code

2018-02-14 Thread Lukáš Hrázký
On Tue, 2018-02-13 at 17:10 +0100, Christophe de Dinechin wrote: > Hi Lukas, > > > You asked for it, so here is my TON (TON stands for TON of nits). Except for > what’s just below this, nothing major, just sharing ideas. I did ask, I'm glad for those that are relevant :D thanks. Bonus points fo

Re: [Spice-devel] [PATCH v3 10/11] Add guidelines about warnings and whitespaces

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 12:25:30PM +0100, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > The objective of these guidelines is that: > - We avoid introducing new warnings > - We know how to fix old ones > - We don't have to isolate whitespace changes when submitting patches, >

Re: [Spice-devel] [PATCH v3 11/11] Rewrite the style guide for headers

2018-02-14 Thread Christophe Fergeau
This one sounds more like an RFC to me, as from a quick look in server/, this is not the style currently in use. Christophe On Thu, Feb 08, 2018 at 12:25:31PM +0100, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > As written, the headers style guide looks quite wrong. In partic

Re: [Spice-devel] [PATCH v3 03/11] Specify file extensions for C++ and Obj-C

2018-02-14 Thread Christophe Fergeau
On Mon, Feb 12, 2018 at 03:23:06AM -0500, Frediano Ziglio wrote: > See > https://lists.freedesktop.org/archives/spice-devel/2018-February/041724.html > > > From: Christophe de Dinechin > > > > Signed-off-by: Christophe de Dinechin > > --- > > docs/spice_style.txt | 11 ++- > > 1 file

Re: [Spice-devel] [PATCH v2 11/13] Add mention of header guards

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 03:58:46AM -0500, Frediano Ziglio wrote: > > + > > +[source,h] > > +--- > > +#ifndef MY_MODULE_H > > +#define MY_MODULE_H > > + > > +... > > + > > +#endif /* MY_MODULE_H */ > > +--- > > + > > Are we suggesting C style only comment or is clear the is not important? > (I'm ju

Re: [Spice-devel] [PATCH v2 06/13] Rephrase section on short functions for readability

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 03:50:37AM -0500, Frediano Ziglio wrote: > > > > From: Christophe de Dinechin > > > > Signed-off-by: Christophe de Dinechin > > --- > > docs/spice_style.txt | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/docs/spice_style.txt b/docs/spice

Re: [Spice-devel] [PATCH v2 05/13] Rephrase section about constants

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 03:48:46AM -0500, Frediano Ziglio wrote: > I think that the "Alternatively, use global `const` variables." > is quite an ancient comment when spice-server was in C++ > (much before I join and I think even older than the git repository!) There was a C++ *client* in spice.git

Re: [Spice-devel] [PATCH v3 01/11] Add .clang-format with defaults matching what's specified in the style guide

2018-02-14 Thread Christophe Fergeau
Shouldn't this go with a Makefile rule? A few lines in the log what this is about, what is the goal for having this file, ... would not hurt. Christophe On Thu, Feb 08, 2018 at 12:25:21PM +0100, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinech

Re: [Spice-devel] [PATCH v3 04/11] Rephrase assertion section

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 12:25:24PM +0100, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > Signed-off-by: Christophe de Dinechin > --- > docs/spice_style.txt | 15 --- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/docs/spice_style.txt b/docs/sp

Re: [Spice-devel] [PATCH v3 04/11] Rephrase assertion section

2018-02-14 Thread Christophe Fergeau
On Tue, Feb 13, 2018 at 02:40:38PM +0100, Christophe de Dinechin wrote: > > > > On 13 Feb 2018, at 14:39, Frediano Ziglio wrote: > > > >>> > >>> On 12 Feb 2018, at 17:58, Frediano Ziglio wrote: > >>> > >>> In SPICE, as in Glib, ERROR is more "strong" than CRITICAL > >>> (I don't know where t

[Spice-devel] [PATCH spice-streaming-agent v3 1/3] mjpeg-fallback: a more high-level way of handling options

2018-02-14 Thread Lukáš Hrázký
Use C++ standard library: - std::string - std::stoi() to parse the numbers (also note atoi() behavior is undefined in case of errors) - exceptions for errors, makes testing and potential future changes to error handling easier. Signed-off-by: Lukáš Hrázký --- src/mjpeg-fallback.cpp | 41

[Spice-devel] [PATCH spice-streaming-agent v3 3/3] mjpeg-fallback: unittest for the options parsing

2018-02-14 Thread Lukáš Hrázký
Introduce a unit test framework (Catch) to the codebase and a simple unit test for parsing the options of the mjpeg plugin. Signed-off-by: Lukáš Hrázký --- configure.ac | 3 ++ src/mjpeg-fallback.cpp| 5 +++ src/mjpeg-fallback.hpp| 1 +

[Spice-devel] [PATCH spice-streaming-agent v3 2/3] src/unitests: add temporary files to .gitignore

2018-02-14 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/unittests/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unittests/.gitignore b/src/unittests/.gitignore index bb238d7..af41c48 100644 --- a/src/unittests/.gitignore +++ b/src/unittests/.gitignore @@ -1 +1,4 @@ /hexdump +/test-hexdump.sh

[Spice-devel] [PATCH spice-streaming-agent v3 0/3] first unit test and options parsing improvements

2018-02-14 Thread Lukáš Hrázký
This series introduces a C++ unit test framework called Catch to the codebase, adds a simple unit test for the options parsing for the mjpeg plugin and improves on the option parsing code. Since we more or less agreed we can solve the Catch package in RHEL one way or another, I suppose we can proc

[Spice-devel] [PATCH spice-streaming-agent v2] Remove reading start/stop commands from stdin

2018-02-14 Thread Lukáš Hrázký
It was mainly a debugging feature for the early development stages. It was agreed it's usefulness is at the moment outweighted by the complexity it brings to the code. Signed-off-by: Lukáš Hrázký --- Changes since v1: - Log also to stderr if it's a tty src/spice-streaming-agent.cpp | 72 +++

Re: [Spice-devel] [PATCH spice-streaming-agent] Remove reading start/stop commands from stdin

2018-02-14 Thread Christophe de Dinechin
> On 14 Feb 2018, at 11:46, Lukáš Hrázký wrote: > > It was mainly a debugging feature for the early development stages. It > was agreed it's usefulness is at the moment outweighted by the > complexity it brings to the code. > > Signed-off-by: Lukáš Hrázký > --- > src/spice-streaming-agent.cpp

[Spice-devel] [PATCH spice-streaming-agent] Remove reading start/stop commands from stdin

2018-02-14 Thread Lukáš Hrázký
It was mainly a debugging feature for the early development stages. It was agreed it's usefulness is at the moment outweighted by the complexity it brings to the code. Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 71 --- 1 file changed,

Re: [Spice-devel] [PATCH spice-gtk 1/4] tests: add spice+unix:// URI checks

2018-02-14 Thread Christophe de Dinechin
> On 13 Feb 2018, at 17:36, Marc-Andre Lureau wrote: > > I was not really fond of passing options via URI, but apparently this > is a standard practice. So is passing port number after a colon. Christophe ___ Spice-devel mailing list Spice-devel@li