Skip to content

Commit

Permalink
Use const for interpolate arguments
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Sep 26, 2006
1 parent e8daf78 commit 4dafd7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions interpolate.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
*/

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;
Expand Down
9 changes: 7 additions & 2 deletions interpolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
#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;
char *value;
};

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 */

0 comments on commit 4dafd7d

Please sign in to comment.