Fixed incorrectly fixed Coverity bugs

This commit is contained in:
Martin Pulec
2019-11-12 15:15:22 +01:00
parent 0ba9d74e04
commit fa51f6e33c
3 changed files with 11 additions and 4 deletions

View File

@@ -89,7 +89,9 @@ public:
unsigned long long time_ms = time_since_epoch_in_ms();
auto flags = std::cerr.flags();
auto precision = std::cerr.precision();
std::cerr << "[" << std::fixed << std::setprecision(3) << time_ms / 1000.0 << "] " << flags << precision;
std::cerr << "[" << std::fixed << std::setprecision(3) << time_ms / 1000.0 << "] ";
std::cerr.precision(precision);
std::cerr.flags(flags);
}
return std::cerr;

View File

@@ -350,7 +350,7 @@ void print_capabilities(struct module *root, bool use_vidcap)
cout << "[cap][audio_compress] " << codec.first << std::endl;
}
cout << precision;
std::cout.precision(precision);
}
void print_version()
@@ -456,7 +456,9 @@ void print_pixel_formats(void) {
tag = codec_is_a_rgb(c) ? 'R' : 'Y';
auto width = cout.width();
auto flags = cout.flags();
cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << setw(2) << get_bits_per_component(c) << setw(0) << " " << get_codec_name_long(c) << setw(width) << "\n";
cout.flags(flags);
}
}
@@ -468,7 +470,10 @@ void print_video_codecs(void) {
}
tag = is_codec_interframe(c) ? 'I' : '.';
cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << " " << get_codec_name_long(c) << "\n";
auto width = cout.width();
auto flags = cout.flags();
cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << " " << get_codec_name_long(c) << setw(width) << "\n";
cout.flags(flags);
}
}

View File

@@ -226,7 +226,7 @@ static int count_utf8_bytes(unsigned int i) {
*/
static int64_t get_ansi_code() {
int64_t c = GETCH();
debug_msg(MOD_NAME "Pressed %" PRId32 "\n", c);
debug_msg(MOD_NAME "Pressed %" PRId64 "\n", c);
if (c == '[') { // CSI
c = '\E' << 8 | '[';
while (true) {