Merge pull request #591 from kistlin/fix/unused_variables_warnings

fix warnings about unused/maybe uninitialized variables
This commit is contained in:
AlexandreRouma 2022-01-22 04:29:00 +01:00 committed by GitHub
commit da06fc39db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 1 additions and 35 deletions

View File

@ -288,7 +288,6 @@ namespace dsp {
{
std::lock_guard<std::mutex> lck(bufMtx);
memcpy(buffers[writeCur], _in->readBuf, count * sizeof(T));
uintptr_t ptr = (uintptr_t)buffers[writeCur];
sizes[writeCur] = count;
writeCur++;
writeCur = ((writeCur) % TEST_BUFFER_SIZE);

View File

@ -37,7 +37,6 @@ namespace colormaps {
map.map = new float[mapTxt.size() * 3];
int i = 0;
for (auto const& col : mapTxt) {
uint8_t r, g, b, a;
map.map[i * 3] = std::stoi(col.substr(1, 2), NULL, 16);
map.map[(i * 3) + 1] = std::stoi(col.substr(3, 2), NULL, 16);
map.map[(i * 3) + 2] = std::stoi(col.substr(5, 2), NULL, 16);

View File

@ -354,12 +354,6 @@ void MainWindow::draw() {
core::configManager.release(true);
}
ImVec2 vMin = ImGui::GetWindowContentRegionMin();
ImVec2 vMax = ImGui::GetWindowContentRegionMax();
int width = vMax.x - vMin.x;
int height = vMax.y - vMin.y;
// To Bar
ImGui::PushID(ImGui::GetID("sdrpp_menu_btn"));
if (ImGui::ImageButton(icons::MENU, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(GLFW_KEY_MENU, false)) {
@ -489,7 +483,6 @@ void MainWindow::draw() {
ImGui::SetColumnWidth(1, winSize.x - menuWidth - 60);
ImGui::SetColumnWidth(2, 60);
ImGui::BeginChild("Left Column");
float menuColumnWidth = ImGui::GetContentRegionAvailWidth();
if (gui::menu.draw(firstMenuRender)) {
core::configManager.acquire();

View File

@ -104,7 +104,6 @@ namespace vfo_color_menu {
vfoColors[name] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
vfo->color = IM_COL32(255, 255, 255, 50);
core::configManager.acquire();
char buf[16];
core::configManager.conf["vfoColors"][name] = "#FFFFFF";
core::configManager.release(true);
}

View File

@ -44,7 +44,6 @@ namespace tuner {
double viewBottom = view - (viewBW / 2.0);
double viewTop = view + (viewBW / 2.0);
double wholeFreq = gui::waterfall.getCenterFrequency();
double bottom = -(BW / 2.0);
double top = (BW / 2.0);
@ -78,7 +77,6 @@ namespace tuner {
if (delta < 0) {
double newViewOff = vfoTop - (viewBW / 2.0) + (viewBW / 10.0);
double newViewBottom = newViewOff - (viewBW / 2.0);
double newViewTop = newViewOff + (viewBW / 2.0);
if (newViewBottom > bottom) {
gui::waterfall.setViewOffset(newViewOff);
@ -94,7 +92,6 @@ namespace tuner {
}
else {
double newViewOff = vfoBottom + (viewBW / 2.0) - (viewBW / 10.0);
double newViewBottom = newViewOff - (viewBW / 2.0);
double newViewTop = newViewOff + (viewBW / 2.0);
if (newViewTop < top) {

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;

View File

@ -107,7 +107,6 @@ namespace net {
int ret;
if (_udp) {
int fromLen = sizeof(remoteAddr);
ret = sendto(_sock, (char*)buf, count, 0, (struct sockaddr*)&remoteAddr, sizeof(remoteAddr));
if (ret <= 0) {
{
@ -470,7 +469,6 @@ namespace net {
throw std::runtime_error("Could get address from host");
return NULL;
}
uint32_t* naddr = (uint32_t*)_host->h_addr_list[0];
// Get address from remote hostname/ip
hostent* _remoteHost = gethostbyname(remoteHost.c_str());