quick LGTM fixes

old-commit-hash: 3463f1165e
commatwo_master
Adeeb Shihadeh 5 years ago
parent ce6dd8d4e9
commit f69483e094
  1. 2
      selfdrive/common/visionimg.cc
  2. 4
      selfdrive/locationd/ubloxd_test.cc
  3. 5
      tools/lib/index_log/index_log.cc

@ -49,7 +49,7 @@ VisionImg visionimg_alloc_rgb24(int width, int height, VisionBuf *out_buf) {
visionimg_compute_aligned_width_and_height(width, height, &aligned_w, &aligned_h);
int stride = aligned_w * 3;
size_t size = aligned_w * aligned_h * 3;
size_t size = (size_t) aligned_w * aligned_h * 3;
VisionBuf buf = visionbuf_allocate(size);

@ -26,13 +26,13 @@
using namespace ublox;
extern volatile sig_atomic_t do_exit;
void write_file(std::string fpath, uint8_t *to_write, int len) {
void write_file(std::string fpath, uint8_t *to_write, int length) {
FILE* f = fopen(fpath.c_str(), "wb");
if (!f) {
std::cout << "Open " << fpath << " failed" << std::endl;
return;
}
fwrite(to_write, len, 1, f);
fwrite(to_write, length, 1, f);
fclose(f);
}

@ -41,7 +41,6 @@ int main(int argc, char** argv) {
auto words = kj::arrayPtr((const capnp::word*)log_data, log_size/sizeof(capnp::word));
while (words.size() > 0) {
uint64_t idx = ((uintptr_t)words.begin() - (uintptr_t)log_data);
// printf("%llu - %ld\n", idx, words.size());
const char* idx_bytes = (const char*)&idx;
@ -49,11 +48,9 @@ int main(int argc, char** argv) {
try {
capnp::FlatArrayMessageReader reader(words);
words = kj::arrayPtr(reader.getEnd(), words.end());
} catch (kj::Exception exc) {
} catch (const kj::Exception& exc) {
break;
}
}
munmap(log_data, log_size);

Loading…
Cancel
Save