git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fork0@t-online.de (Alex Riesen)
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, Jon Loeliger <jdl@jdl.com>
Subject: [PATCH] Use const for interpolate arguments
Date: Mon, 25 Sep 2006 23:19:00 +0200	[thread overview]
Message-ID: <20060925211900.GB6125@steel.home> (raw)
In-Reply-To: <E1GPqwJ-0002xt-Bt@jdl.com>

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>

---

Resending. jdl.com blacklisted my IP, for whatever it has done to him.

 interpolate.c |    6 +++---
 interpolate.h |    9 +++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/interpolate.c b/interpolate.c
index d82f1b5..4570c12 100644
--- a/interpolate.c
+++ b/interpolate.c
@@ -25,10 +25,10 @@ #include "interpolate.h"
  */
 
 int interpolate(char *result, int reslen,
-		char *orig,
-		struct interp *interps, int ninterps)
+		const char *orig,
+		const struct interp *interps, int ninterps)
 {
-	char *src = orig;
+	const char *src = orig;
 	char *dest = result;
 	int newlen = 0;
 	char *name, *value;
diff --git a/interpolate.h b/interpolate.h
index 00c63a5..d16f924 100644
--- a/interpolate.h
+++ b/interpolate.h
@@ -5,6 +5,11 @@
 #ifndef INTERPOLATE_H
 #define INTERPOLATE_H
 
+/*
+ * Convert a NUL-terminated string in buffer orig,
+ * performing substitutions on %-named sub-strings from
+ * the interpretation table.
+ */
 
 struct interp {
 	char *name;
@@ -12,7 +17,7 @@ struct interp {
 };
 
 extern int interpolate(char *result, int reslen,
-		       char *orig,
-		       struct interp *interps, int ninterps);
+		       const char *orig,
+		       const struct interp *interps, int ninterps);
 
 #endif /* INTERPOLATE_H */
-- 
1.4.2.1.g6b47-dirty

      parent reply	other threads:[~2006-09-25 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20  1:31 [PATCH V2] Add virtualization support to git-daemon Jon Loeliger
2006-09-25 21:02 ` [PATCH] Use const for interpolate arguments Alex Riesen
2006-09-25 21:19 ` Alex Riesen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060925211900.GB6125@steel.home \
    --to=fork0@t-online.de \
    --cc=git@vger.kernel.org \
    --cc=jdl@jdl.com \
    --cc=junkio@cox.net \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).