diff options
| author | 2013-03-04 00:04:29 (JST) | |
|---|---|---|
| committer | 2013-03-04 09:12:48 (JST) | |
| commit | 53bc747d311d18642fa3ad0cc0de34f3899ed1f4 (patch) | |
| tree | 97e6fa2e4e7300f55a180917059b71e566c260fe /shared.c | |
| parent | 7f4e8c33aeb65bdc5695c9fd13ec1ceb100303c7 (diff) | |
| download | cgit-53bc747d311d18642fa3ad0cc0de34f3899ed1f4.zip cgit-53bc747d311d18642fa3ad0cc0de34f3899ed1f4.tar.gz | |
Fix several whitespace errors
* Remove whitespace at the end of lines.
* Replace space indentation by tabs.
* Add whitespace before/after several operators ("+", "-", "*", ...)
* Add whitespace to assignments ("foo = bar;").
* Fix whitespace in parameter lists ("foobar(foo, bar, 42)").
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'shared.c')
| -rw-r--r-- | shared.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -28,8 +28,8 @@ int chk_positive(int result, char *msg) | |||
| 28 | 28 | ||
| 29 | int chk_non_negative(int result, char *msg) | 29 | int chk_non_negative(int result, char *msg) |
| 30 | { | 30 | { |
| 31 | if (result < 0) | 31 | if (result < 0) |
| 32 | die("%s: %s",msg, strerror(errno)); | 32 | die("%s: %s", msg, strerror(errno)); |
| 33 | return result; | 33 | return result; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| @@ -80,7 +80,7 @@ struct cgit_repo *cgit_get_repoinfo(const char *url) | |||
| 80 | int i; | 80 | int i; |
| 81 | struct cgit_repo *repo; | 81 | struct cgit_repo *repo; |
| 82 | 82 | ||
| 83 | for (i=0; i<cgit_repolist.count; i++) { | 83 | for (i = 0; i < cgit_repolist.count; i++) { |
| 84 | repo = &cgit_repolist.repos[i]; | 84 | repo = &cgit_repolist.repos[i]; |
| 85 | if (!strcmp(repo->url, url)) | 85 | if (!strcmp(repo->url, url)) |
| 86 | return repo; | 86 | return repo; |
| @@ -207,7 +207,7 @@ static int load_mmfile(mmfile_t *file, const unsigned char *sha1) | |||
| 207 | file->ptr = (char *)""; | 207 | file->ptr = (char *)""; |
| 208 | file->size = 0; | 208 | file->size = 0; |
| 209 | } else { | 209 | } else { |
| 210 | file->ptr = read_sha1_file(sha1, &type, | 210 | file->ptr = read_sha1_file(sha1, &type, |
| 211 | (unsigned long *)&file->size); | 211 | (unsigned long *)&file->size); |
| 212 | } | 212 | } |
| 213 | return 1; | 213 | return 1; |
| @@ -354,14 +354,14 @@ int cgit_parse_snapshots_mask(const char *str) | |||
| 354 | if(atoi(str)) | 354 | if(atoi(str)) |
| 355 | return 1; | 355 | return 1; |
| 356 | for(;;) { | 356 | for(;;) { |
| 357 | str += strspn(str,delim); | 357 | str += strspn(str, delim); |
| 358 | tl = strcspn(str,delim); | 358 | tl = strcspn(str, delim); |
| 359 | if (!tl) | 359 | if (!tl) |
| 360 | break; | 360 | break; |
| 361 | for (f = cgit_snapshot_formats; f->suffix; f++) { | 361 | for (f = cgit_snapshot_formats; f->suffix; f++) { |
| 362 | sl = strlen(f->suffix); | 362 | sl = strlen(f->suffix); |
| 363 | if((tl == sl && !strncmp(f->suffix, str, tl)) || | 363 | if((tl == sl && !strncmp(f->suffix, str, tl)) || |
| 364 | (tl == sl-1 && !strncmp(f->suffix+1, str, tl-1))) { | 364 | (tl == sl - 1 && !strncmp(f->suffix + 1, str, tl - 1))) { |
| 365 | rv |= f->bit; | 365 | rv |= f->bit; |
| 366 | break; | 366 | break; |
| 367 | } | 367 | } |
