threads / patch / 4737

patchGit.xs: older perl do not know const char *

Subject: [PATCH] Git.xs: older perl do not know const char *

## tl;dr

3 messages between Jul 2, 2006 and Jul 2, 2006. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Johannes Schindelin· Jul 2, 2006, 09:53 UTC · lore

Both of these casts _should_ be safe, since you do not want to muck around with the version or the path anyway.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 perl/Git.xs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to perl/Git.xs +3 −3
diff --git a/perl/Git.xs b/perl/Git.xs
index 51bfac3..c824210 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -59,7 +59,7 @@ BOOT:
 # /* TODO: xs_call_gate(). See Git.pm. */
 
 
-const char *
+char *
 xs_version()
 CODE:
 {
@@ -69,11 +69,11 @@ OUTPUT:
 	RETVAL
 
 
-const char *
+char *
 xs_exec_path()
 CODE:
 {
-	RETVAL = git_exec_path();
+	RETVAL = (char *)git_exec_path();
 }
 OUTPUT:
 	RETVAL
Petr Baudis· Jul 2, 2006, 21:52 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Git.xs: older perl do not know const char *

Dear diary, on Sun, Jul 02, 2006 at 11:53:03AM CEST, I got a letter where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...

> Both of these casts _should_ be safe, since you do not want to muck around 
> with the version or the path anyway.
> 
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Petr Baudis <pasky@suse.cz>

It isn't all that great but it seems everything xs does with this is to feed it to sv_setpv() which AFAIK copies it around.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Junio C Hamano· Jul 2, 2006, 22:39 UTC · re: Petr Baudis · lore

Re: [PATCH] Git.xs: older perl do not know const char *

Petr Baudis <pasky@suse.cz> writes:
Show 11 quoted lines
> Dear diary, on Sun, Jul 02, 2006 at 11:53:03AM CEST, I got a letter
> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
>> Both of these casts _should_ be safe, since you do not want to muck around 
>> with the version or the path anyway.
>> 
>> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> Acked-by: Petr Baudis <pasky@suse.cz>
>
> It isn't all that great but it seems everything xs does with this is to
> feed it to sv_setpv() which AFAIK copies it around.

Thanks. Already applied but not pushed out yet (I am working on tracking down unrelated breakage in tests).

← back to recent threads