1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

style cleanup: cast as (type *) not (type*)

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2011-03-25 11:57:20 -04:00 committed by Dan McGee
parent fdcfcf28a2
commit 91594a1ef8
14 changed files with 18 additions and 18 deletions

View File

@ -91,7 +91,7 @@ static void *_package_changelog_open(pmpkg_t *pkg)
static size_t _package_changelog_read(void *ptr, size_t size, static size_t _package_changelog_read(void *ptr, size_t size,
const pmpkg_t *pkg, const void *fp) const pmpkg_t *pkg, const void *fp)
{ {
ssize_t sret = archive_read_data((struct archive*)fp, ptr, size); ssize_t sret = archive_read_data((struct archive *)fp, ptr, size);
/* Report error (negative values) */ /* Report error (negative values) */
if(sret < 0) { if(sret < 0) {
pm_errno = PM_ERR_LIBARCHIVE; pm_errno = PM_ERR_LIBARCHIVE;

View File

@ -205,7 +205,7 @@ const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db)
ASSERT(db != NULL, return NULL); ASSERT(db != NULL, return NULL);
ASSERT(db->servers != NULL, return NULL); ASSERT(db->servers != NULL, return NULL);
url = (char*)db->servers->data; url = (char *)db->servers->data;
return url; return url;
} }

View File

@ -192,7 +192,7 @@ static int curl_download_internal(const char *url, const char *localpath,
curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(handle->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(handle->curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSFUNCTION, curl_progress); curl_easy_setopt(handle->curl, CURLOPT_PROGRESSFUNCTION, curl_progress);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSDATA, (void*)&dlfile); curl_easy_setopt(handle->curl, CURLOPT_PROGRESSDATA, (void *)&dlfile);
useragent = getenv("HTTP_USER_AGENT"); useragent = getenv("HTTP_USER_AGENT");
if (useragent != NULL) { if (useragent != NULL) {

View File

@ -203,7 +203,7 @@ const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg)
static int decode_pgpsig(pmpkg_t *pkg) { static int decode_pgpsig(pmpkg_t *pkg) {
int len = strlen(pkg->pgpsig.encdata); int len = strlen(pkg->pgpsig.encdata);
const unsigned char *usline = (const unsigned char*)pkg->pgpsig.encdata; const unsigned char *usline = (const unsigned char *)pkg->pgpsig.encdata;
int destlen = 0; int destlen = 0;
/* get the necessary size for the buffer by passing 0 */ /* get the necessary size for the buffer by passing 0 */
int ret = base64_decode(NULL, &destlen, usline, len); int ret = base64_decode(NULL, &destlen, usline, len);

View File

@ -75,7 +75,7 @@ pmpkghash_t *_alpm_pkghash_create(size_t size)
return NULL; return NULL;
} }
CALLOC(hash->hash_table, hash->buckets, sizeof(alpm_list_t*), \ CALLOC(hash->hash_table, hash->buckets, sizeof(alpm_list_t *), \
free(hash); RET_ERR(PM_ERR_MEMORY, NULL)); free(hash); RET_ERR(PM_ERR_MEMORY, NULL));
return hash; return hash;

View File

@ -378,7 +378,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db)
for(targ = trans->remove; targ; targ = targ->next) { for(targ = trans->remove; targ; targ = targ->next) {
int position = 0; int position = 0;
char scriptlet[PATH_MAX]; char scriptlet[PATH_MAX];
info = (pmpkg_t*)targ->data; info = (pmpkg_t *)targ->data;
const char *pkgname = NULL; const char *pkgname = NULL;
size_t targcount = alpm_list_count(targ); size_t targcount = alpm_list_count(targ);

View File

@ -140,7 +140,7 @@ int _alpm_gpgme_checksig(const char *path, const pmpgpsig_t *sig)
CHECK_ERR(); CHECK_ERR();
/* next create data object for the signature */ /* next create data object for the signature */
err = gpgme_data_new_from_mem(&sigdata, (char*)sig->rawdata, sig->rawlen, 0); err = gpgme_data_new_from_mem(&sigdata, (char *)sig->rawdata, sig->rawlen, 0);
CHECK_ERR(); CHECK_ERR();
/* here's where the magic happens */ /* here's where the magic happens */

View File

@ -681,7 +681,7 @@ static int test_md5sum(pmtrans_t *trans, const char *filepath,
int ret = _alpm_test_md5sum(filepath, md5sum); int ret = _alpm_test_md5sum(filepath, md5sum);
if(ret == 1) { if(ret == 1) {
int doremove = 0; int doremove = 0;
QUESTION(trans, PM_TRANS_CONV_CORRUPTED_PKG, (char*)filepath, QUESTION(trans, PM_TRANS_CONV_CORRUPTED_PKG, (char *)filepath,
NULL, NULL, &doremove); NULL, NULL, &doremove);
if(doremove) { if(doremove) {
unlink(filepath); unlink(filepath);

View File

@ -573,7 +573,7 @@ char *_alpm_filecache_find(const char* filename)
/* Loop through the cache dirs until we find a matching file */ /* Loop through the cache dirs until we find a matching file */
for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) { for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) {
snprintf(path, PATH_MAX, "%s%s", (char*)alpm_list_getdata(i), snprintf(path, PATH_MAX, "%s%s", (char *)alpm_list_getdata(i),
filename); filename);
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) { if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
retpath = strdup(path); retpath = strdup(path);
@ -753,7 +753,7 @@ int _alpm_archive_fgets(struct archive *a, struct archive_read_buffer *b)
} }
/* zero-copy - this is the entire next block of data. */ /* zero-copy - this is the entire next block of data. */
b->ret = archive_read_data_block(a, (void*)&b->block, b->ret = archive_read_data_block(a, (void *)&b->block,
&b->block_size, &offset); &b->block_size, &offset);
b->block_offset = b->block; b->block_offset = b->block;

View File

@ -224,10 +224,10 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
printf(_("failed.\n")); printf(_("failed.\n"));
break; break;
case PM_TRANS_EVT_SCRIPTLET_INFO: case PM_TRANS_EVT_SCRIPTLET_INFO:
printf("%s", (char*)data1); printf("%s", (char *)data1);
break; break;
case PM_TRANS_EVT_RETRIEVE_START: case PM_TRANS_EVT_RETRIEVE_START:
printf(_(":: Retrieving packages from %s...\n"), (char*)data1); printf(_(":: Retrieving packages from %s...\n"), (char *)data1);
break; break;
case PM_TRANS_EVT_DISKSPACE_START: case PM_TRANS_EVT_DISKSPACE_START:
if(config->noprogressbar) { if(config->noprogressbar) {

View File

@ -84,7 +84,7 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
/* turn depends list into a text list */ /* turn depends list into a text list */
for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) {
pmdepend_t *dep = (pmdepend_t*)alpm_list_getdata(i); pmdepend_t *dep = (pmdepend_t *)alpm_list_getdata(i);
depstrings = alpm_list_add(depstrings, alpm_dep_compute_string(dep)); depstrings = alpm_list_add(depstrings, alpm_dep_compute_string(dep));
} }

View File

@ -842,7 +842,7 @@ static int option_add_cleanmethod(const char *value) {
* @param optionfunc a function pointer to an alpm_option_add_* function * @param optionfunc a function pointer to an alpm_option_add_* function
*/ */
static void setrepeatingoption(char *ptr, const char *option, static void setrepeatingoption(char *ptr, const char *option,
int (*optionfunc)(const char*)) int (*optionfunc)(const char *))
{ {
char *q; char *q;
@ -1482,7 +1482,7 @@ int main(int argc, char *argv[])
printf("DB Path : %s\n", alpm_option_get_dbpath()); printf("DB Path : %s\n", alpm_option_get_dbpath());
printf("Cache Dirs: "); printf("Cache Dirs: ");
for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) { for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) {
printf("%s ", (char*)alpm_list_getdata(i)); printf("%s ", (char *)alpm_list_getdata(i));
} }
printf("\n"); printf("\n");
printf("Lock File : %s\n", alpm_option_get_lockfile()); printf("Lock File : %s\n", alpm_option_get_lockfile());

View File

@ -148,7 +148,7 @@ static int sync_cleancache(int level)
int ret = 0; int ret = 0;
for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) { for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) {
printf(_("Cache directory: %s\n"), (char*)alpm_list_getdata(i)); printf(_("Cache directory: %s\n"), (char *)alpm_list_getdata(i));
} }
if(!config->cleanmethod) { if(!config->cleanmethod) {

View File

@ -267,7 +267,7 @@ static void walk_reverse_deps(pmpkg_t *pkg, int depth)
return; return;
} }
walked = alpm_list_add(walked, (void*)alpm_pkg_get_name(pkg)); walked = alpm_list_add(walked, (void *)alpm_pkg_get_name(pkg));
required_by = alpm_pkg_compute_requiredby(pkg); required_by = alpm_pkg_compute_requiredby(pkg);
for(i = required_by; i; i = alpm_list_next(i)) { for(i = required_by; i; i = alpm_list_next(i)) {
@ -299,7 +299,7 @@ static void walk_deps(pmpkg_t *pkg, int depth)
return; return;
} }
walked = alpm_list_add(walked, (void*)alpm_pkg_get_name(pkg)); walked = alpm_list_add(walked, (void *)alpm_pkg_get_name(pkg));
for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) {
pmdepend_t *depend = alpm_list_getdata(i); pmdepend_t *depend = alpm_list_getdata(i);