All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: Fix compilation error in C++ due to inline function
@ 2015-03-24 14:52 Richard Palethorpe
  2015-03-27  7:40 ` Szymon Janc
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Palethorpe @ 2015-03-24 14:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Richard Palethorpe

This adds explicit typecasts to an inline function to make it C++ compatible.
---
 lib/bluetooth.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 6ca64b6..ab24443 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -345,8 +345,8 @@ typedef struct {
 
 static inline void bswap_128(const void *src, void *dst)
 {
-	const uint8_t *s = src;
-	uint8_t *d = dst;
+	const uint8_t *s = (const uint8_t *)src;
+	uint8_t *d = (uint8_t *)dst;
 	int i;
 
 	for (i = 0; i < 16; i++)
-- 
2.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib: Fix compilation error in C++ due to inline function
  2015-03-24 14:52 [PATCH] lib: Fix compilation error in C++ due to inline function Richard Palethorpe
@ 2015-03-27  7:40 ` Szymon Janc
  2015-03-27 10:53   ` Richard Palethorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Szymon Janc @ 2015-03-27  7:40 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: linux-bluetooth

Hi Richard,

On Tuesday 24 of March 2015 14:52:24 Richard Palethorpe wrote:
> This adds explicit typecasts to an inline function to make it C++
> compatible. ---
>  lib/bluetooth.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/bluetooth.h b/lib/bluetooth.h
> index 6ca64b6..ab24443 100644
> --- a/lib/bluetooth.h
> +++ b/lib/bluetooth.h
> @@ -345,8 +345,8 @@ typedef struct {
> 
>  static inline void bswap_128(const void *src, void *dst)
>  {
> -	const uint8_t *s = src;
> -	uint8_t *d = dst;
> +	const uint8_t *s = (const uint8_t *)src;
> +	uint8_t *d = (uint8_t *)dst;
>  	int i;

Just a nitpick: there should be space after cast
(see M5 in doc/coding-style.txt).

>  	for (i = 0; i < 16; i++)

Other than that patch looks good to me.

-- 
BR
Szymon Janc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib: Fix compilation error in C++ due to inline function
  2015-03-27  7:40 ` Szymon Janc
@ 2015-03-27 10:53   ` Richard Palethorpe
  2015-03-27 10:59     ` Szymon Janc
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Palethorpe @ 2015-03-27 10:53 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hello Szymon,

Sorry, I haven't submitted a patch before, so should I add the spaces
then resubmit it as [PATCH V2] with it signed off by you?

On Fri, Mar 27, 2015 at 7:40 AM, Szymon Janc <szymon.janc@tieto.com> wrote:
> Hi Richard,
>
> On Tuesday 24 of March 2015 14:52:24 Richard Palethorpe wrote:
>> This adds explicit typecasts to an inline function to make it C++
>> compatible. ---
>>  lib/bluetooth.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/bluetooth.h b/lib/bluetooth.h
>> index 6ca64b6..ab24443 100644
>> --- a/lib/bluetooth.h
>> +++ b/lib/bluetooth.h
>> @@ -345,8 +345,8 @@ typedef struct {
>>
>>  static inline void bswap_128(const void *src, void *dst)
>>  {
>> -     const uint8_t *s = src;
>> -     uint8_t *d = dst;
>> +     const uint8_t *s = (const uint8_t *)src;
>> +     uint8_t *d = (uint8_t *)dst;
>>       int i;
>
> Just a nitpick: there should be space after cast
> (see M5 in doc/coding-style.txt).
>
>>       for (i = 0; i < 16; i++)
>
> Other than that patch looks good to me.
>
> --
> BR
> Szymon Janc



-- 
Many thanks,

Richard Palethorpe

Software Developer

R&D Department

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lib: Fix compilation error in C++ due to inline function
  2015-03-27 10:53   ` Richard Palethorpe
@ 2015-03-27 10:59     ` Szymon Janc
  0 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-03-27 10:59 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: linux-bluetooth

On Friday 27 of March 2015 10:53:05 Richard Palethorpe wrote:
> Hello Szymon,
> 
> Sorry, I haven't submitted a patch before, so should I add the spaces
> then resubmit it as [PATCH V2] with it signed off by you?

Yes, please resend as [PATCH V2]. Since we don't use SOB in userspace code 
don't add any.

Also put sample compilation error in commit message (we usually do that for 
compilation fix patches).

And please don't top post.

> 
> On Fri, Mar 27, 2015 at 7:40 AM, Szymon Janc <szymon.janc@tieto.com> wrote:
> > Hi Richard,
> > 
> > On Tuesday 24 of March 2015 14:52:24 Richard Palethorpe wrote:
> >> This adds explicit typecasts to an inline function to make it C++
> >> compatible. ---
> >> 
> >>  lib/bluetooth.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/lib/bluetooth.h b/lib/bluetooth.h
> >> index 6ca64b6..ab24443 100644
> >> --- a/lib/bluetooth.h
> >> +++ b/lib/bluetooth.h
> >> @@ -345,8 +345,8 @@ typedef struct {
> >> 
> >>  static inline void bswap_128(const void *src, void *dst)
> >>  {
> >> 
> >> -     const uint8_t *s = src;
> >> -     uint8_t *d = dst;
> >> +     const uint8_t *s = (const uint8_t *)src;
> >> +     uint8_t *d = (uint8_t *)dst;
> >> 
> >>       int i;
> > 
> > Just a nitpick: there should be space after cast
> > (see M5 in doc/coding-style.txt).
> > 
> >>       for (i = 0; i < 16; i++)
> > 
> > Other than that patch looks good to me.
> > 
> > --
> > BR
> > Szymon Janc

-- 
BR
Szymon Janc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-27 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 14:52 [PATCH] lib: Fix compilation error in C++ due to inline function Richard Palethorpe
2015-03-27  7:40 ` Szymon Janc
2015-03-27 10:53   ` Richard Palethorpe
2015-03-27 10:59     ` Szymon Janc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.