# [PATCH] vcs-svn: Fix 'fa/remote-svn' and 'fa/vcs-svn' in pu

3 messages from 2012-08-23 to 2012-08-30. Participants: Ramsay Jones, Florian Achleitner.
Thread: https://gitlist.dev/t/31335

## Ramsay Jones, 2012-08-23 17:55

Subject: [PATCH] vcs-svn: Fix 'fa/remote-svn' and 'fa/vcs-svn' in pu
Message-ID: <50366E9B.7040803@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/50366E9B.7040803%40ramsay1.demon.co.uk

```


Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Florian,

The build on pu is currently broken:

        CC remote-testsvn.o
        LINK git-remote-testsvn
    cc: vcs-svn/lib.a: No such file or directory
    make: *** [git-remote-testsvn] Error 1

This is caused by a dependency missing from the git-remote-testsvn
link rule. The addition of the $(VCSSVN_LIB) dependency, which should
be squashed into commit ea1f4afb ("Add git-remote-testsvn to Makefile",
20-08-2012), fixes the build.

However, this leads to a failure of test t9020.5 and (not unrelated)
compiler warnings:

        CC vcs-svn/svndump.o
    vcs-svn/svndump.c: In function ‘handle_node’:
    vcs-svn/svndump.c:246: warning: left shift count >= width of type
    vcs-svn/svndump.c:345: warning: format ‘%lu’ expects type ‘long \
        unsigned int’, but argument 3 has type ‘uintmax_t’

The fix for the shift count warning is to cast the lhs of the shift
expression to uintmax_t. The format warning is fixed by using the
PRIuMAX format macro. These fixes should be squashed into commit
78d9d4138 ("vcs-svn/svndump: rewrite handle_node(), begin|end_revision()",
20-08-2012).

HTH

ATB,
Ramsay Jones

 Makefile          | 2 +-
 vcs-svn/svndump.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 9cede84..761ae05 100644
--- a/Makefile
+++ b/Makefile
@@ -2356,7 +2356,7 @@ git-http-push$X: revision.o http.o http-push.o GIT-LDFLAGS $(GITLIBS)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 
-git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS)
+git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
 	$(VCSSVN_LIB)
 
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 28ce2aa..eb97e8e 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -243,7 +243,7 @@ static void handle_node(struct node_ctx_t *node)
 	const char *old_data = NULL;
 	uint32_t old_mode = REPO_MODE_BLB;
 	struct strbuf sb = STRBUF_INIT;
-	static uintmax_t blobmark = 1UL << (bitsizeof(uintmax_t) - 1);
+	static uintmax_t blobmark = (uintmax_t) 1UL << (bitsizeof(uintmax_t) - 1);
 
 
 	if (have_text && type == REPO_MODE_DIR)
@@ -342,7 +342,7 @@ static void handle_node(struct node_ctx_t *node)
 						node->text_length, &input);
 			}
 
-			strbuf_addf(&sb, ":%lu", blobmark);
+			strbuf_addf(&sb, ":%"PRIuMAX, blobmark);
 			node->dataref = sb.buf;
 		}
 	}
-- 
1.7.12

```

## Florian Achleitner, 2012-08-27 07:44

Subject: Re: [PATCH] vcs-svn: Fix 'fa/remote-svn' and 'fa/vcs-svn' in pu
Message-ID: <22437025.vxzLHcuBYA@flomedio>
URL: https://gitlist.dev/e/22437025.vxzLHcuBYA%40flomedio
In-Reply-To: <50366E9B.7040803@ramsay1.demon.co.uk>

```
Hi!

Thanks for your fixups. I'm currently integrating them in a new series.
On what platform did you find that problems? 
Tried to reproduce them on 64bit Linux. Anyways the fixes look very reasonable.

Florian

On Thursday 23 August 2012 18:55:39 Ramsay Jones wrote:
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
> 
> Hi Florian,
> 
> The build on pu is currently broken:
> 
>         CC remote-testsvn.o
>         LINK git-remote-testsvn
>     cc: vcs-svn/lib.a: No such file or directory
>     make: *** [git-remote-testsvn] Error 1
> 
> This is caused by a dependency missing from the git-remote-testsvn
> link rule. The addition of the $(VCSSVN_LIB) dependency, which should
> be squashed into commit ea1f4afb ("Add git-remote-testsvn to Makefile",
> 20-08-2012), fixes the build.
> 
> However, this leads to a failure of test t9020.5 and (not unrelated)
> compiler warnings:
> 
>         CC vcs-svn/svndump.o
>     vcs-svn/svndump.c: In function ‘handle_node’:
>     vcs-svn/svndump.c:246: warning: left shift count >= width of type
>     vcs-svn/svndump.c:345: warning: format ‘%lu’ expects type ‘long \
>         unsigned int’, but argument 3 has type ‘uintmax_t’
> 
> The fix for the shift count warning is to cast the lhs of the shift
> expression to uintmax_t. The format warning is fixed by using the
> PRIuMAX format macro. These fixes should be squashed into commit
> 78d9d4138 ("vcs-svn/svndump: rewrite handle_node(), begin|end_revision()",
> 20-08-2012).
> 
> HTH
> 
> ATB,
> Ramsay Jones
> 
>  Makefile          | 2 +-
>  vcs-svn/svndump.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 9cede84..761ae05 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2356,7 +2356,7 @@ git-http-push$X: revision.o http.o http-push.o
> GIT-LDFLAGS $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@
> $(ALL_LDFLAGS) $(filter %.o,$^) \ $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
> 
> -git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS)
> +git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
> $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^)
> $(LIBS) \ $(VCSSVN_LIB)
> 
> diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
> index 28ce2aa..eb97e8e 100644
> --- a/vcs-svn/svndump.c
> +++ b/vcs-svn/svndump.c
> @@ -243,7 +243,7 @@ static void handle_node(struct node_ctx_t *node)
>  	const char *old_data = NULL;
>  	uint32_t old_mode = REPO_MODE_BLB;
>  	struct strbuf sb = STRBUF_INIT;
> -	static uintmax_t blobmark = 1UL << (bitsizeof(uintmax_t) - 1);
> +	static uintmax_t blobmark = (uintmax_t) 1UL << (bitsizeof(uintmax_t) - 1);
> 
> 
>  	if (have_text && type == REPO_MODE_DIR)
> @@ -342,7 +342,7 @@ static void handle_node(struct node_ctx_t *node)
>  						node->text_length, &input);
>  			}
> 
> -			strbuf_addf(&sb, ":%lu", blobmark);
> +			strbuf_addf(&sb, ":%"PRIuMAX, blobmark);
>  			node->dataref = sb.buf;
>  		}
>  	}

```

## Ramsay Jones, 2012-08-30 17:28

Subject: Re: [PATCH] vcs-svn: Fix 'fa/remote-svn' and 'fa/vcs-svn' in pu
Message-ID: <503FA2C4.5020308@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/503FA2C4.5020308%40ramsay1.demon.co.uk
In-Reply-To: <22437025.vxzLHcuBYA@flomedio>

```
Florian Achleitner wrote:
> Hi!
> 
> Thanks for your fixups. I'm currently integrating them in a new series.
> On what platform did you find that problems? 
> Tried to reproduce them on 64bit Linux. Anyways the fixes look very reasonable.

I found the problem on Linux, cygwin and MinGW. That would be *32-bit* Linux,
cygwin and MinGW, of course. ;-)

ATB,
Ramsay Jones

```
