]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/sweeptimingwidget.cpp
Random simplifications, cosmetics/whitespace/consistency fixes.
[pulseview.git] / pv / widgets / sweeptimingwidget.cpp
index ec404c36c96f4f251c9dcc9e5034720c907ff231..d768620248003b14662a82d3f4dbde0ae5ba04a2 100644 (file)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "sweeptimingwidget.hpp"
 
 #include <cstdlib>
-
 #include <vector>
-
-#include <assert.h>
+#include <cassert>
 
 #include <extdef.h>
 
@@ -90,8 +87,7 @@ void SweepTimingWidget::show_list(const uint64_t *vals, size_t count)
        list_.clear();
        for (size_t i = 0; i < count; i++) {
                char *const s = sr_si_string_u64(vals[i], suffix_);
-               list_.addItem(QString::fromUtf8(s),
-                       qVariantFromValue(vals[i]));
+               list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i]));
                g_free(s);
        }
 
@@ -141,23 +137,20 @@ void SweepTimingWidget::show_125_list(uint64_t min, uint64_t max)
 
 uint64_t SweepTimingWidget::value() const
 {
-       switch(value_type_) {
+       switch (value_type_) {
        case None:
                return 0;
-
        case MinMaxStep:
                return (uint64_t)value_.value();
-
        case List:
        {
                const int index = list_.currentIndex();
                return (index >= 0) ? list_.itemData(
                        index).value<uint64_t>() : 0;
        }
-
        default:
                // Unexpected value type
-               assert(0);
+               assert(false);
                return 0;
        }
 }