diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:00:29 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:02:07 +0300 |
commit | 41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd (patch) | |
tree | b29207e44aa8dcc10ef2deb51ac1514fb934c420 /src/dblayer.c | |
parent | a6b2b4b2a4095d2f95419df986378e54432c2d71 (diff) | |
download | ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.gz ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.bz2 ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.zip |
Confort to pedantic std-c99 and update readme
Diffstat (limited to 'src/dblayer.c')
-rw-r--r-- | src/dblayer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dblayer.c b/src/dblayer.c index 8703c1e..acdf339 100644 --- a/src/dblayer.c +++ b/src/dblayer.c @@ -41,7 +41,7 @@ int check_initialized_DB(sqlite3 *db) { dbh_form_query_select_all_tables(sql); sqlite3_stmt *stmt; - sqlite3_prepare_v2(db, sql, strlen(sql), &stmt, NULL); + sqlite3_prepare_v2(db, sql, (int)strlen(sql), &stmt, NULL); int program_table_ok, config_table_ok, rel_table_ok = 0; while (sqlite3_step(stmt) != SQLITE_DONE) { @@ -135,7 +135,7 @@ int get_next_valid_id_from_table(DB *db, const char* tableName) { if (rc != SQLITE_OK) { return -1; } - sqlite3_bind_text(stmt, 1, tableName, strlen(tableName), 0); + sqlite3_bind_text(stmt, 1, tableName, (int)strlen(tableName), 0); int id = 0; while (sqlite3_step(stmt) == SQLITE_ROW) { @@ -168,7 +168,7 @@ int insert_to_program_table(DB *db, const char *name) { return -1; } sqlite3_bind_int(stmt, 1, id); - sqlite3_bind_text(stmt, 2, name, strlen(name), 0); + sqlite3_bind_text(stmt, 2, name, (int)strlen(name), 0); if (sqlite3_step(stmt) != SQLITE_DONE) { PRINT_ERR("while excecuting insert to program sql."); db->error = SQL_ERR_SQLITE; @@ -196,7 +196,7 @@ int insert_to_config_table(DB *db, const char *path, const int secret, const int return -1; } sqlite3_bind_int(stmt, 1, id); - sqlite3_bind_text(stmt, 2, path, strlen(path), 0); + sqlite3_bind_text(stmt, 2, path, (int)strlen(path), 0); sqlite3_bind_int(stmt, 3, secret); sqlite3_bind_int(stmt, 4, prime); if (sqlite3_step(stmt) != SQLITE_DONE) { @@ -245,7 +245,7 @@ int get_program_id(DB *db, const char* name) { PRINT_ERR("Error while preparing get_program_id sql."); return -2; } - sqlite3_bind_text(stmt, 1, name, strlen(name), 0); + sqlite3_bind_text(stmt, 1, name, (int)strlen(name), 0); int id = -1; while (sqlite3_step(stmt) == SQLITE_ROW) { id = sqlite3_column_int(stmt, 0); @@ -274,7 +274,7 @@ int get_config_id(DB *db, const char* path) { PRINT_ERR("while preparing get_config_id sql."); return -2; } - sqlite3_bind_text(stmt, 1, path, strlen(path), 0); + sqlite3_bind_text(stmt, 1, path, (int)strlen(path), 0); int id = -1; while (sqlite3_step(stmt) == SQLITE_ROW) { id = sqlite3_column_int(stmt, 0); |