Changeset 7dfe886 for viewwin.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
  • viewwin.c

    r4fd211f r7dfe886  
    1212 * will be used by the viewwin
    1313 */
    14 owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
     14G_GNUC_WARN_UNUSED_RESULT owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
    1515{
    1616  owl_viewwin *v = g_new0(owl_viewwin, 1);
     
    3434 * will be used by the viewwin
    3535 */
    36 owl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext)
     36G_GNUC_WARN_UNUSED_RESULT owl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext)
    3737{
    3838  char *text;
     
    237237}
    238238
    239 owl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) {
     239G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) {
    240240  int lines, cols;
    241241  owl_editwin *cmdline;
Note: See TracChangeset for help on using the changeset viewer.