Commits
Ryan Schmidt authored 37755d2835f
1 - | Index: fsvs/src/props.c |
2 - | =================================================================== |
3 - | --- src/props.c (revision 2473) |
4 - | +++ src/props.c (revision 2474) |
5 - | |
6 - | /************************************************************************ |
7 - | - * Copyright (C) 2007-2009 Philipp Marek. |
8 - | + * Copyright (C) 2007-2009,2015 Philipp Marek. |
9 - | * |
10 - | * This program is free software; you can redistribute it and/or modify |
11 - | * it under the terms of the GNU General Public License version 3 as |
12 - | |
13 - | |
14 - | /** -. |
15 - | * Wrapper for prp__fetch(). */ |
16 - | -int prp__get(hash_t db, const char *keycp, datum *value) |
17 - | +int prp__get(hash_t db, char * const keycp, datum *value) |
18 - | { |
19 - | static datum key; |
20 - | |
21 - | |
22 - | char **normalized; |
23 - | |
24 - | |
25 - | + db=NULL; |
26 - | status=0; |
27 - | output=stdout; |
28 - | if (argc<2) ac__Usage_this(); |
29 - | |
30 - | |
31 - | |
32 - | status=0; |
33 - | + db=NULL; |
34 - | if (argc<2) ac__Usage_this(); |
35 - | |
36 - | /* Check name for special values. */ |
37 - | |
38 - | int status, rv; |
39 - | datum key; |
40 - | |
41 - | + status=0; |
42 - | rv = prp__open_byestat( sts, GDBM_READER, &db); |
43 - | if (rv == ENOENT) |
44 - | goto done; |
45 - | Index: fsvs/src/props.h |
46 - | =================================================================== |
47 - | --- src/props.h (revision 2473) |
48 - | +++ src/props.h (revision 2474) |
49 - | |
50 - | hash_t *db); |
51 - | /** Get a value, addressed by a string; key length is calculated inclusive |
52 - | * the \c \\0. */ |
53 - | -int prp__get(hash_t db, const char *keycp, datum *value); |
54 - | +int prp__get(hash_t db, char * const keycp, datum *value); |
55 - | /** Store the value; basic function. */ |
56 - | int prp__store(hash_t db, datum key, datum value); |
57 - | /** Get first key. */ |
58 - | Index: fsvs/src/waa.c |
59 - | =================================================================== |
60 - | --- src/waa.c (revision 2473) |
61 - | +++ src/waa.c (revision 2474) |
62 - | |
63 - | /************************************************************************ |
64 - | - * Copyright (C) 2005-2009 Philipp Marek. |
65 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
66 - | * |
67 - | * This program is free software; you can redistribute it and/or modify |
68 - | * it under the terms of the GNU General Public License version 3 as |
69 - | |
70 - | |
71 - | |
72 - | /** Returns the MD5 of the given path, taking the softroot into account. */ |
73 - | -int waa___get_path_md5(const char const *path, |
74 - | +int waa___get_path_md5(const char * path, |
75 - | unsigned char digest[APR_MD5_DIGESTSIZE]) |
76 - | { |
77 - | int status; |
78 - | |
79 - | "\t"; |
80 - | static const char readme_2[]="\n"; |
81 - | |
82 - | - inline int w(const char *buffer, int l) |
83 - | - { |
84 - | - return write(hdl, buffer, l) != l; |
85 - | - } |
86 - | +#define w(_buffer, _l) (write(hdl, _buffer, _l) != _l) |
87 - | |
88 - | - |
89 - | STOPIF( waa__open(directory, name, O_CREAT | O_WRONLY, &hdl), NULL); |
90 - | STOPIF_CODE_ERR( |
91 - | w(readme_1, sizeof(readme_1)-1) || |
92 - | |
93 - | "Cannot create the readme file."); |
94 - | STOPIF( waa__close(hdl, 0), NULL); |
95 - | |
96 - | +#undef w |
97 - | + |
98 - | ex: |
99 - | return status; |
100 - | } |
101 - | |
102 - | /** -. |
103 - | * The \a dir must be absolute; this function makes an own copy, so the |
104 - | * value will be unchanged. */ |
105 - | -int waa__set_working_copy(const char const *wc_dir) |
106 - | +int waa__set_working_copy(const char * const wc_dir) |
107 - | { |
108 - | int status; |
109 - | |
110 - | |
111 - | /** -. |
112 - | * The \a dir must be absolute; this function makes an own copy, so the |
113 - | * value will be unchanged. */ |
114 - | -int waa__create_working_copy(const char const *wc_dir) |
115 - | +int waa__create_working_copy(const char * const wc_dir) |
116 - | { |
117 - | int status; |
118 - | char *dir; |
119 - | Index: fsvs/src/waa.h |
120 - | =================================================================== |
121 - | --- src/waa.h (revision 2473) |
122 - | +++ src/waa.h (revision 2474) |
123 - | |
124 - | /************************************************************************ |
125 - | - * Copyright (C) 2005-2009 Philipp Marek. |
126 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
127 - | * |
128 - | * This program is free software; you can redistribute it and/or modify |
129 - | * it under the terms of the GNU General Public License version 3 as |
130 - | |
131 - | int waa__find_base(struct estat *root, int *argc, char ***args); |
132 - | |
133 - | /** Creates the WAA and CONF directories needed for \a wc_path. */ |
134 - | -int waa__create_working_copy(const char const *wc_dir); |
135 - | +int waa__create_working_copy(const char * const wc_dir); |
136 - | /** Stores the path of the working copy. |
137 - | * Not needed if waa__find_common_base or similar is called. */ |
138 - | -int waa__set_working_copy(const char const *wc_dir); |
139 - | +int waa__set_working_copy(const char * const wc_dir); |
140 - | |
141 - | |
142 - | /** \name Building paths for FSVS's datafiles. |
143 - | Index: fsvs/src/commit.c |
144 - | =================================================================== |
145 - | --- src/commit.c (revision 2473) |
146 - | +++ src/commit.c (revision 2474) |
147 - | |
148 - | /************************************************************************ |
149 - | - * Copyright (C) 2005-2009 Philipp Marek. |
150 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
151 - | * |
152 - | * This program is free software; you can redistribute it and/or modify |
153 - | * it under the terms of the GNU General Public License version 3 as |
154 - | |
155 - | |
156 - | /* Convenience function; checks for \c FSVS_PROP_COMMIT_PIPE. |
157 - | * By putting that here we can avoid sending most of the parameters. */ |
158 - | -inline int send_a_prop(void *baton, int store_encoder, |
159 - | +// inline |
160 - | +int send_a_prop(void *baton, int store_encoder, |
161 - | struct estat *sts, change_any_prop_t function, |
162 - | char *key, svn_string_t *value, |
163 - | apr_pool_t *pool) |
164 - | Index: fsvs/src/racallback.c |
165 - | =================================================================== |
166 - | --- src/racallback.c (revision 2473) |
167 - | +++ src/racallback.c (revision 2474) |
168 - | |
169 - | /************************************************************************ |
170 - | - * Copyright (C) 2005-2009 Philipp Marek. |
171 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
172 - | * |
173 - | * This program is free software; you can redistribute it and/or modify |
174 - | * it under the terms of the GNU General Public License version 3 as |
175 - | |
176 - | } |
177 - | |
178 - | |
179 - | -inline int cb___store_prop(struct estat *sts, |
180 - | +// inline |
181 - | +int cb___store_prop(struct estat *sts, |
182 - | const char *utf8_name, const svn_string_t *value, |
183 - | apr_pool_t *pool) |
184 - | { |
185 - | Index: fsvs/src/status.c |
186 - | =================================================================== |
187 - | --- src/status.c (revision 2473) |
188 - | +++ src/status.c (revision 2474) |
189 - | |
190 - | |
191 - | |
192 - | /** Meta-data status string. */ |
193 - | -inline char * st___meta_string(int status_bits, int flags) |
194 - | +char * st___meta_string(int status_bits, int flags) |
195 - | { |
196 - | - static char buffer[4]; |
197 - | - int prop; |
198 - | + static char buffer[4]; |
199 - | + int prop; |
200 - | |
201 - | - prop=(status_bits & FS_PROPERTIES) | (flags & RF_PUSHPROPS); |
202 - | + prop=(status_bits & FS_PROPERTIES) | (flags & RF_PUSHPROPS); |
203 - | |
204 - | - if (opt__is_verbose() > 0) |
205 - | - { |
206 - | - buffer[0] = status_bits & FS_META_MTIME ? 't' : '.'; |
207 - | - buffer[1] = status_bits & |
208 - | - (FS_META_OWNER | FS_META_GROUP | FS_META_UMODE) ? 'p' : '.'; |
209 - | - buffer[2] = prop ? 'P' : '.'; |
210 - | - buffer[3] = 0; |
211 - | - } |
212 - | - else |
213 - | - { |
214 - | - buffer[0] = status_bits & FS_META_CHANGED ? 'm' : |
215 - | - prop ? 'P' : '.'; |
216 - | - buffer[1]=0; |
217 - | - } |
218 - | + if (opt__is_verbose() > 0) |
219 - | + { |
220 - | + buffer[0] = status_bits & FS_META_MTIME ? 't' : '.'; |
221 - | + buffer[1] = status_bits & |
222 - | + (FS_META_OWNER | FS_META_GROUP | FS_META_UMODE) ? 'p' : '.'; |
223 - | + buffer[2] = prop ? 'P' : '.'; |
224 - | + buffer[3] = 0; |
225 - | + } |
226 - | + else |
227 - | + { |
228 - | + buffer[0] = status_bits & FS_META_CHANGED ? 'm' : |
229 - | + prop ? 'P' : '.'; |
230 - | + buffer[1]=0; |
231 - | + } |
232 - | |
233 - | - return buffer; |
234 - | + return buffer; |
235 - | } |
236 - | |
237 - | |
238 - | Index: fsvs/src/helper.c |
239 - | =================================================================== |
240 - | --- src/helper.c (revision 2473) |
241 - | +++ src/helper.c (revision 2474) |
242 - | |
243 - | /************************************************************************ |
244 - | - * Copyright (C) 2005-2009 Philipp Marek. |
245 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
246 - | * |
247 - | * This program is free software; you can redistribute it and/or modify |
248 - | * it under the terms of the GNU General Public License version 3 as |
249 - | |
250 - | |
251 - | |
252 - | status=0; |
253 - | + path=NULL; |
254 - | switch (opt__get_int(OPT__PATH)) |
255 - | { |
256 - | case PATH_WCRELATIVE: |
257 - | |
258 - | /** -. |
259 - | * If \a source is not \c NULL \a len bytes are copied. |
260 - | * The buffer is \b always \c \\0 terminated. */ |
261 - | -int hlp__strnalloc(int len, char **dest, const char const *source) |
262 - | +int hlp__strnalloc(int len, char **dest, const char * const source) |
263 - | { |
264 - | int status; |
265 - | |
266 - | |
267 - | |
268 - | /** -. */ |
269 - | int hlp__strmnalloc(int len, char **dest, |
270 - | - const char const *source, ...) |
271 - | + const char * source, ...) |
272 - | { |
273 - | int status; |
274 - | va_list vl; |
275 - | Index: fsvs/src/log.c |
276 - | =================================================================== |
277 - | --- src/log.c (revision 2473) |
278 - | +++ src/log.c (revision 2474) |
279 - | |
280 - | /************************************************************************ |
281 - | - * Copyright (C) 2007-2009 Philipp Marek. |
282 - | + * Copyright (C) 2007-2009,2015 Philipp Marek. |
283 - | * |
284 - | * This program is free software; you can redistribute it and/or modify |
285 - | * it under the terms of the GNU General Public License version 3 as |
286 - | |
287 - | case 2: |
288 - | opt__set_int(OPT__LOG_MAXREV, |
289 - | PRIO_DEFAULT, |
290 - | - abs(opt_target_revision-opt_target_revision2)+1); |
291 - | + labs(opt_target_revision-opt_target_revision2)+1); |
292 - | break; |
293 - | default: |
294 - | BUG("how many"); |
295 - | Index: fsvs/src/helper.h |
296 - | =================================================================== |
297 - | --- src/helper.h (revision 2473) |
298 - | +++ src/helper.h (revision 2474) |
299 - | |
300 - | /************************************************************************ |
301 - | - * Copyright (C) 2005-2009 Philipp Marek. |
302 - | + * Copyright (C) 2005-2009,2015 Philipp Marek. |
303 - | * |
304 - | * This program is free software; you can redistribute it and/or modify |
305 - | * it under the terms of the GNU General Public License version 3 as |
306 - | |
307 - | * and so I'd have to use casts everywhere, which wouldn't help the |
308 - | * type-safety anyway. */ |
309 - | /** Allocates a buffer in \a *dest, and copies \a source. */ |
310 - | -int hlp__strnalloc(int len, char **dest, const char const *source); |
311 - | +int hlp__strnalloc(int len, char **dest, const char * const source); |
312 - | /** Like \c hlp__strnalloc, but concatenates strings until a \c NULL is |
313 - | * found. */ |
314 - | int hlp__strmnalloc(int len, char **dest, |
315 - | - const char const *source, ...) __attribute__((sentinel)); |
316 - | + const char * source, ...) __attribute__((sentinel)); |
317 - | /** Own implementation of \c strdup(), possibly returning \c ENOMEM. */ |
318 - | -inline static int hlp__strdup(char **dest, const char const *src) |
319 - | +inline static int hlp__strdup(char **dest, const char * const src) |
320 - | { return hlp__strnalloc(strlen(src), dest, src); } |
321 - | /** Error returning \c calloc(); uses \c (void**) \a output. */ |
322 - | int hlp__calloc(void *output, size_t nmemb, size_t count); |
323 - | Index: fsvs/CHANGES |
324 - | =================================================================== |
325 - | --- CHANGES (revision 2473) |
326 - | +++ CHANGES (revision 2474) |
327 - | |
328 - | Changes since 1.2.6 |
329 - | - Updates for GCC 5 |
330 - | +- Updates for Clang |
331 - | |
332 - | Changes since 1.2.5 |
333 - | - Fix for segfault on deleted properties, eg. "svn:owner". |