Fixing a broken compilation on windows (problems with data types).

Signed-off-by:  Yevgeny Kliteynik <[EMAIL PROTECTED]>

Index: opensm/osm_ucast_file.c
===================================================================
--- opensm/osm_ucast_file.c     (revision 10009)
+++ opensm/osm_ucast_file.c     (working copy)
@@ -113,7 +113,7 @@ static void add_lid_hops(osm_opensm_t *p
                         uint8_t hops[], unsigned len)
 {
        uint16_t new_lid;
-       unsigned i;
+       uint8_t i;
 
        new_lid = guid ? remap_lid(p_osm, lid, guid) : lid;
        if (len > osm_switch_get_num_ports(p_sw))
@@ -370,7 +370,8 @@ static int do_lid_matrix_file_load(void 
                                        file_name, lineno, p);
                                return -1;
                        }
-                       lid = num;
+                       /* We have just checked the range, so casting is safe */
+                       lid = (uint16_t)num;
                        p = q;
                        while (isspace(*p) || *p == ':')
                                p++;
@@ -383,7 +384,8 @@ static int do_lid_matrix_file_load(void 
                                        file_name, lineno, p);
                                        return -1;
                                }
-                               hops[len++] = num;
+                               /* We have just checked the range, so casting 
is safe */
+                               hops[len++] = (uint8_t)num;
                                p = q;
                                while (isspace(*p))
                                        p++;




_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to