[pacman-dev] [PATCH 1/4] fix comment style // -> /* */
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- src/pacman/check.c | 2 +- src/util/cleanupdelta.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pacman/check.c b/src/pacman/check.c index a657f95..92ce05c 100644 --- a/src/pacman/check.c +++ b/src/pacman/check.c @@ -310,7 +310,7 @@ int check_pkg_full(alpm_pkg_t *pkg) if(type == AE_IFREG) { /* TODO: these are expected to be changed with backup files */ file_errors += check_file_size(pkgname, filepath, &st, entry); - //file_errors += check_file_md5sum(pkgname, filepath, &st, entry); + /* file_errors += check_file_md5sum(pkgname, filepath, &st, entry); */ } if(config->quiet && file_errors) { diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index 2f7720b..eecb1ae 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -42,7 +42,7 @@ static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) switch(level) { case ALPM_LOG_ERROR: printf("error: "); break; case ALPM_LOG_WARNING: printf("warning: "); break; - //case ALPM_LOG_DEBUG: printf("debug: "); break; + /* case ALPM_LOG_DEBUG: printf("debug: "); break; */ default: return; } vprintf(fmt, args); -- 1.8.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- lib/libalpm/filelist.c | 2 +- lib/libalpm/handle.c | 2 +- lib/libalpm/util.c | 16 ++++++++-------- src/pacman/callback.c | 2 +- src/pacman/conf.c | 2 +- src/pacman/sync.c | 4 ++-- src/pacman/util.c | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c index d1aeb83..f4cdddc 100644 --- a/lib/libalpm/filelist.c +++ b/lib/libalpm/filelist.c @@ -185,7 +185,7 @@ error: int _alpm_filelist_resolve(alpm_handle_t *handle, alpm_filelist_t *files) { char path[PATH_MAX]; - size_t root_len, i=0; + size_t root_len, i = 0; int ret = 0; if(!files || files->resolved_path) { diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index c064379..75aaf9d 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -57,7 +57,7 @@ void _alpm_handle_free(alpm_handle_t *handle) /* close logfile */ if(handle->logstream) { fclose(handle->logstream); - handle->logstream= NULL; + handle->logstream = NULL; } if(handle->usesyslog) { handle->usesyslog = 0; diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index c33e32a..22953ba 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -69,22 +69,22 @@ char *strsep(char **str, const char *delims) { char *token; - if(*str==NULL) { + if(*str == NULL) { /* No more tokens */ return NULL; } - token=*str; - while(**str!='\0') { - if(strchr(delims,**str)!=NULL) { - **str='\0'; + token = *str; + while(**str != '\0') { + if(strchr(delims, **str) != NULL) { + **str = '\0'; (*str)++; return token; } (*str)++; } /* There is no other token */ - *str=NULL; + *str = NULL; return token; } #endif @@ -350,7 +350,7 @@ int _alpm_unpack(alpm_handle_t *handle, const char *path, const char *prefix, char *entry_prefix = strdup(entryname); char *p = strstr(entry_prefix,"/"); if(p) { - *(p+1) = '\0'; + *(p + 1) = '\0'; } char *found = alpm_list_find_str(list, entry_prefix); free(entry_prefix); @@ -475,7 +475,7 @@ int _alpm_logaction(alpm_handle_t *handle, const char *fmt, va_list args) /* Use ISO-8601 date format */ fprintf(handle->logstream, "[%04d-%02d-%02d %02d:%02d] ", - tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); ret = vfprintf(handle->logstream, fmt, args); fflush(handle->logstream); diff --git a/src/pacman/callback.c b/src/pacman/callback.c index c9008e0..78dcd63 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -201,7 +201,7 @@ void cb_event(alpm_event_t event, void *data1, void *data2) alpm_pkg_get_name(data1), alpm_pkg_get_version(data2), alpm_pkg_get_version(data1)); - display_new_optdepends(data2,data1); + display_new_optdepends(data2, data1); break; case ALPM_EVENT_INTEGRITY_START: if(config->noprogressbar) { diff --git a/src/pacman/conf.c b/src/pacman/conf.c index de29975..6ea7fe2 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -127,7 +127,7 @@ static int download_with_xfercommand(const char *url, const char *localpath, int usepart = 0; int cwdfd; struct stat st; - char *parsedcmd,*tempcmd; + char *parsedcmd, *tempcmd; char *destfile, *tempfile, *filename; if(!config->xfercommand) { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 09d7657..b25f7a5 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -359,7 +359,7 @@ static void print_installed(alpm_db_t *db_local, alpm_pkg_t *pkg) alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); if(lpkg) { const char *lpkgver = alpm_pkg_get_version(lpkg); - if(strcmp(lpkgver,pkgver) == 0) { + if(strcmp(lpkgver, pkgver) == 0) { printf(" [%s]", _("installed")); } else { printf(" [%s: %s]", _("installed"), lpkgver); @@ -573,7 +573,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) if(db == NULL) { pm_printf(ALPM_LOG_ERROR, - _("repository \"%s\" was not found.\n"),repo); + _("repository \"%s\" was not found.\n"), repo); alpm_list_free(ls); return 1; } diff --git a/src/pacman/util.c b/src/pacman/util.c index 81eec67..5203490 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1266,7 +1266,7 @@ void display_optdepends(alpm_pkg_t *pkg) static void display_repo_list(const char *dbname, alpm_list_t *list, unsigned short cols) { - const char *prefix= " "; + const char *prefix = " "; printf(":: "); printf(_("Repository %s\n"), dbname); @@ -1361,14 +1361,14 @@ static int multiselect_parse(char *array, int count, char *response) return -1; if(!ends) { - array[start-1] = include; + array[start - 1] = include; } else { int d; if(parseindex(ends, &end, start, count) != 0) { return -1; } for(d = start; d <= end; d++) { - array[d-1] = include; + array[d - 1] = include; } } } -- 1.8.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- lib/libalpm/conflict.c | 3 ++- lib/libalpm/handle.c | 5 +++-- lib/libalpm/signing.c | 3 ++- src/pacman/conf.c | 12 ++++++++---- src/pacman/pacman.c | 3 ++- src/pacman/util.c | 3 ++- src/util/cleanupdelta.c | 9 ++++++--- src/util/pactree.c | 7 ++++--- 8 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 5fbdfc8..0080e7c 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -133,7 +133,8 @@ static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps, */ static void check_conflict(alpm_handle_t *handle, alpm_list_t *list1, alpm_list_t *list2, - alpm_list_t **baddeps, int order) { + alpm_list_t **baddeps, int order) +{ alpm_list_t *i; if(!baddeps) { diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 75aaf9d..1a840ab 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -314,7 +314,8 @@ int SYMEXPORT alpm_option_set_progresscb(alpm_handle_t *handle, alpm_cb_progress return 0; } -static char *canonicalize_path(const char *path) { +static char *canonicalize_path(const char *path) +{ char *new_path; size_t len; @@ -331,7 +332,7 @@ static char *canonicalize_path(const char *path) { alpm_errno_t _alpm_set_directory_option(const char *value, char **storage, int must_exist) - { +{ struct stat st; char real[PATH_MAX]; const char *path; diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 22d4d3d..606b6a6 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -379,7 +379,8 @@ error: * @return 0 on success, -1 on failure to properly decode */ static int decode_signature(const char *base64_data, - unsigned char **data, size_t *data_len) { + unsigned char **data, size_t *data_len) +{ size_t len = strlen(base64_data); unsigned char *usline = (unsigned char *)base64_data; /* reasonable allocation of expected length is 3/4 of encoded length */ diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 6ea7fe2..1bea2b0 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -90,7 +90,8 @@ int config_free(config_t *oldconfig) } /** Helper function for download_with_xfercommand() */ -static char *get_filename(const char *url) { +static char *get_filename(const char *url) +{ char *filename = strrchr(url, '/'); if(filename != NULL) { filename++; @@ -99,7 +100,8 @@ static char *get_filename(const char *url) { } /** Helper function for download_with_xfercommand() */ -static char *get_destfile(const char *path, const char *filename) { +static char *get_destfile(const char *path, const char *filename) +{ char *destfile; /* len = localpath len + filename len + null */ size_t len = strlen(path) + strlen(filename) + 1; @@ -110,7 +112,8 @@ static char *get_destfile(const char *path, const char *filename) { } /** Helper function for download_with_xfercommand() */ -static char *get_tempfile(const char *path, const char *filename) { +static char *get_tempfile(const char *path, const char *filename) +{ char *tempfile; /* len = localpath len + filename len + '.part' len + null */ size_t len = strlen(path) + strlen(filename) + 6; @@ -122,7 +125,8 @@ static char *get_tempfile(const char *path, const char *filename) { /** External fetch callback */ static int download_with_xfercommand(const char *url, const char *localpath, - int force) { + int force) +{ int ret = 0, retval; int usepart = 0; int cwdfd; diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index f293a5d..f3ca8b9 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -258,7 +258,8 @@ static void setuseragent(void) * * @param ret the return value */ -static void cleanup(int ret) { +static void cleanup(int ret) +{ /* free alpm library resources */ if(config->handle && alpm_release(config->handle) == -1) { pm_printf(ALPM_LOG_ERROR, "error releasing alpm library\n"); diff --git a/src/pacman/util.c b/src/pacman/util.c index 5203490..0aa3412 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -130,7 +130,8 @@ int check_syncdbs(size_t need_repos, int check_valid) } /* discard unhandled input on the terminal's input buffer */ -static int flush_term_input(int fd) { +static int flush_term_input(int fd) +{ #ifdef HAVE_TCFLUSH if(isatty(fd)) { return tcflush(fd, TCIFLUSH); diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index eecb1ae..144e038 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -28,7 +28,8 @@ alpm_handle_t *handle = NULL; -static void cleanup(int signum) { +static void cleanup(int signum) +{ if(handle && alpm_release(handle) == -1) { fprintf(stderr, "error releasing alpm\n"); } @@ -64,7 +65,8 @@ static void checkpkgs(alpm_list_t *pkglist) } } -static void checkdbs(alpm_list_t *dbnames) { +static void checkdbs(alpm_list_t *dbnames) +{ alpm_db_t *db = NULL; alpm_list_t *i; const alpm_siglevel_t level = ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL; @@ -82,7 +84,8 @@ static void checkdbs(alpm_list_t *dbnames) { } -static void usage(void) { +static void usage(void) +{ fprintf(stderr, "usage:\n"); fprintf(stderr, "\t%s [-b <pacman db>] core extra ... : check the listed sync databases\n", BASENAME); diff --git a/src/util/pactree.c b/src/util/pactree.c index 9125f58..33cf66c 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -178,7 +178,8 @@ static size_t strtrim(char *str) return end - pch; } -static int register_syncs(void) { +static int register_syncs(void) +{ FILE *fp; char *section = NULL; char line[LINE_MAX]; @@ -350,7 +351,7 @@ static void print_text(const char *pkg, const char *provision, depth = depth->prev; } printf("%s", color->branch1); - while(depth->next){ + while(depth->next) { printf("%*s%-*s", style->indent * (depth->level - level), "", style->indent, style->limb); level = depth->level + 1; @@ -471,7 +472,7 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int r }; depth->next = &d; /* last dep, cut off the limb here */ - if(last){ + if(last) { if(depth->prev) { depth->prev->next = &d; d.prev = depth->prev; -- 1.8.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- lib/libalpm/be_package.c | 2 +- lib/libalpm/filelist.c | 2 +- lib/libalpm/signing.c | 2 +- lib/libalpm/util.c | 2 +- lib/libalpm/version.c | 42 +++++++++++++++++++++--------------------- src/pacman/callback.c | 2 +- src/pacman/sync.c | 2 +- src/util/pacsort.c | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index c3486a8..18fc14a 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -336,7 +336,7 @@ int _alpm_pkg_validate_internal(alpm_handle_t *handle, } } - if (validation && !*validation) { + if(validation && !*validation) { *validation = ALPM_PKG_VALIDATION_NONE; } diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c index f4cdddc..f29bb7c 100644 --- a/lib/libalpm/filelist.c +++ b/lib/libalpm/filelist.c @@ -130,7 +130,7 @@ int _alpm_filelist_resolve_link(alpm_filelist_t *files, size_t *i, } /* deal with children of non-existent directories to reduce lstat() calls */ - if (!exists) { + if(!exists) { for((*i)++; *i < files->count; (*i)++) { char *f = files->files[*i].name; size_t f_len = strlen(f); diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 606b6a6..ec9aa99 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -293,7 +293,7 @@ static int key_search(alpm_handle_t *handle, const char *fpr, pgpkey->length = key->subkeys->length; pgpkey->revoked = key->subkeys->revoked; - switch (key->subkeys->pubkey_algo) { + switch(key->subkeys->pubkey_algo) { case GPGME_PK_RSA: case GPGME_PK_RSA_E: case GPGME_PK_RSA_S: diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 22953ba..a8ee12c 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -858,7 +858,7 @@ static char *hex_representation(unsigned char *bytes, size_t size) MALLOC(str, 2 * size + 1, return NULL); - for (i = 0; i < size; i++) { + for(i = 0; i < size; i++) { str[2 * i] = hex_digits[bytes[i] >> 4]; str[2 * i + 1] = hex_digits[bytes[i] & 0x0f]; } diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c index 59a7a4e..f25b279 100644 --- a/lib/libalpm/version.c +++ b/lib/libalpm/version.c @@ -46,7 +46,7 @@ static void parseEVR(char *evr, const char **ep, const char **vp, s = evr; /* s points to epoch terminator */ - while (*s && isdigit(*s)) s++; + while(*s && isdigit(*s)) s++; /* se points to version terminator */ se = strrchr(s, '-'); @@ -100,15 +100,15 @@ static int rpmvercmp(const char *a, const char *b) two = ptr2 = str2; /* loop through each version segment of str1 and str2 and compare them */ - while (*one && *two) { - while (*one && !isalnum((int)*one)) one++; - while (*two && !isalnum((int)*two)) two++; + while(*one && *two) { + while(*one && !isalnum((int)*one)) one++; + while(*two && !isalnum((int)*two)) two++; /* If we ran to the end of either, we are finished with the loop */ - if (!(*one && *two)) break; + if(!(*one && *two)) break; /* If the separator lengths were different, we are also finished */ - if ((one - ptr1) != (two - ptr2)) { + if((one - ptr1) != (two - ptr2)) { return (one - ptr1) < (two - ptr2) ? -1 : 1; } @@ -118,13 +118,13 @@ static int rpmvercmp(const char *a, const char *b) /* grab first completely alpha or completely numeric segment */ /* leave one and two pointing to the start of the alpha or numeric */ /* segment and walk ptr1 and ptr2 to end of segment */ - if (isdigit((int)*ptr1)) { - while (*ptr1 && isdigit((int)*ptr1)) ptr1++; - while (*ptr2 && isdigit((int)*ptr2)) ptr2++; + if(isdigit((int)*ptr1)) { + while(*ptr1 && isdigit((int)*ptr1)) ptr1++; + while(*ptr2 && isdigit((int)*ptr2)) ptr2++; isnum = 1; } else { - while (*ptr1 && isalpha((int)*ptr1)) ptr1++; - while (*ptr2 && isalpha((int)*ptr2)) ptr2++; + while(*ptr1 && isalpha((int)*ptr1)) ptr1++; + while(*ptr2 && isalpha((int)*ptr2)) ptr2++; isnum = 0; } @@ -137,7 +137,7 @@ static int rpmvercmp(const char *a, const char *b) /* this cannot happen, as we previously tested to make sure that */ /* the first string has a non-null segment */ - if (one == ptr1) { + if(one == ptr1) { ret = -1; /* arbitrary */ goto cleanup; } @@ -146,26 +146,26 @@ static int rpmvercmp(const char *a, const char *b) /* different types: one numeric, the other alpha (i.e. empty) */ /* numeric segments are always newer than alpha segments */ /* XXX See patch #60884 (and details) from bugzilla #50977. */ - if (two == ptr2) { + if(two == ptr2) { ret = isnum ? 1 : -1; goto cleanup; } - if (isnum) { + if(isnum) { /* this used to be done by converting the digit segments */ /* to ints using atoi() - it's changed because long */ /* digit segments can overflow an int - this should fix that. */ /* throw away any leading zeros - it's a number, right? */ - while (*one == '0') one++; - while (*two == '0') two++; + while(*one == '0') one++; + while(*two == '0') two++; /* whichever number has more digits wins */ - if (strlen(one) > strlen(two)) { + if(strlen(one) > strlen(two)) { ret = 1; goto cleanup; } - if (strlen(two) > strlen(one)) { + if(strlen(two) > strlen(one)) { ret = -1; goto cleanup; } @@ -176,7 +176,7 @@ static int rpmvercmp(const char *a, const char *b) /* if they are equal because there might be more segments to */ /* compare */ rc = strcmp(one, two); - if (rc) { + if(rc) { ret = rc < 1 ? -1 : 1; goto cleanup; } @@ -191,7 +191,7 @@ static int rpmvercmp(const char *a, const char *b) /* this catches the case where all numeric and alpha segments have */ /* compared identically but the segment separating characters were */ /* different */ - if ((!*one) && (!*two)) { + if((!*one) && (!*two)) { ret = 0; goto cleanup; } @@ -202,7 +202,7 @@ static int rpmvercmp(const char *a, const char *b) * - if one is an alpha, two is newer. * - otherwise one is newer. * */ - if ( (!*one && !isalpha((int)*two)) + if( (!*one && !isalpha((int)*two)) || isalpha((int)*one) ) { ret = -1; } else { diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 78dcd63..f53f59c 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -423,7 +423,7 @@ void cb_progress(alpm_progress_t event, const char *pkgname, int percent, prevcurrent = current; /* set text of message to display */ - switch (event) { + switch(event) { case ALPM_PROGRESS_ADD_START: opr = _("installing"); break; diff --git a/src/pacman/sync.c b/src/pacman/sync.c index b25f7a5..fef2940 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -229,7 +229,7 @@ static int sync_cleancache(int level) continue; } - if (level <= 1) { + if(level <= 1) { static const char * const glob_skips[] = { /* skip signature files - they are removed with their package file */ "*.sig", diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 7275cc7..c7b8c94 100644 --- a/src/util/pacsort.c +++ b/src/util/pacsort.c @@ -205,7 +205,7 @@ static int splitfile(FILE *stream, struct buffer_t *buffer, struct list_t *list) while(!feof(stream)) { /* check if a read of BUFSIZ chars will overflow */ - if (buffer->len + BUFSIZ + 1 >= buffer->maxlen) { + if(buffer->len + BUFSIZ + 1 >= buffer->maxlen) { if(buffer_grow(buffer) != 0) { return 1; } -- 1.8.1
participants (1)
-
Gerardo Exequiel Pozzi