Skip to content

Commit

Permalink
decode: opentelemetry: fix build warnings and add destroy method
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Prajapati <[email protected]>
  • Loading branch information
Aditya Prajapati authored and edsiper committed Oct 6, 2022
1 parent c10c966 commit d06200e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ctr_decode_opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,7 @@ static int convert_any_value(struct opentelemetry_decode_value *ctr_val,
{
int result;

result = -2;

switch (val->value_case) {
case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE__NOT_SET:
result = -1;
break;

case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE:
result = convert_string_value(ctr_val, value_type, key, val->string_value);
Expand Down Expand Up @@ -334,10 +329,10 @@ static int convert_any_value(struct opentelemetry_decode_value *ctr_val,
case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_BYTES_VALUE:
result = convert_bytes_value(ctr_val, value_type, key, val->bytes_value.data, val->bytes_value.len);
break;
}

if (result == -2) {
return -1;
default:
result = -1;
break;
}

return result;
Expand Down Expand Up @@ -591,3 +586,8 @@ int ctr_decode_opentelemetry_create(struct ctrace **out_ctr,

return 0;
}

void ctr_decode_opentelemetry_destroy(struct ctrace *ctr)
{
ctr_destroy(ctr);
}

0 comments on commit d06200e

Please sign in to comment.