Changeset 7dfe886 for editwin.c


Ignore:
Timestamp:
Jun 19, 2011, 2:44:13 AM (13 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
b0e6560
Parents:
9d43dcc
git-author:
Jason Gross <jgross@mit.edu> (06/06/11 05:24:30)
git-committer:
Jason Gross <jgross@mit.edu> (06/19/11 02:44:13)
Message:
Use G_GNUC_WARN_UNUSED_RESULT

Have gcc warn us when we ignore the result of a function that requires
the caller to free the result, or an initilization function that can
fail.  This might help (slightly) with preventing leaks and segfaults.

Additionally changed some functions that should never fail to not
return values.  (The owl_list_* functions changed only fail if
list->size < 0, which we assume is not the case elsewhere.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r3b8a563 r7dfe886  
    6161static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
    6262static int oe_copy_region(owl_editwin *e);
    63 static char *oe_chunk(owl_editwin *e, int start, int end);
     63static G_GNUC_WARN_UNUSED_RESULT char *oe_chunk(owl_editwin *e, int start, int end);
    6464static void oe_destroy_cbdata(owl_editwin *e);
    6565static void oe_dirty(owl_editwin *e);
     
    7070#define WHITESPACE " \n\t"
    7171
    72 static owl_editwin *owl_editwin_allocate(void)
     72static G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_editwin_allocate(void)
    7373{
    7474  owl_editwin *e = g_new0(owl_editwin, 1);
     
    142142}
    143143
    144 owl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist)
     144G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist)
    145145{
    146146  owl_editwin *e = owl_editwin_allocate();
     
    13691369}
    13701370
    1371 char *owl_editwin_get_region(owl_editwin *e)
     1371G_GNUC_WARN_UNUSED_RESULT char *owl_editwin_get_region(owl_editwin *e)
    13721372{
    13731373  int start, end;
     
    13881388}
    13891389
    1390 static char *oe_chunk(owl_editwin *e, int start, int end)
     1390static G_GNUC_WARN_UNUSED_RESULT char *oe_chunk(owl_editwin *e, int start, int end)
    13911391{
    13921392  char *p;
Note: See TracChangeset for help on using the changeset viewer.