Project

General

Profile

Bug #23685

Unitialized variable codec

Added by Iker de Icaza Astiz about 2 months ago. Updated 15 days ago.

Status:
Closed
Priority:
Low
Start date:
12/02/2019
Due date:
% Done:

100%

Estimated time:
Co-Assignees:
Duration:

Description

Running cppcheck, a static code checker, there are three issues related to uninitialised variables.

Checking db_dialog.cpp ...
db_dialog.cpp:32:16: error: Uninitialized variable: codec [uninitvar]
  daq_string = codec->codecForMib(106)->toUnicode(byte_status).split("\n", QString::KeepEmptyParts);
               ^
2/5 files checked 25% done
Checking main.cpp ...
3/5 files checked 25% done
Checking mainwindow.cpp ...
mainwindow.cpp:138:28: error: Uninitialized variable: codec [uninitvar]
  QStringList daq_string = codec->codecForMib(106)->toUnicode(byte_status).split("'", QString::KeepEmptyParts);
                           ^
mainwindow.cpp:476:16: error: Uninitialized variable: codec [uninitvar]
  daq_string = codec->codecForMib(106)->toUnicode(daq_byte_array);
               ^

We need to find the right value to initialise them with.

As a reference for possible values see:
https://doc.qt.io/qt-5/qtextcodec.html


Related issues

Blocks ArtDaq RunControl GUI - Milestone #22444: v0_01_00: Plug and PlayNew12/09/2019

History

#1 Updated by Iker de Icaza Astiz about 1 month ago

#2 Updated by Iker de Icaza Astiz about 1 month ago

  • Assignee set to Iker de Icaza Astiz

#3 Updated by Iker de Icaza Astiz 15 days ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Commit 57e90e7f91d573 solves this. Note that Mib 106 is UTF-8.

All cppchecks passing.

#4 Updated by Iker de Icaza Astiz 15 days ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF