code syntax cleanup
As per HACKING file, we use 'CTRL(' rather than 'CTRL (' Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
5f0df42303
commit
3d4656c020
6 changed files with 24 additions and 24 deletions
|
@ -395,7 +395,7 @@ int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep)
|
||||||
/* any version will satisfy the requirement */
|
/* any version will satisfy the requirement */
|
||||||
satisfy = (provision->name_hash == dep->name_hash
|
satisfy = (provision->name_hash == dep->name_hash
|
||||||
&& strcmp(provision->name, dep->name) == 0);
|
&& strcmp(provision->name, dep->name) == 0);
|
||||||
} else if (provision->mod == ALPM_DEP_MOD_EQ) {
|
} else if(provision->mod == ALPM_DEP_MOD_EQ) {
|
||||||
/* provision specifies a version, so try it out */
|
/* provision specifies a version, so try it out */
|
||||||
satisfy = (provision->name_hash == dep->name_hash
|
satisfy = (provision->name_hash == dep->name_hash
|
||||||
&& strcmp(provision->name, dep->name) == 0
|
&& strcmp(provision->name, dep->name) == 0
|
||||||
|
|
|
@ -942,7 +942,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert the result to something readable */
|
/* Convert the result to something readable */
|
||||||
for (i = 0; i < 16; i++) {
|
for(i = 0; i < 16; i++) {
|
||||||
int pos = i * 2;
|
int pos = i * 2;
|
||||||
/* high 4 bits are first digit, low 4 are second */
|
/* high 4 bits are first digit, low 4 are second */
|
||||||
md5sum[pos] = hex_digits[output[i] >> 4];
|
md5sum[pos] = hex_digits[output[i] >> 4];
|
||||||
|
@ -975,7 +975,7 @@ char SYMEXPORT *alpm_compute_sha256sum(const char *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert the result to something readable */
|
/* Convert the result to something readable */
|
||||||
for (i = 0; i < 32; i++) {
|
for(i = 0; i < 32; i++) {
|
||||||
int pos = i * 2;
|
int pos = i * 2;
|
||||||
/* high 4 bits are first digit, low 4 are second */
|
/* high 4 bits are first digit, low 4 are second */
|
||||||
sha256sum[pos] = hex_digits[output[i] >> 4];
|
sha256sum[pos] = hex_digits[output[i] >> 4];
|
||||||
|
@ -1216,13 +1216,13 @@ off_t _alpm_strtoofft(const char *line)
|
||||||
return (off_t)-1;
|
return (off_t)-1;
|
||||||
}
|
}
|
||||||
result = strtoull(line, &end, 10);
|
result = strtoull(line, &end, 10);
|
||||||
if (result == 0 && end == line) {
|
if(result == 0 && end == line) {
|
||||||
/* line was not a number */
|
/* line was not a number */
|
||||||
return (off_t)-1;
|
return (off_t)-1;
|
||||||
} else if (result == ULLONG_MAX && errno == ERANGE) {
|
} else if(result == ULLONG_MAX && errno == ERANGE) {
|
||||||
/* line does not fit in unsigned long long */
|
/* line does not fit in unsigned long long */
|
||||||
return (off_t)-1;
|
return (off_t)-1;
|
||||||
} else if (*end) {
|
} else if(*end) {
|
||||||
/* line began with a number but has junk left over at the end */
|
/* line began with a number but has junk left over at the end */
|
||||||
return (off_t)-1;
|
return (off_t)-1;
|
||||||
}
|
}
|
||||||
|
@ -1251,14 +1251,14 @@ alpm_time_t _alpm_parsedate(const char *line)
|
||||||
}
|
}
|
||||||
|
|
||||||
result = strtoll(line, &end, 10);
|
result = strtoll(line, &end, 10);
|
||||||
if (result == 0 && end == line) {
|
if(result == 0 && end == line) {
|
||||||
/* line was not a number */
|
/* line was not a number */
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
} else if (errno == ERANGE) {
|
} else if(errno == ERANGE) {
|
||||||
/* line does not fit in long long */
|
/* line does not fit in long long */
|
||||||
return 0;
|
return 0;
|
||||||
} else if (*end) {
|
} else if(*end) {
|
||||||
/* line began with a number but has junk left over at the end */
|
/* line began with a number but has junk left over at the end */
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1281,7 +1281,7 @@ int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int a
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (dir) {
|
if(dir) {
|
||||||
char *check_path;
|
char *check_path;
|
||||||
|
|
||||||
len = strlen(dir) + strlen(file) + 1;
|
len = strlen(dir) + strlen(file) + 1;
|
||||||
|
@ -1296,19 +1296,19 @@ int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int a
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
if (amode & R_OK) {
|
if(amode & R_OK) {
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not readable: %s\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not readable: %s\n",
|
||||||
dir, file, strerror(errno));
|
dir, file, strerror(errno));
|
||||||
}
|
}
|
||||||
if (amode & W_OK) {
|
if(amode & W_OK) {
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not writable: %s\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not writable: %s\n",
|
||||||
dir, file, strerror(errno));
|
dir, file, strerror(errno));
|
||||||
}
|
}
|
||||||
if (amode & X_OK) {
|
if(amode & X_OK) {
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not executable: %s\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" is not executable: %s\n",
|
||||||
dir, file, strerror(errno));
|
dir, file, strerror(errno));
|
||||||
}
|
}
|
||||||
if (amode == F_OK) {
|
if(amode == F_OK) {
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" does not exist: %s\n",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "\"%s%s\" does not exist: %s\n",
|
||||||
dir, file, strerror(errno));
|
dir, file, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,7 +298,7 @@ void cb_question(alpm_question_t event, void *data1, void *data2,
|
||||||
alpm_list_t *unresolved = data1;
|
alpm_list_t *unresolved = data1;
|
||||||
alpm_list_t *namelist = NULL, *i;
|
alpm_list_t *namelist = NULL, *i;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
for (i = unresolved; i; i = i->next) {
|
for(i = unresolved; i; i = i->next) {
|
||||||
namelist = alpm_list_add(namelist,
|
namelist = alpm_list_add(namelist,
|
||||||
(char *)alpm_pkg_get_name(i->data));
|
(char *)alpm_pkg_get_name(i->data));
|
||||||
count++;
|
count++;
|
||||||
|
@ -351,7 +351,7 @@ void cb_question(alpm_question_t event, void *data1, void *data2,
|
||||||
time_t time = (time_t)key->created;
|
time_t time = (time_t)key->created;
|
||||||
strftime(created, 12, "%Y-%m-%d", localtime(&time));
|
strftime(created, 12, "%Y-%m-%d", localtime(&time));
|
||||||
|
|
||||||
if (key->revoked) {
|
if(key->revoked) {
|
||||||
revoked = " (revoked)";
|
revoked = " (revoked)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,11 +259,11 @@ static int process_siglevel(alpm_list_t *values, alpm_siglevel_t *storage,
|
||||||
const char *original = i->data, *value;
|
const char *original = i->data, *value;
|
||||||
int package = 0, database = 0;
|
int package = 0, database = 0;
|
||||||
|
|
||||||
if (strncmp(original, "Package", strlen("Package")) == 0) {
|
if(strncmp(original, "Package", strlen("Package")) == 0) {
|
||||||
/* only packages are affected, don't flip flags for databases */
|
/* only packages are affected, don't flip flags for databases */
|
||||||
value = original + strlen("Package");
|
value = original + strlen("Package");
|
||||||
package = 1;
|
package = 1;
|
||||||
} else if (strncmp(original, "Database", strlen("Database")) == 0) {
|
} else if(strncmp(original, "Database", strlen("Database")) == 0) {
|
||||||
/* only databases are affected, don't flip flags for packages */
|
/* only databases are affected, don't flip flags for packages */
|
||||||
value = original + strlen("Database");
|
value = original + strlen("Database");
|
||||||
database = 1;
|
database = 1;
|
||||||
|
@ -823,7 +823,7 @@ static int _parseconfig(const char *file, struct section_t *section,
|
||||||
if((ret = _parse_options(key, value, file, linenum)) != 0) {
|
if((ret = _parse_options(key, value, file, linenum)) != 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else if (!parse_options && !section->is_options) {
|
} else if(!parse_options && !section->is_options) {
|
||||||
/* ... or in a repo section */
|
/* ... or in a repo section */
|
||||||
if(strcmp(key, "Server") == 0) {
|
if(strcmp(key, "Server") == 0) {
|
||||||
if(value == NULL) {
|
if(value == NULL) {
|
||||||
|
@ -860,7 +860,7 @@ static int _parseconfig(const char *file, struct section_t *section,
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (fp) {
|
if(fp) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file);
|
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file);
|
||||||
|
|
|
@ -207,7 +207,7 @@ static void usage(int op, const char * const myname)
|
||||||
addlist(_(" --noconfirm do not ask for any confirmation\n"));
|
addlist(_(" --noconfirm do not ask for any confirmation\n"));
|
||||||
}
|
}
|
||||||
list = alpm_list_msort(list, alpm_list_count(list), options_cmp);
|
list = alpm_list_msort(list, alpm_list_count(list), options_cmp);
|
||||||
for (i = list; i; i = alpm_list_next(i)) {
|
for(i = list; i; i = alpm_list_next(i)) {
|
||||||
fputs((const char *)i->data, stdout);
|
fputs((const char *)i->data, stdout);
|
||||||
}
|
}
|
||||||
alpm_list_free(list);
|
alpm_list_free(list);
|
||||||
|
|
|
@ -681,7 +681,7 @@ void list_display(const char *title, const alpm_list_t *list)
|
||||||
size_t j;
|
size_t j;
|
||||||
cols = len;
|
cols = len;
|
||||||
printf("\n");
|
printf("\n");
|
||||||
for (j = 1; j <= len; j++) {
|
for(j = 1; j <= len; j++) {
|
||||||
printf(" ");
|
printf(" ");
|
||||||
}
|
}
|
||||||
} else if(cols != len) {
|
} else if(cols != len) {
|
||||||
|
@ -1184,7 +1184,7 @@ void select_display(const alpm_list_t *pkglist)
|
||||||
char *string = NULL;
|
char *string = NULL;
|
||||||
const char *dbname = NULL;
|
const char *dbname = NULL;
|
||||||
|
|
||||||
for (i = pkglist; i; i = i->next) {
|
for(i = pkglist; i; i = i->next) {
|
||||||
alpm_pkg_t *pkg = i->data;
|
alpm_pkg_t *pkg = i->data;
|
||||||
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
||||||
|
|
||||||
|
@ -1227,7 +1227,7 @@ static int multiselect_parse(char *array, int count, char *response)
|
||||||
{
|
{
|
||||||
char *str, *saveptr;
|
char *str, *saveptr;
|
||||||
|
|
||||||
for (str = response; ; str = NULL) {
|
for(str = response; ; str = NULL) {
|
||||||
int include = 1;
|
int include = 1;
|
||||||
int start, end;
|
int start, end;
|
||||||
char *ends = NULL;
|
char *ends = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue