diff --git a/api/include/opentelemetry/trace/default_span.h b/api/include/opentelemetry/trace/default_span.h index e588e591ce..6d6b0c9a68 100644 --- a/api/include/opentelemetry/trace/default_span.h +++ b/api/include/opentelemetry/trace/default_span.h @@ -25,10 +25,7 @@ class DefaultSpan : public Span void AddEvent(nostd::string_view name, core::SystemTimestamp timestamp, - const KeyValueIterable &attributes) noexcept - { - pass; - } + const KeyValueIterable &attributes) noexcept {} void AddEvent(nostd::string_view name, const KeyValueIterable &attributes) noexcept { diff --git a/api/include/opentelemetry/trace/propagation/http_trace_context.h b/api/include/opentelemetry/trace/propagation/http_trace_context.h index 0a0ed2eb54..d191b93134 100644 --- a/api/include/opentelemetry/trace/propagation/http_trace_context.h +++ b/api/include/opentelemetry/trace/propagation/http_trace_context.h @@ -95,14 +95,14 @@ class HttpTraceContext : public HTTPTextFormat static TraceId GenerateTraceIdFromString(nostd::string_view trace_id) { const char *trc_id = trace_id.begin(); - uint8_t buf[16]; + uint8_t buf[kTraceIdBytes/2]; int tmp; - for (int i = 0; i < 32; i++) + for (int i = 0; i < kTraceIdBytes; i++) { tmp = CharToInt(*trc_id); if (tmp < 0) { - for (int j = 0; j < 16; j++) + for (int j = 0; j < kTraceIdBytes/2; j++) { buf[j] = 0; } @@ -124,14 +124,14 @@ class HttpTraceContext : public HTTPTextFormat static SpanId GenerateSpanIdFromString(nostd::string_view span_id) { const char *spn_id = span_id.begin(); - uint8_t buf[8]; + uint8_t buf[kSpanIdBytes/2]; int tmp; - for (int i = 0; i < 16; i++) + for (int i = 0; i < kSpanIdBytes; i++) { tmp = CharToInt(*spn_id); if (tmp < 0) { - for (int j = 0; j < 8; j++) + for (int j = 0; j < kSpanIdBytes/2; j++) { buf[j] = 0; }