@@ -864,9 +864,9 @@ void free_grep_patterns(struct grep_opt *opt)
864864 free_pattern_expr (opt -> pattern_expression );
865865}
866866
867- static const char * end_of_line (const char * cp , unsigned long * left )
867+ static const char * end_of_line (const char * cp , size_t * left )
868868{
869- unsigned long l = * left ;
869+ size_t l = * left ;
870870 while (l && * cp != '\n' ) {
871871 l -- ;
872872 cp ++ ;
@@ -1454,7 +1454,7 @@ static int should_lookahead(struct grep_opt *opt)
14541454}
14551455
14561456static int look_ahead (struct grep_opt * opt ,
1457- unsigned long * left_p ,
1457+ size_t * left_p ,
14581458 unsigned * lno_p ,
14591459 const char * * bol_p )
14601460{
@@ -1567,7 +1567,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
15671567{
15681568 const char * bol ;
15691569 const char * peek_bol = NULL ;
1570- unsigned long left ;
1570+ size_t left ;
15711571 unsigned lno = 1 ;
15721572 unsigned last_hit = 0 ;
15731573 int binary_match_only = 0 ;
@@ -1737,7 +1737,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
17371737 goto next_line ;
17381738 }
17391739 if (show_function && (!peek_bol || peek_bol < bol )) {
1740- unsigned long peek_left = left ;
1740+ size_t peek_left = left ;
17411741 const char * peek_eol = eol ;
17421742
17431743 /*
@@ -1856,7 +1856,7 @@ int grep_source(struct grep_opt *opt, struct grep_source *gs)
18561856
18571857static void grep_source_init_buf (struct grep_source * gs ,
18581858 const char * buf ,
1859- unsigned long size )
1859+ size_t size )
18601860{
18611861 gs -> type = GREP_SOURCE_BUF ;
18621862 gs -> name = NULL ;
@@ -1867,7 +1867,7 @@ static void grep_source_init_buf(struct grep_source *gs,
18671867 gs -> identifier = NULL ;
18681868}
18691869
1870- int grep_buffer (struct grep_opt * opt , const char * buf , unsigned long size )
1870+ int grep_buffer (struct grep_opt * opt , const char * buf , size_t size )
18711871{
18721872 struct grep_source gs ;
18731873 int r ;
@@ -1933,11 +1933,9 @@ void grep_source_clear_data(struct grep_source *gs)
19331933static int grep_source_load_oid (struct grep_source * gs )
19341934{
19351935 enum object_type type ;
1936- size_t size_st = 0 ;
19371936
19381937 gs -> buf = odb_read_object (gs -> repo -> objects , gs -> identifier ,
1939- & type , & size_st );
1940- gs -> size = cast_size_t_to_ulong (size_st );
1938+ & type , & gs -> size );
19411939 if (!gs -> buf )
19421940 return error (_ ("'%s': unable to read %s" ),
19431941 gs -> name ,
0 commit comments