From cde125d3ae8b689d58c47f3fd92d985a82f7a541 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 3 Jan 2004 22:11:19 +0000 Subject: [PATCH] Fix unsigned/int warnings in MySQL + Correct Version table name in update... git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@984 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/sql.c | 14 +++++++------- bacula/src/cats/update_mysql_tables.in | 2 +- bacula/src/cats/update_postgresql_tables.in | 2 +- bacula/src/cats/update_sqlite_tables.in | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index c71f92c27f..8df73cc768 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -363,7 +363,7 @@ list_dashes(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx) send(ctx, "+"); for (i = 0; i < sql_num_fields(mdb); i++) { field = sql_fetch_field(mdb); - for (j = 0; j < field->max_length + 2; j++) { + for (j = 0; j < (int)field->max_length + 2; j++) { send(ctx, "-"); } send(ctx, "+"); @@ -401,10 +401,10 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type) max_len = col_len; } } else { - if (IS_NUM(field->type) && field->max_length > 0) { /* fixup for commas */ + if (IS_NUM(field->type) && (int)field->max_length > 0) { /* fixup for commas */ field->max_length += (field->max_length - 1) / 3; } - if (col_len < field->max_length) { + if (col_len < (int)field->max_length) { col_len = field->max_length; } if (col_len < 4 && !IS_NOT_NULL(field->flags)) { @@ -426,7 +426,7 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type) for (i = 0; i < sql_num_fields(mdb); i++) { Dmsg1(50, "list_result looking at field %d\n", i); field = sql_fetch_field(mdb); - bsnprintf(buf, sizeof(buf), " %-*s |", field->max_length, field->name); + bsnprintf(buf, sizeof(buf), " %-*s |", (int)field->max_length, field->name); send(ctx, buf); } send(ctx, "\n"); @@ -439,12 +439,12 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type) for (i = 0; i < sql_num_fields(mdb); i++) { field = sql_fetch_field(mdb); if (row[i] == NULL) { - bsnprintf(buf, sizeof(buf), " %-*s |", field->max_length, "NULL"); + bsnprintf(buf, sizeof(buf), " %-*s |", (int)field->max_length, "NULL"); } else if (IS_NUM(field->type)) { - bsnprintf(buf, sizeof(buf), " %*s |", field->max_length, + bsnprintf(buf, sizeof(buf), " %*s |", (int)field->max_length, add_commas(row[i], ewc)); } else { - bsnprintf(buf, sizeof(buf), " %-*s |", field->max_length, row[i]); + bsnprintf(buf, sizeof(buf), " %-*s |", (int)field->max_length, row[i]); } send(ctx, buf); } diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index 217416ec64..c87955612a 100755 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -53,7 +53,7 @@ CREATE TABLE BaseFiles ( ); DELETE FROM Version; -INSERT INTO VERSION (VersionId) VALUES (7); +INSERT INTO Version (VersionId) VALUES (7); END-OF-DATA then diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index 548faf7b7d..d44e26e937 100755 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -12,7 +12,7 @@ if $bindir/psql $* -f - <