[gnome-builder] vim: silence uninitialized variable warning in gb_editor_vim_move_page



commit 4c721143321ff5fc6f373aebd58a60b50495adbc
Author: Hashem Nasarat <hashem riseup net>
Date:   Sun Oct 12 15:39:05 2014 -0400

    vim: silence uninitialized variable warning in gb_editor_vim_move_page
    
    src/editor/gb-editor-vim.c: In function 'gb_editor_vim_move_page':
    src/editor/gb-editor-vim.c:2522:3: warning: 'yalign' may be used
    uninitialized in this function [-Wmaybe-uninitialized]
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738413

 src/editor/gb-editor-vim.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 45565e3..088a5f9 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -2458,6 +2458,7 @@ gb_editor_vim_move_page (GbEditorVim                 *vim,
   GtkTextBuffer *buffer;
   gfloat yalign;
 
+  yalign = 0.0;
   g_assert (GB_IS_EDITOR_VIM (vim));
 
   gtk_text_view_get_visible_rect (vim->priv->text_view, &rect);
@@ -2476,16 +2477,10 @@ gb_editor_vim_move_page (GbEditorVim                 *vim,
   if (direction == GB_EDITOR_VIM_HALF_PAGE_UP ||
       direction == GB_EDITOR_VIM_HALF_PAGE_DOWN)
     {
-      if (line_bottom == line_top)
-        {
-        yalign = 0.0;
-        }
-      else
-        {
-        /* keep current yalign */
+      /* keep current yalign */
+      if (line_bottom != line_top)
         yalign = MAX (0.0, (float)(line_current - line_top) /
                            (float)(line_bottom - line_top));
-        }
     }
 
   switch (direction)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]