fix a lot of warnings about unused variables, or maybe uninitialized variables

This commit is contained in:
kistlin
2022-01-16 08:28:57 +01:00
parent 1185e4e114
commit 174158233b
17 changed files with 11 additions and 41 deletions

View File

@ -9,11 +9,9 @@ namespace ImGui {
std::lock_guard<std::mutex> lck(bufferMtx);
ImGuiWindow* window = GetCurrentWindow();
ImGuiStyle& style = GetStyle();
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), CalcItemWidth());
ImRect bb(min, ImVec2(min.x + size.x, min.y + size.y));
float lineHeight = size.y;
ItemSize(size, style.FramePadding.y);
if (!ItemAdd(bb, 0)) {
@ -22,7 +20,6 @@ namespace ImGui {
window->DrawList->AddRectFilled(min, ImVec2(min.x + size.x, min.y + size.y), IM_COL32(0, 0, 0, 255));
ImU32 col = ImGui::GetColorU32(ImGuiCol_CheckMark, 0.7f);
float increment = size.x / 1024.0f;
for (int i = 0; i < 1024; i++) {
if (buffer[i].re > 1.5f || buffer[i].re < -1.5f) { continue; }
if (buffer[i].im > 1.5f || buffer[i].im < -1.5f) { continue; }

View File

@ -119,7 +119,6 @@ void FrequencySelect::draw() {
ImVec2 digitSz = ImGui::CalcTextSize("0");
ImVec2 commaSz = ImGui::CalcTextSize(".");
int digitHeight = digitSz.y;
int digitWidth = digitSz.x;
int commaOffset = 0;
bool zeros = true;

View File

@ -22,7 +22,6 @@ namespace ImGui {
ImGuiWindow* window = GetCurrentWindow();
ImGuiStyle& style = GetStyle();
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
// Calculate scale
@ -31,7 +30,6 @@ namespace ImGui {
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), height);
ImRect bb(min, ImVec2(min.x + size.x, min.y + size.y));
float lineHeight = size.y;
ItemSize(size, style.FramePadding.y);
if (!ItemAdd(bb, 0)) {

View File

@ -15,7 +15,6 @@ namespace ImGui {
ImGuiWindow* window = GetCurrentWindow();
ImGuiStyle& style = GetStyle();
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
// Calculate scale
@ -24,7 +23,6 @@ namespace ImGui {
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), height);
ImRect bb(min, ImVec2(min.x + size.x, min.y + size.y));
float lineHeight = size.y;
// If there are no lines, there is no point in drawing anything
if (_lineCount == 0) { return; }

View File

@ -11,16 +11,12 @@ namespace ImGui {
ImGuiWindow* window = GetCurrentWindow();
ImGuiStyle& style = GImGui->Style;
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), 26);
ImRect bb(min, min + size);
ImU32 text = ImGui::GetColorU32(ImGuiCol_Text);
float lineHeight = size.y;
ItemSize(size, style.FramePadding.y);
if (!ItemAdd(bb, 0)) {
return;

View File

@ -18,11 +18,9 @@ namespace ImGui {
std::lock_guard<std::mutex> lck(bufferMtx);
ImGuiWindow* window = GetCurrentWindow();
ImGuiStyle& style = GetStyle();
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), 100);
ImRect bb(min, ImVec2(min.x + size.x, min.y + size.y));
float lineHeight = size.y;
ItemSize(size, style.FramePadding.y);
if (!ItemAdd(bb, 0)) {
@ -31,7 +29,6 @@ namespace ImGui {
window->DrawList->AddRectFilled(min, ImVec2(min.x + size.x, min.y + size.y), IM_COL32(0, 0, 0, 255));
ImU32 col = ImGui::GetColorU32(ImGuiCol_CheckMark, 0.7f);
ImU32 col2 = ImGui::GetColorU32(ImGuiCol_CheckMark, 0.7f);
float increment = size.x / (float)sampleCount;
float val;

View File

@ -14,8 +14,6 @@ namespace ImGui {
avg = std::clamp<float>(avg, val_min, val_max);
peak = std::clamp<float>(peak, val_min, val_max);
float pad = style.FramePadding.y;
ImVec2 min = window->DC.CursorPos;
ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), (GImGui->FontSize / 2) + style.FramePadding.y);
ImRect bb(min, min + size);

View File

@ -1155,7 +1155,6 @@ namespace ImGui {
}
void WaterfallVFO::updateDrawingVars(double viewBandwidth, float dataWidth, double viewOffset, ImVec2 widgetPos, int fftHeight) {
double width = (bandwidth / viewBandwidth) * (double)dataWidth;
int center = roundf((((centerOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
int left = roundf((((lowerOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));
int right = roundf((((upperOffset - viewOffset) / (viewBandwidth / 2.0)) + 1.0) * ((double)dataWidth / 2.0));

View File

@ -109,9 +109,8 @@ namespace ImGui {
float sFactor = ceilf(factor);
float uFactor;
float id = offset;
float val, maxVal;
float maxVal;
int sId;
uint32_t maxId;
for (int i = 0; i < outWidth; i++) {
maxVal = -INFINITY;
sId = (int)id;