Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit dec85ad

Browse files
authored
Fix switch fallthrough warnings. (#387)
1 parent c550246 commit dec85ad

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

opencensus/exporters/stats/stackdriver/internal/stackdriver_utils.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ google::api::MetricDescriptor::ValueType GetValueType(
7777
return google::api::MetricDescriptor::DOUBLE;
7878
case opencensus::stats::MeasureDescriptor::Type::kInt64:
7979
return google::api::MetricDescriptor::INT64;
80+
default:
81+
ABSL_ASSERT(false && "Unknown measure_descriptor type.");
82+
return google::api::MetricDescriptor::DOUBLE;
8083
}
8184
case opencensus::stats::Aggregation::Type::kDistribution:
8285
return google::api::MetricDescriptor::DISTRIBUTION;

opencensus/stats/internal/view_data_impl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ ViewDataImpl::Type ViewDataImpl::TypeForDescriptor(
4141
case MeasureDescriptor::Type::kInt64:
4242
return ViewDataImpl::Type::kInt64;
4343
default:
44-
ABSL_ASSERT(false && "Bad ViewDataImpl type.");
45-
break;
44+
ABSL_ASSERT(false && "Unknown measure_descriptor type.");
45+
return ViewDataImpl::Type::kDouble;
4646
}
4747
case Aggregation::Type::kCount:
4848
return ViewDataImpl::Type::kInt64;
4949
case Aggregation::Type::kDistribution:
5050
return ViewDataImpl::Type::kDistribution;
5151
default:
52-
ABSL_ASSERT(false && "Bad ViewDataImpl type.");
53-
break;
52+
ABSL_ASSERT(false && "Unknown aggregation type.");
53+
return ViewDataImpl::Type::kDouble;
5454
}
5555
case AggregationWindow::Type::kInterval:
5656
return ViewDataImpl::Type::kStatsObject;

0 commit comments

Comments
 (0)