mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
quick LGTM fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user