socsvn commit: r254442 - in soc2013/mattbw/backend: . actions query
mattbw at FreeBSD.org
mattbw at FreeBSD.org
Tue Jul 9 05:06:47 UTC 2013
Author: mattbw
Date: Tue Jul 9 05:06:46 2013
New Revision: 254442
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=254442
Log:
some silencing of splint warnings
Modified:
soc2013/mattbw/backend/actions/get_details.c
soc2013/mattbw/backend/actions/get_repo_list.c
soc2013/mattbw/backend/actions/install_files.c
soc2013/mattbw/backend/actions/install_packages.c
soc2013/mattbw/backend/pkgutils.c
soc2013/mattbw/backend/query/core.c
Modified: soc2013/mattbw/backend/actions/get_details.c
==============================================================================
--- soc2013/mattbw/backend/actions/get_details.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/actions/get_details.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -42,7 +42,7 @@
bool success;
success = query_match_id_to_emitter(backend, LOAD_FLAGS, emit);
- pk_backend_finished(backend);
+ (void)pk_backend_finished(backend);
return success ? TRUE : FALSE;
}
Modified: soc2013/mattbw/backend/actions/get_repo_list.c
==============================================================================
--- soc2013/mattbw/backend/actions/get_repo_list.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/actions/get_repo_list.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -38,7 +38,7 @@
repo = NULL;
while (pkg_repos(&repo) == EPKG_OK)
- pk_backend_repo_detail(backend,
+ (void)pk_backend_repo_detail(backend,
pkg_repo_ident(repo),
pkg_repo_name(repo),
pkg_repo_enabled(repo));
Modified: soc2013/mattbw/backend/actions/install_files.c
==============================================================================
--- soc2013/mattbw/backend/actions/install_files.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/actions/install_files.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -75,7 +75,7 @@
(void)pk_backend_set_status(backend, PK_STATUS_ENUM_RUNNING);
if (pkg_open(&pkg, path, keys, PKG_FLAG_NONE) != EPKG_OK) {
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_CORRUPT,
"could not open file");
goto cleanup;
@@ -92,7 +92,7 @@
(void)pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
if (pkg_add(db, path, PKG_FLAG_NONE, keys) != EPKG_OK) {
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
"could not install file");
goto cleanup;
@@ -122,11 +122,11 @@
paths = pk_backend_get_strv(backend, "full_paths");
if (paths == NULL)
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"could not get path vector");
else if (*paths == NULL)
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"path vector is empty");
else {
@@ -138,6 +138,6 @@
success = do_file(*p, backend, simulate);
}
- pk_backend_finished(backend);
+ (void)pk_backend_finished(backend);
return success;
}
Modified: soc2013/mattbw/backend/actions/install_packages.c
==============================================================================
--- soc2013/mattbw/backend/actions/install_packages.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/actions/install_packages.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -24,7 +24,7 @@
#include "../pkgutils.h" /* pkgutils_... */
#include "../query.h" /* query_... */
-#include "../utils.h" /* INTENTIONALLY_IGNORE */
+#include "../utils.h" /* INTENTIONALLY_IGNORE, ERR */
#include "../actions.h" /* install_packages_thread prototype */
@@ -83,9 +83,9 @@
pkg_event_register(install_event_cb, backend);
- pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
+ (void)pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
if (pkg_jobs_apply(jobs) != EPKG_OK) {
- pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
"job failed");
goto cleanup;
@@ -115,7 +115,7 @@
if (solve_job(q, jobs) == false)
goto cleanup;
- pk_backend_set_status(backend, PK_STATUS_ENUM_RUNNING);
+ (void)pk_backend_set_status(backend, PK_STATUS_ENUM_RUNNING);
pkg = NULL;
while (pkg_jobs(jobs, &pkg) == EPKG_OK)
pkgutils_emit(pkg,
@@ -141,13 +141,13 @@
success = false;
backend = query_backend(q);
- pk_backend_set_status(backend, PK_STATUS_ENUM_DEP_RESOLVE);
+ (void)pk_backend_set_status(backend, PK_STATUS_ENUM_DEP_RESOLVE);
if (pkg_jobs_solve(jobs) != EPKG_OK)
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_DEP_RESOLUTION_FAILED,
"could not solve the job");
else if (pkg_jobs_count(jobs) == 0)
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"job contains no packages");
else
@@ -204,18 +204,18 @@
* throw an error code here
*/
#if 0
- pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
event->e_pkg_error.msg);
#endif
break;
case PKG_EVENT_FILE_MISMATCH:
- pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_CORRUPT,
pkg_file_path(event->e_file_mismatch.file));
break;
case PKG_EVENT_NOT_FOUND:
- pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED,
event->e_not_found.pkg_name);
default:
Modified: soc2013/mattbw/backend/pkgutils.c
==============================================================================
--- soc2013/mattbw/backend/pkgutils.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/pkgutils.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -108,10 +108,10 @@
pkgutils_pkg_to_id(struct pkg *pkg)
{
gchar *id;
- const gchar **id_bits;
+ const char **id_bits;
/* Make sure the initial string vector's pointers are all NULL */
- id_bits = calloc(4, sizeof(const gchar *));
+ id_bits = calloc(4, sizeof(const char *));
/*
* This is split through an intermediate function so the same code
@@ -131,7 +131,7 @@
* they should be NULL).
*/
gchar *
-pkgutils_pkg_to_id_through(struct pkg *pkg, const gchar **strv)
+pkgutils_pkg_to_id_through(struct pkg *pkg, const char **strv)
{
pkg_get(pkg,
@@ -160,7 +160,7 @@
pkg_get(pkg, PKG_COMMENT, &comment);
id = pkgutils_pkg_to_id(pkg);
- pk_backend_package(backend, info, id, comment);
+ (void)pk_backend_package(backend, info, id, comment);
g_free(id);
}
Modified: soc2013/mattbw/backend/query/core.c
==============================================================================
--- soc2013/mattbw/backend/query/core.c Tue Jul 9 04:51:38 2013 (r254441)
+++ soc2013/mattbw/backend/query/core.c Tue Jul 9 05:06:46 2013 (r254442)
@@ -87,19 +87,19 @@
backend = query_backend(q);
if (pkg_jobs_new(&jobs, q->t->data.job.type, q->db) != EPKG_OK) {
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"could not init pkg_jobs");
goto cleanup;
}
if (jobs_repo_from_query(jobs, q) != EPKG_OK) {
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_REPO_NOT_FOUND,
"could not set repo");
goto cleanup;
}
if (jobs_add_pkg(jobs, MATCH_EXACT, pkg) != EPKG_OK) {
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"could not add to job");
goto cleanup;
@@ -169,7 +169,7 @@
pkgdb_it_free(it);
if (pkg == NULL)
- pk_backend_error_code(q->backend,
+ ERR(q->backend,
PK_ERROR_ENUM_PACKAGE_NOT_FOUND,
"package not found");
else {
@@ -329,9 +329,9 @@
bool matches;
int i;
gchar *match_id;
- const gchar **pkg_id_bits;
+ const char **pkg_id_bits;
- pkg_id_bits = g_new0(const gchar *, 4);
+ pkg_id_bits = calloc(4, sizeof(const char *));
match_id = pkgutils_pkg_to_id_through(pkg, pkg_id_bits);
@@ -353,7 +353,7 @@
pkg_id_bits[i]);
}
- g_free(pkg_id_bits);
+ free(pkg_id_bits);
if (matches == false) {
g_free(match_id);
@@ -407,7 +407,7 @@
static struct pkg *
match_iterator(struct pkgdb_it *it, struct query *q, gchar **match_id_p)
{
- int load_flags;
+ unsigned int load_flags;
gchar *match_id;
struct pkg *pkg;
@@ -447,7 +447,7 @@
* checking against it so it doesn't matter that the version
* might be in the name column etc.
*/
- id_strv = g_new0(gchar *, 5);
+ id_strv = g_malloc0_n(5, (gsize)sizeof(gchar *));
id_strv[PK_PACKAGE_ID_NAME] = g_strdup(s->data.single);
id_strv[PK_PACKAGE_ID_VERSION] = g_strdup("");
@@ -456,11 +456,11 @@
} else if (s->type == QUERY_SINGLE_ID) {
id_strv = pk_package_id_split(s->data.single);
if (id_strv == NULL)
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_PACKAGE_ID_INVALID,
"invalid package id");
} else
- (void)pk_backend_error_code(backend,
+ ERR(backend,
PK_ERROR_ENUM_INTERNAL_ERROR,
"init_unpack_source given silly source type");
More information about the svn-soc-all
mailing list