Define fpp_t and f_cnt_t to be of size_t (#7363)

Defines `fpp_t` and `f_cnt_t` to be of `size_t` within `lmms_basics.h`.  Most of the codebase used `fpp_t` to represent the size of an array of sample frames, which is incorrect, given that `fpp_t` was only 16 bits when sizes greater than 32767 are very possible. `f_cnt_t` was defined as `size_t` as well for consistency.

---------

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
This commit is contained in:
saker
2024-07-09 06:27:33 -04:00
committed by GitHub
parent f2c815b214
commit 1420a1f7e8
21 changed files with 84 additions and 74 deletions

View File

@@ -25,11 +25,12 @@
#ifndef LMMS_INSTRUMENT_FUNCTIONS_H
#define LMMS_INSTRUMENT_FUNCTIONS_H
#include "JournallingObject.h"
#include "lmms_basics.h"
#include <array>
#include "AutomatableModel.h"
#include "TempoSyncKnobModel.h"
#include "ComboBoxModel.h"
#include "JournallingObject.h"
#include "TempoSyncKnobModel.h"
namespace lmms
{

View File

@@ -25,8 +25,10 @@
#ifndef LMMS_PIANO_H
#define LMMS_PIANO_H
#include "Note.h"
#include <array>
#include "Model.h"
#include "Note.h"
namespace lmms
{

View File

@@ -28,8 +28,9 @@
#include "lmms_basics.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cmath>
namespace lmms

View File

@@ -31,10 +31,7 @@
#include "lmmsconfig.h"
#include <cstdint>
#include <array>
#include <cmath>
#include <algorithm>
namespace lmms
@@ -49,8 +46,8 @@ using sample_t = float; // standard sample-type
using int_sample_t = int16_t; // 16-bit-int-sample
using sample_rate_t = uint32_t; // sample-rate
using fpp_t = int16_t; // frames per period (0-16384)
using f_cnt_t = int32_t; // standard frame-count
using fpp_t = size_t; // frames per period (0-16384)
using f_cnt_t = size_t; // standard frame-count
using ch_cnt_t = uint8_t; // channel-count (0-DEFAULT_CHANNELS)
using bpm_t = uint16_t; // tempo (MIN_BPM to MAX_BPM)
using bitrate_t = uint16_t; // bitrate in kbps