dovecot-2.0: lib-sql: Make driver structs const.
dovecot at dovecot.org
dovecot at dovecot.org
Mon May 3 18:15:25 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/da497a62cf44
changeset: 11253:da497a62cf44
user: Timo Sirainen <tss at iki.fi>
date: Mon May 03 18:15:15 2010 +0300
description:
lib-sql: Make driver structs const.
diffstat:
src/lib-sql/driver-mysql.c | 12 ++++++------
src/lib-sql/driver-pgsql.c | 8 ++++----
src/lib-sql/driver-sqlite.c | 12 ++++++------
3 files changed, 16 insertions(+), 16 deletions(-)
diffs (118 lines):
diff -r e0d02ae9d50f -r da497a62cf44 src/lib-sql/driver-mysql.c
--- a/src/lib-sql/driver-mysql.c Mon May 03 18:03:40 2010 +0300
+++ b/src/lib-sql/driver-mysql.c Mon May 03 18:15:15 2010 +0300
@@ -80,9 +80,9 @@
unsigned int *affected_rows;
};
-extern struct sql_db driver_mysql_db;
-extern struct sql_result driver_mysql_result;
-extern struct sql_result driver_mysql_error_result;
+extern const struct sql_db driver_mysql_db;
+extern const struct sql_result driver_mysql_result;
+extern const struct sql_result driver_mysql_error_result;
static bool driver_mysql_connect(struct mysql_connection *conn)
{
@@ -692,7 +692,7 @@
ctx->tail = list;
}
-struct sql_db driver_mysql_db = {
+const struct sql_db driver_mysql_db = {
"mysql",
.v = {
@@ -714,7 +714,7 @@
}
};
-struct sql_result driver_mysql_result = {
+const struct sql_result driver_mysql_result = {
.v = {
driver_mysql_result_free,
driver_mysql_result_next_row,
@@ -735,7 +735,7 @@
return -1;
}
-struct sql_result driver_mysql_error_result = {
+const struct sql_result driver_mysql_error_result = {
.v = {
driver_mysql_result_free,
driver_mysql_result_error_next_row,
diff -r e0d02ae9d50f -r da497a62cf44 src/lib-sql/driver-pgsql.c
--- a/src/lib-sql/driver-pgsql.c Mon May 03 18:03:40 2010 +0300
+++ b/src/lib-sql/driver-pgsql.c Mon May 03 18:15:15 2010 +0300
@@ -91,8 +91,8 @@
const char *query;
unsigned int *affected_rows;
};
-extern struct sql_db driver_pgsql_db;
-extern struct sql_result driver_pgsql_result;
+extern const struct sql_db driver_pgsql_db;
+extern const struct sql_result driver_pgsql_result;
static void
driver_pgsql_query_full(struct sql_db *db, const char *query,
@@ -1068,7 +1068,7 @@
ctx->tail = list;
}
-struct sql_db driver_pgsql_db = {
+const struct sql_db driver_pgsql_db = {
"pgsql",
.v = {
@@ -1090,7 +1090,7 @@
}
};
-struct sql_result driver_pgsql_result = {
+const struct sql_result driver_pgsql_result = {
.v = {
driver_pgsql_result_free,
driver_pgsql_result_next_row,
diff -r e0d02ae9d50f -r da497a62cf44 src/lib-sql/driver-sqlite.c
--- a/src/lib-sql/driver-sqlite.c Mon May 03 18:03:40 2010 +0300
+++ b/src/lib-sql/driver-sqlite.c Mon May 03 18:15:15 2010 +0300
@@ -33,9 +33,9 @@
unsigned int failed:1;
};
-extern struct sql_db driver_sqlite_db;
-extern struct sql_result driver_sqlite_result;
-extern struct sql_result driver_sqlite_error_result;
+extern const struct sql_db driver_sqlite_db;
+extern const struct sql_result driver_sqlite_result;
+extern const struct sql_result driver_sqlite_error_result;
static int driver_sqlite_connect(struct sql_db *_db)
{
@@ -386,7 +386,7 @@
*affected_rows = sqlite3_changes(db->sqlite);
}
-struct sql_db driver_sqlite_db = {
+const struct sql_db driver_sqlite_db = {
"sqlite",
.v = {
@@ -407,7 +407,7 @@
}
};
-struct sql_result driver_sqlite_result = {
+const struct sql_result driver_sqlite_result = {
.v = {
driver_sqlite_result_free,
driver_sqlite_result_next_row,
@@ -428,7 +428,7 @@
return -1;
}
-struct sql_result driver_sqlite_error_result = {
+const struct sql_result driver_sqlite_error_result = {
.v = {
driver_sqlite_result_free,
driver_sqlite_result_error_next_row,
More information about the dovecot-cvs
mailing list