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
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 'T': case 'T':
case 'q': case 'q':
iid = g->id; iid = g->id; q_iid = iid;
if (g->action == 'q') { q_iid = iid; iid = 0; if (!q_iid) { REPORT_ERROR("Query graphics command without image id"); break; } } 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); 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); 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); 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) { HANDLER(handle_move_event) {
unsigned int x, y; unsigned int x = 0, y = 0;
if (OPT(focus_follows_mouse)) { if (OPT(focus_follows_mouse)) {
Tab *t = global_state.tabs + global_state.active_tab; Tab *t = global_state.tabs + global_state.active_tab;
if (window_idx != t->active_window) { if (window_idx != t->active_window) {
@@ -327,7 +327,7 @@ void
mouse_event(int button, int modifiers) { mouse_event(int button, int modifiers) {
MouseShape old_cursor = mouse_cursor_shape; MouseShape old_cursor = mouse_cursor_shape;
bool in_tab_bar; bool in_tab_bar;
unsigned int window_idx; unsigned int window_idx = 0;
Window *w = window_for_event(&window_idx, &in_tab_bar); Window *w = window_for_event(&window_idx, &in_tab_bar);
if (in_tab_bar) { if (in_tab_bar) {
mouse_cursor_shape = HAND; mouse_cursor_shape = HAND;
@@ -346,7 +346,7 @@ scroll_event(double UNUSED xoffset, double yoffset) {
if (s == 0) return; if (s == 0) return;
bool upwards = s > 0; bool upwards = s > 0;
bool in_tab_bar; bool in_tab_bar;
unsigned int window_idx; unsigned int window_idx = 0;
Window *w = window_for_event(&window_idx, &in_tab_bar); Window *w = window_for_event(&window_idx, &in_tab_bar);
if (w) { if (w) {
Screen *screen = w->render_data.screen; 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; bool is_main = self->linebuf == self->main_linebuf;
index_type num_content_lines_before, num_content_lines_after; index_type num_content_lines_before, num_content_lines_after;
index_type num_content_lines; index_type num_content_lines = 0;
// Resize main linebuf // Resize main linebuf
HistoryBuf *nh = realloc_hb(self->historybuf, self->historybuf->ynum, columns); HistoryBuf *nh = realloc_hb(self->historybuf, self->historybuf->ynum, columns);

View File

@@ -130,7 +130,10 @@ def init_env(
missing_braces = '' missing_braces = ''
if ccver < (5, 2) and cc == 'gcc': if ccver < (5, 2) and cc == 'gcc':
missing_braces = '-Wno-missing-braces' 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() sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
cflags = os.environ.get( cflags = os.environ.get(
'OVERRIDE_CFLAGS', ( 'OVERRIDE_CFLAGS', (