Skip to content

Commit ea8ace4

Browse files
bmwillgitster
authored andcommitted
tempfile: rename 'template' variables
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb78e23 commit ea8ace4

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

tempfile.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ struct tempfile *register_tempfile(const char *path)
165165
return tempfile;
166166
}
167167

168-
struct tempfile *mks_tempfile_sm(const char *template, int suffixlen, int mode)
168+
struct tempfile *mks_tempfile_sm(const char *filename_template, int suffixlen, int mode)
169169
{
170170
struct tempfile *tempfile = new_tempfile();
171171

172-
strbuf_add_absolute_path(&tempfile->filename, template);
172+
strbuf_add_absolute_path(&tempfile->filename, filename_template);
173173
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
174174
if (tempfile->fd < 0) {
175175
deactivate_tempfile(tempfile);
@@ -179,7 +179,7 @@ struct tempfile *mks_tempfile_sm(const char *template, int suffixlen, int mode)
179179
return tempfile;
180180
}
181181

182-
struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
182+
struct tempfile *mks_tempfile_tsm(const char *filename_template, int suffixlen, int mode)
183183
{
184184
struct tempfile *tempfile = new_tempfile();
185185
const char *tmpdir;
@@ -188,7 +188,7 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
188188
if (!tmpdir)
189189
tmpdir = "/tmp";
190190

191-
strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, template);
191+
strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, filename_template);
192192
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
193193
if (tempfile->fd < 0) {
194194
deactivate_tempfile(tempfile);
@@ -198,12 +198,12 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
198198
return tempfile;
199199
}
200200

201-
struct tempfile *xmks_tempfile_m(const char *template, int mode)
201+
struct tempfile *xmks_tempfile_m(const char *filename_template, int mode)
202202
{
203203
struct tempfile *tempfile;
204204
struct strbuf full_template = STRBUF_INIT;
205205

206-
strbuf_add_absolute_path(&full_template, template);
206+
strbuf_add_absolute_path(&full_template, filename_template);
207207
tempfile = mks_tempfile_m(full_template.buf, mode);
208208
if (!tempfile)
209209
die_errno("Unable to create temporary file '%s'",

tempfile.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,58 +135,58 @@ extern struct tempfile *register_tempfile(const char *path);
135135
*/
136136

137137
/* See "mks_tempfile functions" above. */
138-
extern struct tempfile *mks_tempfile_sm(const char *template,
138+
extern struct tempfile *mks_tempfile_sm(const char *filename_template,
139139
int suffixlen, int mode);
140140

141141
/* See "mks_tempfile functions" above. */
142-
static inline struct tempfile *mks_tempfile_s(const char *template,
142+
static inline struct tempfile *mks_tempfile_s(const char *filename_template,
143143
int suffixlen)
144144
{
145-
return mks_tempfile_sm(template, suffixlen, 0600);
145+
return mks_tempfile_sm(filename_template, suffixlen, 0600);
146146
}
147147

148148
/* See "mks_tempfile functions" above. */
149-
static inline struct tempfile *mks_tempfile_m(const char *template, int mode)
149+
static inline struct tempfile *mks_tempfile_m(const char *filename_template, int mode)
150150
{
151-
return mks_tempfile_sm(template, 0, mode);
151+
return mks_tempfile_sm(filename_template, 0, mode);
152152
}
153153

154154
/* See "mks_tempfile functions" above. */
155-
static inline struct tempfile *mks_tempfile(const char *template)
155+
static inline struct tempfile *mks_tempfile(const char *filename_template)
156156
{
157-
return mks_tempfile_sm(template, 0, 0600);
157+
return mks_tempfile_sm(filename_template, 0, 0600);
158158
}
159159

160160
/* See "mks_tempfile functions" above. */
161-
extern struct tempfile *mks_tempfile_tsm(const char *template,
161+
extern struct tempfile *mks_tempfile_tsm(const char *filename_template,
162162
int suffixlen, int mode);
163163

164164
/* See "mks_tempfile functions" above. */
165-
static inline struct tempfile *mks_tempfile_ts(const char *template,
165+
static inline struct tempfile *mks_tempfile_ts(const char *filename_template,
166166
int suffixlen)
167167
{
168-
return mks_tempfile_tsm(template, suffixlen, 0600);
168+
return mks_tempfile_tsm(filename_template, suffixlen, 0600);
169169
}
170170

171171
/* See "mks_tempfile functions" above. */
172-
static inline struct tempfile *mks_tempfile_tm(const char *template, int mode)
172+
static inline struct tempfile *mks_tempfile_tm(const char *filename_template, int mode)
173173
{
174-
return mks_tempfile_tsm(template, 0, mode);
174+
return mks_tempfile_tsm(filename_template, 0, mode);
175175
}
176176

177177
/* See "mks_tempfile functions" above. */
178-
static inline struct tempfile *mks_tempfile_t(const char *template)
178+
static inline struct tempfile *mks_tempfile_t(const char *filename_template)
179179
{
180-
return mks_tempfile_tsm(template, 0, 0600);
180+
return mks_tempfile_tsm(filename_template, 0, 0600);
181181
}
182182

183183
/* See "mks_tempfile functions" above. */
184-
extern struct tempfile *xmks_tempfile_m(const char *template, int mode);
184+
extern struct tempfile *xmks_tempfile_m(const char *filename_template, int mode);
185185

186186
/* See "mks_tempfile functions" above. */
187-
static inline struct tempfile *xmks_tempfile(const char *template)
187+
static inline struct tempfile *xmks_tempfile(const char *filename_template)
188188
{
189-
return xmks_tempfile_m(template, 0600);
189+
return xmks_tempfile_m(filename_template, 0600);
190190
}
191191

192192
/*

0 commit comments

Comments
 (0)