mirror of
https://github.com/emqx/neuron.git
synced 2026-10-28 22:59:34 +08:00
fixbug:index error when endian in BL or LB
This commit is contained in:
@@ -411,7 +411,7 @@ static void fix_value(neu_datatag_t *tag, neu_type_e value_type,
|
||||
switch (tag->option.value32.endian) {
|
||||
case NEU_DATATAG_ENDIAN_LB32:
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes + 2);
|
||||
neu_ntohs_p((uint16_t *) (value->value.bytes.bytes + 2));
|
||||
break;
|
||||
case NEU_DATATAG_ENDIAN_BB32:
|
||||
value->value.u32 = htonl(value->value.u32);
|
||||
@@ -419,7 +419,7 @@ static void fix_value(neu_datatag_t *tag, neu_type_e value_type,
|
||||
case NEU_DATATAG_ENDIAN_BL32:
|
||||
value->value.u32 = htonl(value->value.u32);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes + 2);
|
||||
neu_ntohs_p((uint16_t *) (value->value.bytes.bytes + 2));
|
||||
break;
|
||||
case NEU_DATATAG_ENDIAN_LL32:
|
||||
default:
|
||||
@@ -435,7 +435,7 @@ static void fix_value(neu_datatag_t *tag, neu_type_e value_type,
|
||||
switch (tag->option.value32.endian) {
|
||||
case NEU_DATATAG_ENDIAN_LB32:
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes + 2);
|
||||
neu_ntohs_p((uint16_t *) (value->value.bytes.bytes + 2));
|
||||
break;
|
||||
case NEU_DATATAG_ENDIAN_BB32:
|
||||
value->value.u32 = htonl(value->value.u32);
|
||||
@@ -443,7 +443,7 @@ static void fix_value(neu_datatag_t *tag, neu_type_e value_type,
|
||||
case NEU_DATATAG_ENDIAN_BL32:
|
||||
value->value.u32 = htonl(value->value.u32);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes);
|
||||
neu_ntohs_p((uint16_t *) value->value.bytes.bytes + 2);
|
||||
neu_ntohs_p((uint16_t *) (value->value.bytes.bytes + 2));
|
||||
break;
|
||||
case NEU_DATATAG_ENDIAN_LL32:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user