All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osmtest - code cleanup
@ 2009-10-12 18:57 Stan C. Smith
  2009-10-12 21:40 ` Sasha Khapyorsky
  0 siblings, 1 reply; 6+ messages in thread
From: Stan C. Smith @ 2009-10-12 18:57 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'; +Cc: ofw, 'linux-rdma'


Remove unused ifdef __WIN__ & redundant include.

Signed-off-by: stan smith <stan.smith@intel.com>

diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
index c6ec955..82a814e 100644
--- a/opensm/osmtest/osmtest.c
+++ b/opensm/osmtest/osmtest.c
@@ -43,19 +43,13 @@
  *
  */
 
-#ifdef __WIN__
-#pragma warning(disable : 4996)
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef __WIN__
-#include <complib/cl_timer.h>
-#else
+#ifndef __WIN__
 #include <strings.h>
-#include <sys/time.h>
 #endif
+#include <sys/time.h>
 #include <complib/cl_debug.h>
 #include "osmtest.h"

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

* Re: [PATCH] osmtest - code cleanup
  2009-10-12 18:57 [PATCH] osmtest - code cleanup Stan C. Smith
@ 2009-10-12 21:40 ` Sasha Khapyorsky
  2009-10-12 21:49   ` Smith, Stan
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 21:40 UTC (permalink / raw)
  To: Stan C. Smith; +Cc: ofw, 'linux-rdma'

On 11:57 Mon 12 Oct     , Stan C. Smith wrote:
> 
> Remove unused ifdef __WIN__ & redundant include.
> 
> Signed-off-by: stan smith <stan.smith@intel.com>

Applied. Thanks. The question is below.

> 
> diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
> index c6ec955..82a814e 100644
> --- a/opensm/osmtest/osmtest.c
> +++ b/opensm/osmtest/osmtest.c
> @@ -43,19 +43,13 @@
>   *
>   */
>  
> -#ifdef __WIN__
> -#pragma warning(disable : 4996)
> -#endif
> -
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> -#ifdef __WIN__
> -#include <complib/cl_timer.h>
> -#else
> +#ifndef __WIN__
>  #include <strings.h>
> -#include <sys/time.h>
>  #endif

I suppose that windows should have string.h, right? Assuming so could we
remove '#ifndef __WIN__' completely here?

Sasha

> +#include <sys/time.h>
>  #include <complib/cl_debug.h>
>  #include "osmtest.h"
>  
> 

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

* RE: [PATCH] osmtest - code cleanup
  2009-10-12 21:40 ` Sasha Khapyorsky
@ 2009-10-12 21:49   ` Smith, Stan
  2009-10-12 22:07     ` [PATCH] osmtest/osmtest.c: remove strings.h inclusion Sasha Khapyorsky
  2009-10-12 22:15     ` [PATCH] osmtest - code cleanup Sasha Khapyorsky
  0 siblings, 2 replies; 6+ messages in thread
From: Smith, Stan @ 2009-10-12 21:49 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: ofw, 'linux-rdma'

Sasha Khapyorsky wrote:
> On 11:57 Mon 12 Oct     , Stan C. Smith wrote:
>>
>> Remove unused ifdef __WIN__ & redundant include.
>>
>> Signed-off-by: stan smith <stan.smith@intel.com>
>
> Applied. Thanks. The question is below.
>
>>
>> diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
>> index c6ec955..82a814e 100644 --- a/opensm/osmtest/osmtest.c
>> +++ b/opensm/osmtest/osmtest.c
>> @@ -43,19 +43,13 @@
>>   *
>>   */
>>
>> -#ifdef __WIN__
>> -#pragma warning(disable : 4996)
>> -#endif
>> -
>>  #include <stdio.h>
>>  #include <stdlib.h>
>>  #include <string.h>
>> -#ifdef __WIN__
>> -#include <complib/cl_timer.h>
>> -#else
>> +#ifndef __WIN__
>>  #include <strings.h>
>> -#include <sys/time.h>
>>  #endif
>
> I suppose that windows should have string.h, right? Assuming so could
> we remove '#ifndef __WIN__' completely here?

Yes - I missed this in the linux env. According to the strings.h file, if string.h is included prior, then strings.h is a nop. Seems the include of strings.h could be removed along with the ifndef __WIN__.
Good catch.

How do you feel about replacing ifndef __WIN__ with ifdef __linux__ in other situations?


>
> Sasha
>
>> +#include <sys/time.h>
>>  #include <complib/cl_debug.h>
>>  #include "osmtest.h"

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

* [PATCH] osmtest/osmtest.c: remove strings.h inclusion
  2009-10-12 21:49   ` Smith, Stan
@ 2009-10-12 22:07     ` Sasha Khapyorsky
  2009-10-12 22:25       ` Smith, Stan
  2009-10-12 22:15     ` [PATCH] osmtest - code cleanup Sasha Khapyorsky
  1 sibling, 1 reply; 6+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 22:07 UTC (permalink / raw)
  To: Smith, Stan; +Cc: ofw, 'linux-rdma'


Remove redundant strings.h inclusion (and associated ifndef __WIN__).

Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>
---
 opensm/osmtest/osmtest.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
index 3618ea3..f0f23c7 100644
--- a/opensm/osmtest/osmtest.c
+++ b/opensm/osmtest/osmtest.c
@@ -46,9 +46,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifndef __WIN__
-#include <strings.h>
-#endif
 #include <sys/time.h>
 #include <complib/cl_debug.h>
 #include "osmtest.h"
-- 
1.6.5

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

* Re: [PATCH] osmtest - code cleanup
  2009-10-12 21:49   ` Smith, Stan
  2009-10-12 22:07     ` [PATCH] osmtest/osmtest.c: remove strings.h inclusion Sasha Khapyorsky
@ 2009-10-12 22:15     ` Sasha Khapyorsky
  1 sibling, 0 replies; 6+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 22:15 UTC (permalink / raw)
  To: Smith, Stan; +Cc: ofw, 'linux-rdma'

On 14:49 Mon 12 Oct     , Smith, Stan wrote:
> 
> How do you feel about replacing ifndef __WIN__ with ifdef __linux__ in other situations?

He-he :) Don't like this:

1. The current porting is going from linux to windows and not otherwise.

2. 'ifndef __WIN__' is not the same as 'ifdef __LIN__' - there are a
non-linux platforms with pretty compatible development tools (such as
Solaris, MacOSX, couple of embedded-es, etc.).

Sasha

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

* RE: [PATCH] osmtest/osmtest.c: remove strings.h inclusion
  2009-10-12 22:07     ` [PATCH] osmtest/osmtest.c: remove strings.h inclusion Sasha Khapyorsky
@ 2009-10-12 22:25       ` Smith, Stan
  0 siblings, 0 replies; 6+ messages in thread
From: Smith, Stan @ 2009-10-12 22:25 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: ofw, 'linux-rdma'

Sasha Khapyorsky wrote:
> Remove redundant strings.h inclusion (and associated ifndef __WIN__).
>
> Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>
> ---
>  opensm/osmtest/osmtest.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
> index 3618ea3..f0f23c7 100644
> --- a/opensm/osmtest/osmtest.c
> +++ b/opensm/osmtest/osmtest.c
> @@ -46,9 +46,6 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> -#ifndef __WIN__
> -#include <strings.h>
> -#endif
>  #include <sys/time.h>
>  #include <complib/cl_debug.h>
>  #include "osmtest.h"

Looking better all the time...

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

end of thread, other threads:[~2009-10-12 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 18:57 [PATCH] osmtest - code cleanup Stan C. Smith
2009-10-12 21:40 ` Sasha Khapyorsky
2009-10-12 21:49   ` Smith, Stan
2009-10-12 22:07     ` [PATCH] osmtest/osmtest.c: remove strings.h inclusion Sasha Khapyorsky
2009-10-12 22:25       ` Smith, Stan
2009-10-12 22:15     ` [PATCH] osmtest - code cleanup Sasha Khapyorsky

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.