File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,8 @@ typedef struct {
189
189
* variant, which is used to print the variant name.
190
190
*/
191
191
#define UCP_FOREACH_PROTO_VARIANT (_macro ) \
192
- _macro(UCP_PROTO_VARIANT_LAT, UCS_KBYTE , "lat ") \
193
- _macro(UCP_PROTO_VARIANT_BW, UCS_GBYTE , "bw ")
192
+ _macro(UCP_PROTO_VARIANT_BW, UCS_GBYTE , "bw ") \
193
+ _macro(UCP_PROTO_VARIANT_LAT, UCS_KBYTE , "lat ")
194
194
195
195
/**
196
196
* Protocol selection variant enum
Original file line number Diff line number Diff line change @@ -413,9 +413,10 @@ ucp_proto_common_get_variant_msg_size(ucp_proto_variant_t variant)
413
413
#define UCP_PROTO_VARIANT_IT (ID, MSG_SIZE, _ ) case ID: return MSG_SIZE;
414
414
switch (variant) {
415
415
UCP_FOREACH_PROTO_VARIANT (UCP_PROTO_VARIANT_IT)
416
- default : ucs_assert_always (0 );
417
416
}
418
417
#undef UCP_PROTO_VARIANT_IT
418
+ ucs_fatal (" unexpected variant %d" , variant);
419
+ return 0 ;
419
420
}
420
421
421
422
static UCS_F_ALWAYS_INLINE const char *
@@ -424,9 +425,16 @@ ucp_proto_common_get_variant_name(ucp_proto_variant_t variant)
424
425
#define UCP_PROTO_VARIANT_IT (ID, _, NAME ) case ID: return NAME;
425
426
switch (variant) {
426
427
UCP_FOREACH_PROTO_VARIANT (UCP_PROTO_VARIANT_IT)
427
- default : ucs_assert_always (0 );
428
428
}
429
429
#undef UCP_PROTO_VARIANT_IT
430
+ ucs_fatal (" unexpected variant %d" , variant);
431
+ return NULL ;
432
+ }
433
+
434
+ static UCS_F_ALWAYS_INLINE size_t
435
+ ucp_proto_common_get_variants_count (ucp_context_h context)
436
+ {
437
+ return context->config .ext .proto_variants_enable ? UCP_PROTO_VARIANT_LAST : 1 ;
430
438
}
431
439
432
440
#endif
You can’t perform that action at this time.
0 commit comments