[sr-dev] git:master:202f4b1a: lib/srdb1: cast types to get rid of compile warnings

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 1 08:35:00 CEST 2018


Module: kamailio
Branch: master
Commit: 202f4b1aeca9e8d40b8791d6de3205fa643ff9a8
URL: https://github.com/kamailio/kamailio/commit/202f4b1aeca9e8d40b8791d6de3205fa643ff9a8

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-01T08:31:29+02:00

lib/srdb1: cast types to get rid of compile warnings

---

Modified: src/lib/srdb1/db.c

---

Diff:  https://github.com/kamailio/kamailio/commit/202f4b1aeca9e8d40b8791d6de3205fa643ff9a8.diff
Patch: https://github.com/kamailio/kamailio/commit/202f4b1aeca9e8d40b8791d6de3205fa643ff9a8.patch

---

diff --git a/src/lib/srdb1/db.c b/src/lib/srdb1/db.c
index 3e36628330..4a250bc819 100644
--- a/src/lib/srdb1/db.c
+++ b/src/lib/srdb1/db.c
@@ -445,14 +445,17 @@ int db_table_version(const db_func_t* dbf, db1_con_t* connection, const str* tab
  * Check the table version
  * 0 means ok, -1 means an error occurred
  */
-int db_check_table_version(db_func_t* dbf, db1_con_t* dbh, const str* table, const unsigned int version)
+int db_check_table_version(db_func_t* dbf, db1_con_t* dbh, const str* table,
+		const unsigned int version)
 {
 	int ver = db_table_version(dbf, dbh, table);
 	if (ver < 0) {
 		LM_ERR("querying version for table %.*s\n", table->len, table->s);
 		return -1;
-	} else if (ver != version) {
-		LM_ERR("invalid version %d for table %.*s found, expected %d (check table structure and table \"version\")\n", ver, table->len, table->s, version);
+	} else if (ver != (int)version) {
+		LM_ERR("invalid version %d for table %.*s found, expected %u"
+				" (check table structure and table \"version\")\n",
+				ver, table->len, table->s, version);
 		return -1;
 	}
 	return 0;




More information about the sr-dev mailing list