]> andersk Git - splint.git/blame - test/manual/clauses.c
Fixes for win32
[splint.git] / test / manual / clauses.c
CommitLineData
77970e15 1typedef struct {
2 int id;
3 /*@only@*/ char *name;
4} *record;
5
6static /*@special@*/ record record_new (void)
7 /*@defines result->id@*/
8{
9 record r = (record) malloc (sizeof (*r));
10 assert (r != NULL);
11 r->id = 3;
12 return r;
13}
14
15static void record_setName (/*@special@*/ record r, /*@only@*/ char *name)
16 /*@defines r->name@*/
17{
18 r->name = name;
19}
20
21record record_create (/*@only@*/ char *name)
22{
23 record r = record_new ();
24 record_setName (r, name);
25 return r;
26}
27
28void record_clearName (/*@special@*/ record r)
29 /*@releases r->name@*/
30 /*@ensures isnull r->name@*/
31{
32 free (r->name);
33 r->name = NULL;
34}
35
36void record_free (/*@only@*/ record r)
37{
38 record_clearName (r);
39 free (r);
40}
This page took 0.062914 seconds and 5 git commands to generate.