Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/gzio-3a.c

raw
1 typedef __SIZE_TYPE__ size_t;
2 typedef struct _IO_FILE FILE;
3 extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n,
4 FILE *__restrict __stream);
5 typedef unsigned char Byte;
6 typedef unsigned int uInt;
7 typedef unsigned long uLong;
8
9 typedef struct gz_stream {
10 FILE *file;
11 uInt avail_in;
12 uInt avail_out;
13 } gz_stream;
14
15 void test_1_callee(gz_stream *s, Byte *buf) {
16 Byte *next_out = buf;
17 uInt n = s->avail_in;
18 if (n > 0) {
19 next_out += n;
20 }
21 s->avail_out -= fread(next_out, 1, s->avail_out, s->file);
22 }
23
24 void test_1_caller(gz_stream *s) {
25 unsigned char c;
26 test_1_callee(s, &c);
27 }