[openib-general] [PATCH] Opensm - osmtest.c - add windows support

Yael Kalka yael at mellanox.co.il
Wed Feb 15 04:41:42 PST 2006


Hi Hal,

The following patch adds includes changes to support windows
compilation. The changes are of files to include, and a casting fix.

Yael

Signed-off-by:  Yael Kalka <yael at mellanox.co.il>

Index: osmtest/osmtest.c
===================================================================
--- osmtest/osmtest.c   (revision 5403)
+++ osmtest/osmtest.c   (working copy)
@@ -47,18 +47,28 @@
  * $Revision: 1.10 $
  */
 
+#ifdef __WIN__
+#pragma warning(disable : 4996)
+#endif
+
 /* next error code: 16A    */
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef __WIN__
+#include <string.h>
+#include <complib/cl_timer.h>
+#else
 #include <strings.h>
+#include <sys/time.h>
+#endif
 #include <complib/cl_debug.h>
 #include <complib/cl_memory.h>
 #include "osmtest.h"
-#include <sys/time.h>
-
 
+#ifndef __WIN__
 #define strnicmp strncasecmp
+#endif
 
 #define POOL_MIN_ITEMS  64
 #define GUID_ARRAY_SIZE 64
@@ -2653,7 +2663,7 @@ osmtest_stress_large_rmpp_pr( IN osmtest
            if (num_recs == 0)
                ratio = 0;
            else
-               ratio =   num_queries / num_recs;
+             ratio =   (float)(num_queries / num_recs);
            printf( "-I- Queries to Record Ratio is %" PRIu64 " records, %" PRIu64 " queries : %.2f \n",
                   num_recs, num_queries, ratio);
            print_freq = 0;




More information about the general mailing list