Changeset 6829afc for owl.h


Ignore:
Timestamp:
Jun 25, 2011, 3:26:15 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
12294d2
Parents:
95b52d1
git-author:
David Benjamin <davidben@mit.edu> (06/24/11 22:56:15)
git-committer:
David Benjamin <davidben@mit.edu> (06/25/11 03:26:15)
Message:
Define CALLER_OWN macro

Replace our exising uses of G_GNUC_WARN_UNUSED_RESULT with it. The
old macro is just way too long. This also more clearly specifies the
intent.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    r95b52d1 r6829afc  
    199199#define OWL_ENABLE_ZCRYPT 1
    200200#endif
     201
     202/* Annotate functions in which the caller owns the return value and is
     203 * responsible for ensuring it is freed. */
     204#define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT
    201205
    202206#define OWL_META(key) ((key)|010000)
     
    251255                                 * WARNING:  this approach is hard to make
    252256                                 * thread-safe... */
    253   char G_GNUC_WARN_UNUSED_RESULT *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
     257  char CALLER_OWN *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
    254258                                /* converts val to a string;
    255259                                 * caller must free the result */
     
    313317 
    314318  /* These don't take any context */
    315   char G_GNUC_WARN_UNUSED_RESULT *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);
     319  char CALLER_OWN *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);
    316320                                /* takes argv and the full command as buff.
    317321                                 * caller must free return value if !NULL */
     
    320324
    321325  /* The following also take the active context if it's valid */
    322   char G_GNUC_WARN_UNUSED_RESULT *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);
     326  char CALLER_OWN *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);
    323327                                /* takes argv and the full command as buff.
    324328                                 * caller must free return value if !NULL */
Note: See TracChangeset for help on using the changeset viewer.