c++ cleanup: standardize file extensions to .cc and .h (#20800)

* c++ cleanup: standardize file extensions to .cc and .h

* cleanup files_common
pull/20804/head
Dean Lee 2021-05-03 17:53:11 +08:00 committed by GitHub
parent 4bb3619a0e
commit 81491dc57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 132 additions and 132 deletions

View File

@ -331,7 +331,7 @@ selfdrive/sensord/libdiag.h
selfdrive/sensord/sensors_qcom.cc
selfdrive/sensord/sensors_qcom2.cc
selfdrive/sensord/sensors/*.cc
selfdrive/sensord/sensors/*.hpp
selfdrive/sensord/sensors/*.h
selfdrive/sensord/sensord
selfdrive/thermald/thermald.py
@ -346,18 +346,18 @@ selfdrive/test/test_onroad.py
selfdrive/ui/.gitignore
selfdrive/ui/SConscript
selfdrive/ui/*.cc
selfdrive/ui/*.hpp
selfdrive/ui/*.h
selfdrive/ui/ui
selfdrive/ui/text
selfdrive/ui/spinner
selfdrive/ui/qt/*.cc
selfdrive/ui/qt/*.hpp
selfdrive/ui/qt/*.h
selfdrive/ui/qt/offroad/*.cc
selfdrive/ui/qt/offroad/*.hpp
selfdrive/ui/qt/offroad/*.h
selfdrive/ui/qt/offroad/*.qml
selfdrive/ui/qt/widgets/*.cc
selfdrive/ui/qt/widgets/*.hpp
selfdrive/ui/qt/widgets/*.h
selfdrive/ui/qt/spinner_aarch64
selfdrive/ui/qt/text_aarch64

View File

@ -13,7 +13,7 @@
#include "common/timing.h"
#include "common/transformations/coordinates.hpp"
#include "common/transformations/orientation.hpp"
#include "selfdrive/sensord/sensors/constants.hpp"
#include "selfdrive/sensord/sensors/constants.h"
#include "models/live_kf.h"

View File

@ -2,7 +2,7 @@
#include "common/swaglog.h"
#include "common/timing.h"
#include "bmx055_accel.hpp"
#include "bmx055_accel.h"
BMX055_Accel::BMX055_Accel(I2CBus *bus) : I2CSensor(bus) {}

View File

@ -1,6 +1,6 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define BMX055_ACCEL_I2C_ADDR 0x18

View File

@ -2,7 +2,7 @@
#include <cmath>
#include "common/swaglog.h"
#include "bmx055_gyro.hpp"
#include "bmx055_gyro.h"
#define DEG2RAD(x) ((x) * M_PI / 180.0)

View File

@ -1,6 +1,6 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define BMX055_GYRO_I2C_ADDR 0x68

View File

@ -6,7 +6,7 @@
#include "common/swaglog.h"
#include "common/util.h"
#include "bmx055_magn.hpp"
#include "bmx055_magn.h"
static int16_t compensate_x(trim_data_t trim_data, int16_t mag_data_x, uint16_t data_rhall) {
uint16_t process_comp_x0 = data_rhall;

View File

@ -1,7 +1,7 @@
#pragma once
#include <tuple>
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define BMX055_MAGN_I2C_ADDR 0x10

View File

@ -2,8 +2,8 @@
#include "common/swaglog.h"
#include "common/timing.h"
#include "bmx055_temp.hpp"
#include "bmx055_accel.hpp"
#include "bmx055_temp.h"
#include "bmx055_accel.h"
BMX055_Temp::BMX055_Temp(I2CBus *bus) : I2CSensor(bus) {}

View File

@ -1,7 +1,7 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/bmx055_accel.hpp"
#include "sensors/i2c_sensor.h"
#include "sensors/bmx055_accel.h"
class BMX055_Temp : public I2CSensor {

View File

@ -1,7 +1,7 @@
#include <iostream>
#include <string>
#include "file_sensor.hpp"
#include "file_sensor.h"
FileSensor::FileSensor(std::string filename) : file(filename) {
}

View File

@ -4,7 +4,7 @@
#include <string>
#include "cereal/gen/cpp/log.capnp.h"
#include "sensors/sensor.hpp"
#include "sensors/sensor.h"
class FileSensor : public Sensor {

View File

@ -1,5 +1,5 @@
#include <iostream>
#include "i2c_sensor.hpp"
#include "i2c_sensor.h"
int16_t read_12_bit(uint8_t lsb, uint8_t msb){
uint16_t combined = (uint16_t(msb) << 8) | uint16_t(lsb & 0xF0);

View File

@ -3,8 +3,8 @@
#include <cstdint>
#include "cereal/gen/cpp/log.capnp.h"
#include "common/i2c.h"
#include "sensors/sensor.hpp"
#include "sensors/constants.hpp"
#include "sensors/sensor.h"
#include "sensors/constants.h"
int16_t read_12_bit(uint8_t lsb, uint8_t msb);
int16_t read_16_bit(uint8_t lsb, uint8_t msb);

View File

@ -3,8 +3,8 @@
#include "common/timing.h"
#include "light_sensor.hpp"
#include "constants.hpp"
#include "light_sensor.h"
#include "constants.h"
void LightSensor::get_event(cereal::SensorEventData::Builder &event){
uint64_t start_time = nanos_since_boot();

View File

@ -1,5 +1,5 @@
#pragma once
#include "file_sensor.hpp"
#include "file_sensor.h"
class LightSensor : public FileSensor {
public:

View File

@ -2,7 +2,7 @@
#include "common/swaglog.h"
#include "common/timing.h"
#include "lsm6ds3_accel.hpp"
#include "lsm6ds3_accel.h"
LSM6DS3_Accel::LSM6DS3_Accel(I2CBus *bus) : I2CSensor(bus) {}

View File

@ -1,6 +1,6 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define LSM6DS3_ACCEL_I2C_ADDR 0x6A

View File

@ -3,7 +3,7 @@
#include "common/swaglog.h"
#include "common/timing.h"
#include "lsm6ds3_gyro.hpp"
#include "lsm6ds3_gyro.h"
#define DEG2RAD(x) ((x) * M_PI / 180.0)

View File

@ -1,6 +1,6 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define LSM6DS3_GYRO_I2C_ADDR 0x6A

View File

@ -2,7 +2,7 @@
#include "common/swaglog.h"
#include "common/timing.h"
#include "lsm6ds3_temp.hpp"
#include "lsm6ds3_temp.h"
LSM6DS3_Temp::LSM6DS3_Temp(I2CBus *bus) : I2CSensor(bus) {}

View File

@ -1,6 +1,6 @@
#pragma once
#include "sensors/i2c_sensor.hpp"
#include "sensors/i2c_sensor.h"
// Address of the chip on the bus
#define LSM6DS3_TEMP_I2C_ADDR 0x6A

View File

@ -9,19 +9,19 @@
#include "common/util.h"
#include "common/swaglog.h"
#include "sensors/sensor.hpp"
#include "sensors/constants.hpp"
#include "sensors/sensor.h"
#include "sensors/constants.h"
#include "sensors/bmx055_accel.hpp"
#include "sensors/bmx055_gyro.hpp"
#include "sensors/bmx055_magn.hpp"
#include "sensors/bmx055_temp.hpp"
#include "sensors/bmx055_accel.h"
#include "sensors/bmx055_gyro.h"
#include "sensors/bmx055_magn.h"
#include "sensors/bmx055_temp.h"
#include "sensors/lsm6ds3_accel.hpp"
#include "sensors/lsm6ds3_gyro.hpp"
#include "sensors/lsm6ds3_temp.hpp"
#include "sensors/lsm6ds3_accel.h"
#include "sensors/lsm6ds3_gyro.h"
#include "sensors/lsm6ds3_temp.h"
#include "sensors/light_sensor.hpp"
#include "sensors/light_sensor.h"
#define I2C_BUS_IMU 1

View File

@ -63,8 +63,8 @@ if arch == 'x86_64' and os.path.exists(Dir("#tools/").get_abspath()):
qt_env['CPPPATH'] += ["#tools/clib"]
qt_env['CXXFLAGS'] += ["-Wno-deprecated-declarations"]
replay_lib_src = ["replay/replay.cc", "replay/Unlogger.cpp",
"replay/FileReader.cpp", "#tools/clib/FrameReader.cpp"]
replay_lib_src = ["replay/replay.cc", "replay/Unlogger.cc",
"replay/FileReader.cc", "#tools/clib/FrameReader.cpp"]
replay_lib = qt_env.Library("qt_replay", replay_lib_src, LIBS=base_libs)
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'swscale', 'bz2'] + qt_libs

View File

@ -1,8 +1,8 @@
#include <QApplication>
#include <QSslConfiguration>
#include "qt/window.hpp"
#include "qt/qt_window.hpp"
#include "qt/window.h"
#include "qt/qt_window.h"
int main(int argc, char *argv[]) {
QSurfaceFormat fmt;

View File

@ -1,7 +1,7 @@
#include <assert.h>
#include <algorithm>
#include "ui.hpp"
#include "ui.h"
#ifdef __APPLE__
#include <OpenGL/gl3.h>
#define NANOVG_GL3_IMPLEMENTATION
@ -18,7 +18,7 @@
#define NANOVG_GLES3_IMPLEMENTATION
#include "nanovg_gl.h"
#include "nanovg_gl_utils.h"
#include "paint.hpp"
#include "paint.h"
// TODO: this is also hardcoded in common/transformations/camera.py
// TODO: choose based on frame input size

View File

@ -1,6 +1,6 @@
#pragma once
#include "ui.hpp"
#include "ui.h"
void ui_draw(UIState *s, int w, int h);
void ui_draw_image(const UIState *s, const Rect &r, const char *name, float alpha);

View File

@ -10,7 +10,7 @@
#include <QTimer>
#include <QRandomGenerator>
#include "api.hpp"
#include "api.h"
#include "common/params.h"
#include "common/util.h"

View File

@ -8,9 +8,9 @@
#include "common/timing.h"
#include "common/swaglog.h"
#include "home.hpp"
#include "widgets/drive_stats.hpp"
#include "widgets/setup.hpp"
#include "home.h"
#include "widgets/drive_stats.h"
#include "widgets/setup.h"
// HomeWindow: the container for the offroad and onroad UIs

View File

@ -7,10 +7,10 @@
#include <QTimer>
#include <QWidget>
#include "sidebar.hpp"
#include "onroad.hpp"
#include "ui/ui.hpp"
#include "widgets/offroad_alerts.hpp"
#include "sidebar.h"
#include "onroad.h"
#include "ui/ui.h"
#include "widgets/offroad_alerts.h"
class OffroadHome : public QFrame {
Q_OBJECT

View File

@ -3,8 +3,8 @@
#include <QLabel>
#include <QPixmap>
#include "networking.hpp"
#include "widgets/scrollview.hpp"
#include "networking.h"
#include "widgets/scrollview.h"
void clearLayout(QLayout* layout) {
while (QLayoutItem* item = layout->takeAt(0)) {

View File

@ -6,10 +6,10 @@
#include <QStackedWidget>
#include <QPushButton>
#include "wifiManager.hpp"
#include "widgets/input.hpp"
#include "widgets/ssh_keys.hpp"
#include "widgets/toggle.hpp"
#include "wifiManager.h"
#include "widgets/input.h"
#include "widgets/ssh_keys.h"
#include "widgets/toggle.h"
class WifiUI : public QWidget {
Q_OBJECT

View File

@ -6,8 +6,8 @@
#include <QDesktopWidget>
#include "common/params.h"
#include "onboarding.hpp"
#include "home.hpp"
#include "onboarding.h"
#include "home.h"
#include "util.h"

View File

@ -4,19 +4,19 @@
#include <cassert>
#ifndef QCOM
#include "networking.hpp"
#include "networking.h"
#endif
#include "settings.hpp"
#include "widgets/input.hpp"
#include "widgets/toggle.hpp"
#include "widgets/offroad_alerts.hpp"
#include "widgets/scrollview.hpp"
#include "widgets/controls.hpp"
#include "widgets/ssh_keys.hpp"
#include "settings.h"
#include "widgets/input.h"
#include "widgets/toggle.h"
#include "widgets/offroad_alerts.h"
#include "widgets/scrollview.h"
#include "widgets/controls.h"
#include "widgets/ssh_keys.h"
#include "common/params.h"
#include "common/util.h"
#include "selfdrive/hardware/hw.h"
#include "ui.hpp"
#include "ui.h"
TogglesPanel::TogglesPanel(QWidget *parent) : QWidget(parent) {
QVBoxLayout *toggles_list = new QVBoxLayout();

View File

@ -9,7 +9,7 @@
#include <QScrollArea>
#include <QStackedWidget>
#include "selfdrive/ui/qt/widgets/controls.hpp"
#include "selfdrive/ui/qt/widgets/controls.h"
// ********** settings window + top-level panels **********

View File

@ -5,7 +5,7 @@
#include "common/params.h"
#include "common/swaglog.h"
#include "wifiManager.hpp"
#include "wifiManager.h"
/**
* We are using a NetworkManager DBUS API : https://developer.gnome.org/NetworkManager/1.26/spec.html

View File

@ -3,8 +3,8 @@
#include "common/timing.h"
#include "common/swaglog.h"
#include "onroad.hpp"
#include "paint.hpp"
#include "onroad.h"
#include "paint.h"
OnroadWindow::~OnroadWindow() {
makeCurrent();

View File

@ -4,7 +4,7 @@
#include <QOpenGLWidget>
#include <QTimer>
#include "ui/ui.hpp"
#include "ui/ui.h"
// container window for the NVG UI
class OnroadWindow : public QOpenGLWidget, protected QOpenGLFunctions {

View File

@ -1,4 +1,4 @@
#include "request_repeater.hpp"
#include "request_repeater.h"
RequestRepeater::RequestRepeater(QObject *parent, const QString &requestURL, const QString &cacheKey,
int period) : HttpRequest(parent, requestURL, cacheKey) {

View File

@ -1,5 +1,5 @@
#include "api.hpp"
#include "ui.hpp"
#include "api.h"
#include "ui.h"
class RequestRepeater : public HttpRequest {
public:

View File

@ -5,7 +5,7 @@
#include <QVBoxLayout>
#include <QApplication>
#include "qt_window.hpp"
#include "qt_window.h"
#define USERDATA "/dev/disk/by-partlabel/userdata"
#define NVME "/dev/nvme0n1"

View File

@ -6,10 +6,10 @@
#include <QVBoxLayout>
#include <QApplication>
#include "setup.hpp"
#include "offroad/networking.hpp"
#include "widgets/input.hpp"
#include "qt_window.hpp"
#include "setup.h"
#include "offroad/networking.h"
#include "widgets/input.h"
#include "qt_window.h"
#define USER_AGENT "AGNOSSetup-0.1"

View File

@ -6,10 +6,10 @@
#include <QVBoxLayout>
#include <QApplication>
#include "wifi.hpp"
#include "offroad/networking.hpp"
#include "widgets/input.hpp"
#include "qt_window.hpp"
#include "wifi.h"
#include "offroad/networking.h"
#include "widgets/input.h"
#include "qt_window.h"
void WifiSetup::finish() {
qApp->exit();

View File

@ -1,6 +1,6 @@
#include "common/util.h"
#include "sidebar.hpp"
#include "qt_window.hpp"
#include "sidebar.h"
#include "qt_window.h"
StatusWidget::StatusWidget(QString label, QString msg, QColor c, QWidget* parent) : QFrame(parent) {
layout.setSpacing(0);

View File

@ -2,7 +2,7 @@
#include <QtWidgets>
#include <ui.hpp>
#include <ui.h>
#define COLOR_GOOD QColor(255, 255, 255)
#define COLOR_WARNING QColor(218, 202, 37)

View File

@ -1,5 +1,5 @@
#include <QUrl>
#include "sound.hpp"
#include "sound.h"
Sound::Sound() {
for (auto &kv : sound_map) {

View File

@ -8,8 +8,8 @@
#include <QApplication>
#include <QPainter>
#include "spinner.hpp"
#include "qt_window.hpp"
#include "spinner.h"
#include "qt_window.h"
#include "selfdrive/hardware/hw.h"
TrackWidget::TrackWidget(QWidget *parent) : QWidget(parent) {

View File

@ -5,9 +5,9 @@
#include <QVBoxLayout>
#include <QApplication>
#include "qt_window.hpp"
#include "qt_window.h"
#include "selfdrive/hardware/hw.h"
#include "widgets/scrollview.hpp"
#include "widgets/scrollview.h"
int main(int argc, char *argv[]) {
QApplication a(argc, argv);

View File

@ -1,4 +1,4 @@
#include "controls.hpp"
#include "controls.h"
QFrame *horizontal_line(QWidget *parent) {
QFrame *line = new QFrame(parent);

View File

@ -7,7 +7,7 @@
#include <QVBoxLayout>
#include "common/params.h"
#include "toggle.hpp"
#include "toggle.h"
QFrame *horizontal_line(QWidget *parent = nullptr);

View File

@ -4,8 +4,8 @@
#include <QVBoxLayout>
#include "common/params.h"
#include "drive_stats.hpp"
#include "request_repeater.hpp"
#include "drive_stats.h"
#include "request_repeater.h"
const double MILE_TO_KM = 1.60934;

View File

@ -1,7 +1,7 @@
#include <QPushButton>
#include "input.hpp"
#include "qt_window.hpp"
#include "input.h"
#include "qt_window.h"
InputDialog::InputDialog(const QString &prompt_text, QWidget *parent) : QDialog(parent) {
layout = new QVBoxLayout();

View File

@ -7,7 +7,7 @@
#include <QLineEdit>
#include <QVBoxLayout>
#include "keyboard.hpp"
#include "keyboard.h"
class InputDialog : public QDialog {
Q_OBJECT

View File

@ -5,7 +5,7 @@
#include <QButtonGroup>
#include <QStackedLayout>
#include "keyboard.hpp"
#include "keyboard.h"
const int DEFAULT_STRETCH = 1;
const int SPACEBAR_STRETCH = 3;

View File

@ -3,7 +3,7 @@
#include <QJsonObject>
#include <QJsonDocument>
#include "offroad_alerts.hpp"
#include "offroad_alerts.h"
#include "selfdrive/hardware/hw.h"
#include "selfdrive/common/util.h"

View File

@ -6,7 +6,7 @@
#include <QLabel>
#include "common/params.h"
#include "widgets/scrollview.hpp"
#include "widgets/scrollview.h"
class OffroadAlert : public QFrame {
Q_OBJECT

View File

@ -1,5 +1,5 @@
#include <QScrollBar>
#include "scrollview.hpp"
#include "scrollview.h"
ScrollView::ScrollView(QWidget *w, QWidget *parent) : QScrollArea(parent){
setWidget(w);

View File

@ -8,9 +8,9 @@
#include <QVBoxLayout>
#include "QrCode.hpp"
#include "request_repeater.hpp"
#include "request_repeater.h"
#include "common/params.h"
#include "setup.hpp"
#include "setup.h"
using qrcodegen::QrCode;

View File

@ -5,7 +5,7 @@
#include <QVBoxLayout>
#include <QWidget>
#include "api.hpp"
#include "api.h"
class PairingQRWidget : public QWidget {
Q_OBJECT

View File

@ -1,7 +1,7 @@
#include <QNetworkReply>
#include <QHBoxLayout>
#include "widgets/input.hpp"
#include "widgets/ssh_keys.hpp"
#include "widgets/input.h"
#include "widgets/ssh_keys.h"
#include "common/params.h"

View File

@ -4,7 +4,7 @@
#include <QPushButton>
#include <QNetworkAccessManager>
#include "widgets/controls.hpp"
#include "widgets/controls.h"
#include "selfdrive/hardware/hw.h"
// SSH enable toggle

View File

@ -1,4 +1,4 @@
#include "toggle.hpp"
#include "toggle.h"
Toggle::Toggle(QWidget *parent) : QAbstractButton(parent),
_height(80),

View File

@ -1,4 +1,4 @@
#include "window.hpp"
#include "window.h"
#include "selfdrive/hardware/hw.h"
MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {

View File

@ -3,10 +3,10 @@
#include <QWidget>
#include <QStackedLayout>
#include "offroad/settings.hpp"
#include "offroad/onboarding.hpp"
#include "home.hpp"
#include "../ui.hpp"
#include "offroad/settings.h"
#include "offroad/onboarding.h"
#include "home.h"
#include "../ui.h"
class MainWindow : public QWidget {
Q_OBJECT

View File

@ -1,4 +1,4 @@
#include "FileReader.hpp"
#include "FileReader.h"
#include "FrameReader.hpp"
#include <QtNetwork>

View File

@ -10,7 +10,7 @@
#include "cereal/gen/cpp/legacy.capnp.c++"
#include "cereal/services.h"
#include "Unlogger.hpp"
#include "Unlogger.h"
#include <stdint.h>
#include <time.h>

View File

@ -4,7 +4,7 @@
#include <QReadWriteLock>
#include "clutil.h"
#include "messaging.hpp"
#include "FileReader.hpp"
#include "FileReader.h"
#include "FrameReader.hpp"
#include "visionipc_server.h"

View File

@ -1,6 +1,6 @@
#include <QApplication>
#include "replay.hpp"
#include "replay.h"
int main(int argc, char *argv[]){
QApplication a(argc, argv);

View File

@ -1,4 +1,4 @@
#include "replay.hpp"
#include "replay.h"
Replay::Replay(QString route_, int seek) : route(route_) {
unlogger = new Unlogger(&events, &events_lock, &frs, seek);

View File

@ -8,9 +8,9 @@
#include <capnp/dynamic.h>
#include "qt/api.hpp"
#include "Unlogger.hpp"
#include "FileReader.hpp"
#include "qt/api.h"
#include "Unlogger.h"
#include "FileReader.h"
#include "FrameReader.hpp"
#include "visionipc_server.h"

View File

@ -9,9 +9,9 @@
#include "common/visionimg.h"
#include "common/watchdog.h"
#include "hardware/hw.h"
#include "ui.hpp"
#include "paint.hpp"
#include "qt_window.hpp"
#include "ui.h"
#include "paint.h"
#include "qt_window.h"
#define BACKLIGHT_DT 0.25
#define BACKLIGHT_TS 2.00

View File

@ -20,7 +20,7 @@
#include "visionipc.h"
#include "visionipc_client.h"
#include "qt/sound.hpp"
#include "qt/sound.h"
#include <QObject>
#include <QTimer>