mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
-Werror (#1567)
* werror
* -Wno-inconsistent-missing-override
* Silence ffmpeg deprecation warnings
* add some more pragmas to ignore warnings
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 50f3f1d335
This commit is contained in:
@@ -106,11 +106,9 @@ env = Environment(
|
||||
"-g",
|
||||
"-fPIC",
|
||||
"-O2",
|
||||
"-Werror=implicit-function-declaration",
|
||||
"-Werror=incompatible-pointer-types",
|
||||
"-Werror=int-conversion",
|
||||
"-Werror=return-type",
|
||||
"-Werror=format-extra-args",
|
||||
"-Werror",
|
||||
"-Wno-deprecated-register",
|
||||
"-Wno-inconsistent-missing-override",
|
||||
] + cflags + ccflags_asan,
|
||||
|
||||
CPPPATH=cpppath + [
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
#ifdef NO_INCLUDE_FENV
|
||||
#pragma message("Do not use fenv header.")
|
||||
#else
|
||||
#pragma message("Use fenv header. If there is a warning about unknown #pragma STDC FENV_ACCESS, this can be ignored.")
|
||||
#pragma STDC FENV_ACCESS on
|
||||
//#pragma message("Use fenv header. If there is a warning about unknown #pragma STDC FENV_ACCESS, this can be ignored.")
|
||||
//#pragma STDC FENV_ACCESS on
|
||||
#include <fenv.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
@@ -24,6 +26,7 @@
|
||||
|
||||
#include "encoder.h"
|
||||
|
||||
|
||||
//#define ALOG(...) __android_log_print(ANDROID_LOG_VERBOSE, "omxapp", ##__VA_ARGS__)
|
||||
|
||||
// encoder: lossey codec using hardware hevc
|
||||
@@ -226,7 +229,7 @@ void encoder_init(EncoderState *s, const char* filename, int width, int height,
|
||||
in_port.format.video.xFramerate = (s->fps * 65536);
|
||||
in_port.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
|
||||
// in_port.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
|
||||
in_port.format.video.eColorFormat = QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
|
||||
in_port.format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
|
||||
|
||||
err = OMX_SetParameter(s->handle, OMX_IndexParamPortDefinition,
|
||||
(OMX_PTR) &in_port);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma clang diagnostic ignored "-Wexceptions"
|
||||
|
||||
#include <cassert>
|
||||
#include <stdlib.h>
|
||||
#include "common/util.h"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "ui.hpp"
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
#include <cmath>
|
||||
#include "common/util.h"
|
||||
|
||||
#define NANOVG_GLES3_IMPLEMENTATION
|
||||
@@ -396,7 +397,7 @@ static void ui_draw_world(UIState *s) {
|
||||
if (scene->lead_status) {
|
||||
draw_lead(s, scene->lead_d_rel, scene->lead_v_rel, scene->lead_y_rel);
|
||||
}
|
||||
if ((scene->lead_status2) && (fabs(scene->lead_d_rel - scene->lead_d_rel2) > 3.0)) {
|
||||
if ((scene->lead_status2) && (std::abs(scene->lead_d_rel - scene->lead_d_rel2) > 3.0)) {
|
||||
draw_lead(s, scene->lead_d_rel2, scene->lead_v_rel2, scene->lead_y_rel2);
|
||||
}
|
||||
nvgRestore(s->vg);
|
||||
@@ -617,9 +618,9 @@ static void ui_draw_driver_view(UIState *s) {
|
||||
} else {
|
||||
fbox_x = valid_frame_x + valid_frame_w - box_h / 2 + (scene->face_x + 0.5) * (box_h / 2) - 0.5 * 0.6 * box_h / 2;
|
||||
}
|
||||
if (abs(scene->face_x) <= 0.35 && abs(scene->face_y) <= 0.4) {
|
||||
if (std::abs(scene->face_x) <= 0.35 && std::abs(scene->face_y) <= 0.4) {
|
||||
ui_draw_rect(s->vg, fbox_x, fbox_y, 0.6 * box_h / 2, 0.6 * box_h / 2,
|
||||
nvgRGBAf(1.0, 1.0, 1.0, 0.8 - ((abs(scene->face_x) > abs(scene->face_y) ? abs(scene->face_x) : abs(scene->face_y))) * 0.6 / 0.375),
|
||||
nvgRGBAf(1.0, 1.0, 1.0, 0.8 - ((std::abs(scene->face_x) > std::abs(scene->face_y) ? std::abs(scene->face_x) : std::abs(scene->face_y))) * 0.6 / 0.375),
|
||||
35, 10);
|
||||
} else {
|
||||
ui_draw_rect(s->vg, fbox_x, fbox_y, 0.6 * box_h / 2, 0.6 * box_h / 2, nvgRGBAf(1.0, 1.0, 1.0, 0.2), 35, 10);
|
||||
@@ -959,9 +960,9 @@ void ui_nvg_init(UIState *s) {
|
||||
s->rear_frame_mat = matmul(device_transform, frame_transform);
|
||||
|
||||
for(int i = 0;i < UI_BUF_COUNT; i++) {
|
||||
s->khr[i] = NULL;
|
||||
s->khr[i] = 0;
|
||||
s->priv_hnds[i] = NULL;
|
||||
s->khr_front[i] = NULL;
|
||||
s->khr_front[i] = 0;
|
||||
s->priv_hnds_front[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ static void update_offroad_layout_timeout(UIState *s, int* timeout) {
|
||||
}
|
||||
|
||||
static void ui_init(UIState *s) {
|
||||
|
||||
|
||||
pthread_mutex_init(&s->lock, NULL);
|
||||
s->sm = new SubMaster({"model", "controlsState", "uiLayoutState", "liveCalibration", "radarState", "thermal",
|
||||
"health", "ubloxGnss", "driverState", "dMonitoringState", "offroadLayout"
|
||||
@@ -426,7 +426,7 @@ void handle_message(UIState *s, SubMaster &sm) {
|
||||
// scene.mpc_y[i] = y_list[i];
|
||||
// }
|
||||
// s->livempc_or_radarstate_changed = true;
|
||||
// }
|
||||
// }
|
||||
if (sm.updated("uiLayoutState")) {
|
||||
auto data = sm["uiLayoutState"].getUiLayoutState();
|
||||
s->active_app = data.getActiveApp();
|
||||
@@ -511,7 +511,7 @@ static void ui_update(UIState *s) {
|
||||
// do this here for now in lieu of a run_on_main_thread event
|
||||
|
||||
for (int i=0; i<UI_BUF_COUNT; i++) {
|
||||
if(s->khr[i] != NULL) {
|
||||
if(s->khr[i] != 0) {
|
||||
visionimg_destroy_gl(s->khr[i], s->priv_hnds[i]);
|
||||
glDeleteTextures(1, &s->frame_texs[i]);
|
||||
}
|
||||
@@ -541,7 +541,7 @@ static void ui_update(UIState *s) {
|
||||
}
|
||||
|
||||
for (int i=0; i<UI_BUF_COUNT; i++) {
|
||||
if(s->khr_front[i] != NULL) {
|
||||
if(s->khr_front[i] != 0) {
|
||||
visionimg_destroy_gl(s->khr_front[i], s->priv_hnds_front[i]);
|
||||
glDeleteTextures(1, &s->frame_front_texs[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user