Use -Og when building in debug mode

This commit is contained in:
Kovid Goyal 2017-11-08 16:13:21 +05:30
parent 802524a17a
commit c1a1b06fe7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 10 additions and 7 deletions

View File

@ -842,8 +842,8 @@ grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint
case 't':
case 'T':
case 'q':
iid = g->id;
if (g->action == 'q') { q_iid = iid; iid = 0; if (!q_iid) { REPORT_ERROR("Query graphics command without image id"); break; } }
iid = g->id; q_iid = iid;
if (g->action == 'q') { iid = 0; if (!q_iid) { REPORT_ERROR("Query graphics command without image id"); break; } }
image = handle_add_command(self, g, payload, is_dirty, iid);
ret = create_add_response(self, image != NULL, g->action == 'q' ? q_iid: self->last_init_graphics_command.id);
if (self->last_init_graphics_command.action == 'T' && image && image->data_loaded) handle_put_command(self, &self->last_init_graphics_command, c, is_dirty, image);

View File

@ -163,7 +163,7 @@ detect_url(Window *w, Screen *screen, unsigned int x, unsigned int y) {
HANDLER(handle_move_event) {
unsigned int x, y;
unsigned int x = 0, y = 0;
if (OPT(focus_follows_mouse)) {
Tab *t = global_state.tabs + global_state.active_tab;
if (window_idx != t->active_window) {
@ -327,7 +327,7 @@ void
mouse_event(int button, int modifiers) {
MouseShape old_cursor = mouse_cursor_shape;
bool in_tab_bar;
unsigned int window_idx;
unsigned int window_idx = 0;
Window *w = window_for_event(&window_idx, &in_tab_bar);
if (in_tab_bar) {
mouse_cursor_shape = HAND;
@ -346,7 +346,7 @@ scroll_event(double UNUSED xoffset, double yoffset) {
if (s == 0) return;
bool upwards = s > 0;
bool in_tab_bar;
unsigned int window_idx;
unsigned int window_idx = 0;
Window *w = window_for_event(&window_idx, &in_tab_bar);
if (w) {
Screen *screen = w->render_data.screen;

View File

@ -140,7 +140,7 @@ screen_resize(Screen *self, unsigned int lines, unsigned int columns) {
bool is_main = self->linebuf == self->main_linebuf;
index_type num_content_lines_before, num_content_lines_after;
index_type num_content_lines;
index_type num_content_lines = 0;
// Resize main linebuf
HistoryBuf *nh = realloc_hb(self->historybuf, self->historybuf->ynum, columns);

View File

@ -130,7 +130,10 @@ def init_env(
missing_braces = ''
if ccver < (5, 2) and cc == 'gcc':
missing_braces = '-Wno-missing-braces'
optimize = '-g3' if debug or sanitize else '-O3'
df = '-g3'
if ccver >= (5, 0):
df += ' -Og'
optimize = df if debug or sanitize else '-O3'
sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
cflags = os.environ.get(
'OVERRIDE_CFLAGS', (