@@ -21,20 +21,6 @@ struct stream_vtbl {
21
21
read_istream_fn read ;
22
22
};
23
23
24
- #define open_method_decl (name ) \
25
- int open_istream_ ##name \
26
- (struct git_istream *st, struct repository *r, \
27
- struct object_info *oi, const struct object_id *oid, \
28
- enum object_type *type)
29
-
30
- #define close_method_decl (name ) \
31
- int close_istream_ ##name \
32
- (struct git_istream *st)
33
-
34
- #define read_method_decl (name ) \
35
- ssize_t read_istream_ ##name \
36
- (struct git_istream *st, char *buf, size_t sz)
37
-
38
24
#define FILTER_BUFFER (1024*16)
39
25
40
26
struct filtered_istream {
@@ -95,13 +81,14 @@ static void close_deflated_stream(struct git_istream *st)
95
81
*
96
82
*****************************************************************/
97
83
98
- static close_method_decl ( filtered )
84
+ static int close_istream_filtered ( struct git_istream * st )
99
85
{
100
86
free_stream_filter (st -> u .filtered .filter );
101
87
return close_istream (st -> u .filtered .upstream );
102
88
}
103
89
104
- static read_method_decl (filtered )
90
+ static ssize_t read_istream_filtered (struct git_istream * st , char * buf ,
91
+ size_t sz )
105
92
{
106
93
struct filtered_istream * fs = & (st -> u .filtered );
107
94
size_t filled = 0 ;
@@ -187,7 +174,7 @@ static struct git_istream *attach_stream_filter(struct git_istream *st,
187
174
*
188
175
*****************************************************************/
189
176
190
- static read_method_decl ( loose )
177
+ static ssize_t read_istream_loose ( struct git_istream * st , char * buf , size_t sz )
191
178
{
192
179
size_t total_read = 0 ;
193
180
@@ -232,7 +219,7 @@ static read_method_decl(loose)
232
219
return total_read ;
233
220
}
234
221
235
- static close_method_decl ( loose )
222
+ static int close_istream_loose ( struct git_istream * st )
236
223
{
237
224
close_deflated_stream (st );
238
225
munmap (st -> u .loose .mapped , st -> u .loose .mapsize );
@@ -244,7 +231,10 @@ static struct stream_vtbl loose_vtbl = {
244
231
read_istream_loose ,
245
232
};
246
233
247
- static open_method_decl (loose )
234
+ static int open_istream_loose (struct git_istream * st , struct repository * r ,
235
+ struct object_info * oi ,
236
+ const struct object_id * oid ,
237
+ enum object_type * type )
248
238
{
249
239
st -> u .loose .mapped = map_loose_object (r , oid , & st -> u .loose .mapsize );
250
240
if (!st -> u .loose .mapped )
@@ -275,7 +265,8 @@ static open_method_decl(loose)
275
265
*
276
266
*****************************************************************/
277
267
278
- static read_method_decl (pack_non_delta )
268
+ static ssize_t read_istream_pack_non_delta (struct git_istream * st , char * buf ,
269
+ size_t sz )
279
270
{
280
271
size_t total_read = 0 ;
281
272
@@ -333,7 +324,7 @@ static read_method_decl(pack_non_delta)
333
324
return total_read ;
334
325
}
335
326
336
- static close_method_decl ( pack_non_delta )
327
+ static int close_istream_pack_non_delta ( struct git_istream * st )
337
328
{
338
329
close_deflated_stream (st );
339
330
return 0 ;
@@ -344,7 +335,11 @@ static struct stream_vtbl pack_non_delta_vtbl = {
344
335
read_istream_pack_non_delta ,
345
336
};
346
337
347
- static open_method_decl (pack_non_delta )
338
+ static int open_istream_pack_non_delta (struct git_istream * st ,
339
+ struct repository * r ,
340
+ struct object_info * oi ,
341
+ const struct object_id * oid ,
342
+ enum object_type * type )
348
343
{
349
344
struct pack_window * window ;
350
345
enum object_type in_pack_type ;
@@ -379,13 +374,13 @@ static open_method_decl(pack_non_delta)
379
374
*
380
375
*****************************************************************/
381
376
382
- static close_method_decl ( incore )
377
+ static int close_istream_incore ( struct git_istream * st )
383
378
{
384
379
free (st -> u .incore .buf );
385
380
return 0 ;
386
381
}
387
382
388
- static read_method_decl ( incore )
383
+ static ssize_t read_istream_incore ( struct git_istream * st , char * buf , size_t sz )
389
384
{
390
385
size_t read_size = sz ;
391
386
size_t remainder = st -> size - st -> u .incore .read_ptr ;
@@ -404,7 +399,9 @@ static struct stream_vtbl incore_vtbl = {
404
399
read_istream_incore ,
405
400
};
406
401
407
- static open_method_decl (incore )
402
+ static int open_istream_incore (struct git_istream * st , struct repository * r ,
403
+ struct object_info * oi , const struct object_id * oid ,
404
+ enum object_type * type )
408
405
{
409
406
st -> u .incore .buf = read_object_file_extended (r , oid , type , & st -> size , 0 );
410
407
st -> u .incore .read_ptr = 0 ;
0 commit comments