Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9494b736 authored by George Burgess IV's avatar George Burgess IV Committed by George Burgess
Browse files

fix a signed/unsigned comparison warning

The comparison was farther down; we'd compare a size_t vector index
with an int index.

Complaint from clang:

vr_hwc.cpp:152:11: warning: comparison of integers of different signs:
'size_t' (aka 'unsigned long') and 'int'

Bug: None
Test: mma shows no more warning.
Change-Id: Icabb5d4bb3c554ffe01a25af975a05bd58f336a1
parent a2d9c1e4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -132,13 +132,14 @@ void HwcDisplay::GetChangedCompositionTypes(
              return lhs.info.z_order < rhs.info.z_order;
            });

  int first_client_layer = -1, last_client_layer = -1;
  const size_t no_layer = std::numeric_limits<size_t>::max();
  size_t first_client_layer = no_layer, last_client_layer = no_layer;
  for (size_t i = 0; i < layers_.size(); ++i) {
    switch (layers_[i].composition_type) {
      case IComposerClient::Composition::SOLID_COLOR:
      case IComposerClient::Composition::CURSOR:
      case IComposerClient::Composition::SIDEBAND:
        if (first_client_layer < 0)
        if (first_client_layer == no_layer)
          first_client_layer = i;

        last_client_layer = i;