threads / patch / 46896

patchtest-list-objects: mark file-local symbols as static

Subject: [PATCH] test-list-objects: mark file-local symbols as static

## tl;dr

2 messages between Oct 3, 2017 and Oct 4, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ramsay Jones· Oct 3, 2017, 21:51 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Derrick,

If you need to re-roll your 'ds/find-unique-abbrev-optim' branch, could you please squash this into the relevant patch (commit 3792c78ba0, "test-list-objects: list a subset of object ids", 01-10-2017).

Thanks!

ATB, Ramsay Jones

 t/helper/test-list-objects.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
Show changes to t/helper/test-list-objects.c +16 −16
diff --git a/t/helper/test-list-objects.c b/t/helper/test-list-objects.c
index 22bc9b4e6..5c5d3c03f 100644
--- a/t/helper/test-list-objects.c
+++ b/t/helper/test-list-objects.c
@@ -6,43 +6,43 @@ struct count {
 	int select_mod;
 };
 
-int count_loose(const struct object_id *oid,
-		const char *path,
-		void *data)
+static int count_loose(const struct object_id *oid,
+		       const char *path,
+		       void *data)
 {
 	((struct count*)data)->total++;
 	return 0;
 }
 
-int count_packed(const struct object_id *oid,
-		 struct packed_git *pack,
-		 uint32_t pos,
-		 void* data)
+static int count_packed(const struct object_id *oid,
+			struct packed_git *pack,
+			uint32_t pos,
+			void* data)
 {
 	((struct count*)data)->total++;
 	return 0;
 }
 
-void output(const struct object_id *oid,
-	    struct count *c)
+static void output(const struct object_id *oid,
+		   struct count *c)
 {
 	if (!(c->total % c->select_mod))
 		printf("%s\n", oid_to_hex(oid));
 	c->total--;
 }
 
-int output_loose(const struct object_id *oid,
-		 const char *path,
-		 void *data)
+static int output_loose(const struct object_id *oid,
+			const char *path,
+			void *data)
 {
 	output(oid, (struct count*)data);
 	return 0;
 }
 
-int output_packed(const struct object_id *oid,
-		  struct packed_git *pack,
-		  uint32_t pos,
-		  void* data)
+static int output_packed(const struct object_id *oid,
+			 struct packed_git *pack,
+			 uint32_t pos,
+			 void* data)
 {
 	output(oid, (struct count*)data);
 	return 0;
-- 
2.14.0
Derrick Stolee· Oct 4, 2017, 13:40 UTC · re: Ramsay Jones · lore

Re: [PATCH] test-list-objects: mark file-local symbols as static

On 10/3/2017 5:51 PM, Ramsay Jones wrote:
Show 81 quoted lines
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Derrick,
>
> If you need to re-roll your 'ds/find-unique-abbrev-optim' branch,
> could you please squash this into the relevant patch (commit 3792c78ba0,
> "test-list-objects: list a subset of object ids", 01-10-2017).
>
> Thanks!
>
> ATB,
> Ramsay Jones
>
>   t/helper/test-list-objects.c | 32 ++++++++++++++++----------------
>   1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/t/helper/test-list-objects.c b/t/helper/test-list-objects.c
> index 22bc9b4e6..5c5d3c03f 100644
> --- a/t/helper/test-list-objects.c
> +++ b/t/helper/test-list-objects.c
> @@ -6,43 +6,43 @@ struct count {
>   	int select_mod;
>   };
>   
> -int count_loose(const struct object_id *oid,
> -		const char *path,
> -		void *data)
> +static int count_loose(const struct object_id *oid,
> +		       const char *path,
> +		       void *data)
>   {
>   	((struct count*)data)->total++;
>   	return 0;
>   }
>   
> -int count_packed(const struct object_id *oid,
> -		 struct packed_git *pack,
> -		 uint32_t pos,
> -		 void* data)
> +static int count_packed(const struct object_id *oid,
> +			struct packed_git *pack,
> +			uint32_t pos,
> +			void* data)
>   {
>   	((struct count*)data)->total++;
>   	return 0;
>   }
>   
> -void output(const struct object_id *oid,
> -	    struct count *c)
> +static void output(const struct object_id *oid,
> +		   struct count *c)
>   {
>   	if (!(c->total % c->select_mod))
>   		printf("%s\n", oid_to_hex(oid));
>   	c->total--;
>   }
>   
> -int output_loose(const struct object_id *oid,
> -		 const char *path,
> -		 void *data)
> +static int output_loose(const struct object_id *oid,
> +			const char *path,
> +			void *data)
>   {
>   	output(oid, (struct count*)data);
>   	return 0;
>   }
>   
> -int output_packed(const struct object_id *oid,
> -		  struct packed_git *pack,
> -		  uint32_t pos,
> -		  void* data)
> +static int output_packed(const struct object_id *oid,
> +			 struct packed_git *pack,
> +			 uint32_t pos,
> +			 void* data)
>   {
>   	output(oid, (struct count*)data);
>   	return 0;

Thanks, Ramsay. I applied these changes locally. I'll remember "static" in the future.

Thanks, -Stolee

← back to recent threads