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 <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed Feb 14, 2018 at 10:59 UTC ea8ace4ad375d276235aa852e243c27f77ab8521
2 files changed +23 -23
tempfile.c
+6 -6
@@ -165,11 +165,11 @@ struct tempfile *register_tempfile(const char *path)
165 return tempfile;
166 }
167
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)
169 {
170 struct tempfile *tempfile = new_tempfile();
171
172 - strbuf_add_absolute_path(&tempfile->filename, template);
172 + strbuf_add_absolute_path(&tempfile->filename, filename_template);
173 tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
174 if (tempfile->fd < 0) {
175 deactivate_tempfile(tempfile);
@@ -179,7 +179,7 @@ struct tempfile *mks_tempfile_sm(const char *template, int suffixlen, int mode)
179 return tempfile;
180 }
181
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)
183 {
184 struct tempfile *tempfile = new_tempfile();
185 const char *tmpdir;
@@ -188,7 +188,7 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
188 if (!tmpdir)
189 tmpdir = "/tmp";
190
191 - strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, template);
191 + strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, filename_template);
192 tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
193 if (tempfile->fd < 0) {
194 deactivate_tempfile(tempfile);
@@ -198,12 +198,12 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
198 return tempfile;
199 }
200
201 -struct tempfile *xmks_tempfile_m(const char *template, int mode)
201 +struct tempfile *xmks_tempfile_m(const char *filename_template, int mode)
202 {
203 struct tempfile *tempfile;
204 struct strbuf full_template = STRBUF_INIT;
205
206 - strbuf_add_absolute_path(&full_template, template);
206 + strbuf_add_absolute_path(&full_template, filename_template);
207 tempfile = mks_tempfile_m(full_template.buf, mode);
208 if (!tempfile)
209 die_errno("Unable to create temporary file '%s'",
tempfile.h
+17 -17
@@ -135,58 +135,58 @@ extern struct tempfile *register_tempfile(const char *path);
135 */
136
137 /* 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,
139 int suffixlen, int mode);
140
141 /* 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,
143 int suffixlen)
144 {
145 - return mks_tempfile_sm(template, suffixlen, 0600);
145 + return mks_tempfile_sm(filename_template, suffixlen, 0600);
146 }
147
148 /* 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)
150 {
151 - return mks_tempfile_sm(template, 0, mode);
151 + return mks_tempfile_sm(filename_template, 0, mode);
152 }
153
154 /* 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)
156 {
157 - return mks_tempfile_sm(template, 0, 0600);
157 + return mks_tempfile_sm(filename_template, 0, 0600);
158 }
159
160 /* 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,
162 int suffixlen, int mode);
163
164 /* 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,
166 int suffixlen)
167 {
168 - return mks_tempfile_tsm(template, suffixlen, 0600);
168 + return mks_tempfile_tsm(filename_template, suffixlen, 0600);
169 }
170
171 /* 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)
173 {
174 - return mks_tempfile_tsm(template, 0, mode);
174 + return mks_tempfile_tsm(filename_template, 0, mode);
175 }
176
177 /* 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)
179 {
180 - return mks_tempfile_tsm(template, 0, 0600);
180 + return mks_tempfile_tsm(filename_template, 0, 0600);
181 }
182
183 /* 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);
185
186 /* 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)
188 {
189 - return xmks_tempfile_m(template, 0600);
189 + return xmks_tempfile_m(filename_template, 0600);
190 }
191
192 /*