public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] opensm - add OSM_CDECL to qsort compare function definitions
@ 2009-10-08 16:46 Stan C. Smith
  2009-10-08 17:10 ` Sean Hefty
  0 siblings, 1 reply; 4+ messages in thread
From: Stan C. Smith @ 2009-10-08 16:46 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'; +Cc: ofw, 'linux-rdma'


X86 linkage requires __cdecl attribute on qsort() compare function definition; matches Windows qsort() prototype.
Add existing OSM_CDECL to qsort() compare function defintions.
OSM_CDECL defined blank for Linux.

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

diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
index 9469420..a2a3a12 100644
--- a/opensm/opensm/osm_mesh.c
+++ b/opensm/opensm/osm_mesh.c
@@ -1368,7 +1368,7 @@ static int reorder_links(lash_t *p_lash, mesh_t *mesh)
 /*
  * compare two switches in a sort
  */
-static int compare_switches(const void *p1, const void *p2)
+static int OSM_CDECL compare_switches(const void *p1, const void *p2)
 {
 	const comp_t *cp1 = p1, *cp2 = p2;
 	const sort_ctx_t *ctx = &cp1->ctx;
diff --git a/opensm/opensm/osm_ucast_ftree.c b/opensm/opensm/osm_ucast_ftree.c
index 1defd95..bafe9ce 100644
--- a/opensm/opensm/osm_ucast_ftree.c
+++ b/opensm/opensm/osm_ucast_ftree.c
@@ -225,7 +225,7 @@ typedef struct ftree_fabric_t_ {
  **
  ***************************************************/
 
-static int compare_switches_by_index(IN const void *p1, IN const void *p2)
+static int OSM_CDECL compare_switches_by_index(IN const void *p1, IN const void *p2)
 {
 	ftree_sw_t **pp_sw1 = (ftree_sw_t **) p1;
 	ftree_sw_t **pp_sw2 = (ftree_sw_t **) p2;
@@ -242,7 +242,7 @@ static int compare_switches_by_index(IN const void *p1, IN const void *p2)
 
 /***************************************************/
 
-static int
+static int OSM_CDECL
 compare_port_groups_by_remote_switch_index(IN const void *p1, IN const void *p2)
 {
 	ftree_port_group_t **pp_g1 = (ftree_port_group_t **) p1;
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index be37df9..57cf2ad 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -723,7 +723,7 @@ static void sw_count_endport_links(osm_switch_t * sw)
 	}
 }
 
-static int compar_sw_load(const void *s1, const void *s2)
+static int OSM_CDECL compar_sw_load(const void *s1, const void *s2)
 {
 #define get_sw_endport_links(s) (*(osm_switch_t **)s)->endport_links
 	return get_sw_endport_links(s2) - get_sw_endport_links(s1);

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

end of thread, other threads:[~2009-10-08 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-08 16:46 [PATCH] opensm - add OSM_CDECL to qsort compare function definitions Stan C. Smith
2009-10-08 17:10 ` Sean Hefty
     [not found]   ` <7E11A1A23B5A46DB8BB84556E67BF487-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-08 17:59     ` [ofw] " Jason Gunthorpe
2009-10-08 18:09       ` Sean Hefty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox