Changeset 6829afc for zcrypt.c


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
  • zcrypt.c

    rd427f08 r6829afc  
    2727#include "filterproc.h"
    2828
     29/* Annotate functions in which the caller owns the return value and is
     30 * responsible for ensuring it is freed. */
     31#define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT
     32
    2933#define MAX_KEY      128
    3034#define MAX_LINE     128
     
    5357} ZWRITEOPTIONS;
    5458
    55 G_GNUC_WARN_UNUSED_RESULT char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
     59CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
    5660int ParseCryptSpec(const char *spec, const char **keyfile);
    57 G_GNUC_WARN_UNUSED_RESULT char *BuildArgString(char **argv, int start, int end);
    58 G_GNUC_WARN_UNUSED_RESULT char *read_keystring(const char *keyfile);
     61CALLER_OWN char *BuildArgString(char **argv, int start, int end);
     62CALLER_OWN char *read_keystring(const char *keyfile);
    5963
    6064int do_encrypt(int zephyr, const char *class, const char *instance,
     
    364368/* Build a space-separated string from argv from elements between start  *
    365369 * and end - 1.  malloc()'s the returned string. */
    366 G_GNUC_WARN_UNUSED_RESULT char *BuildArgString(char **argv, int start, int end)
     370CALLER_OWN char *BuildArgString(char **argv, int start, int end)
    367371{
    368372  int len = 1;
     
    401405#define MAX_SEARCH 3
    402406/* Find the class/instance in the .crypt-table */
    403 G_GNUC_WARN_UNUSED_RESULT char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance)
     407CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance)
    404408{
    405409  char *keyfile = NULL;
     
    579583}
    580584
    581 G_GNUC_WARN_UNUSED_RESULT char *slurp_stdin(int ignoredot, int *length) {
     585CALLER_OWN char *slurp_stdin(int ignoredot, int *length) {
    582586  char *buf;
    583587  char *inptr;
     
    611615}
    612616
    613 G_GNUC_WARN_UNUSED_RESULT char *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) {
     617CALLER_OWN char *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) {
    614618  char *buf;
    615619
     
    637641}
    638642
    639 G_GNUC_WARN_UNUSED_RESULT char *read_keystring(const char *keyfile) {
     643CALLER_OWN char *read_keystring(const char *keyfile) {
    640644  char *keystring;
    641645  FILE *fkey = fopen(keyfile, "r");
Note: See TracChangeset for help on using the changeset viewer.