Fixed the code style in *.c files to two spaces indentation and add a linter named funstx to Fun. (0.39.0)
This commit is contained in:
parent
33001a7ad2
commit
03b2532474
237 changed files with 17550 additions and 13911 deletions
42
src/external/sqlite.c
vendored
42
src/external/sqlite.c
vendored
|
|
@ -16,34 +16,40 @@
|
|||
#include <sqlite3.h>
|
||||
|
||||
typedef struct SqlHandle {
|
||||
int id;
|
||||
sqlite3 *db;
|
||||
struct SqlHandle *next;
|
||||
int id;
|
||||
sqlite3 *db;
|
||||
struct SqlHandle *next;
|
||||
} SqlHandle;
|
||||
|
||||
static SqlHandle *g_sql_handles = NULL;
|
||||
static int g_sql_next_id = 1;
|
||||
|
||||
static SqlHandle* sql_reg_add(sqlite3 *db) {
|
||||
SqlHandle *h = (SqlHandle*)calloc(1, sizeof(SqlHandle));
|
||||
if (!h) return NULL;
|
||||
h->id = g_sql_next_id++;
|
||||
h->db = db;
|
||||
h->next = g_sql_handles;
|
||||
g_sql_handles = h;
|
||||
return h;
|
||||
static SqlHandle *sql_reg_add(sqlite3 *db) {
|
||||
SqlHandle *h = (SqlHandle *)calloc(1, sizeof(SqlHandle));
|
||||
if (!h) return NULL;
|
||||
h->id = g_sql_next_id++;
|
||||
h->db = db;
|
||||
h->next = g_sql_handles;
|
||||
g_sql_handles = h;
|
||||
return h;
|
||||
}
|
||||
|
||||
static SqlHandle* sql_reg_get(int id) {
|
||||
for (SqlHandle *p = g_sql_handles; p; p = p->next) if (p->id == id) return p;
|
||||
return NULL;
|
||||
static SqlHandle *sql_reg_get(int id) {
|
||||
for (SqlHandle *p = g_sql_handles; p; p = p->next)
|
||||
if (p->id == id) return p;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void sql_reg_del(int id) {
|
||||
SqlHandle **pp = &g_sql_handles;
|
||||
while (*pp) {
|
||||
if ((*pp)->id == id) { SqlHandle *d = *pp; *pp = d->next; free(d); return; }
|
||||
pp = &(*pp)->next;
|
||||
SqlHandle **pp = &g_sql_handles;
|
||||
while (*pp) {
|
||||
if ((*pp)->id == id) {
|
||||
SqlHandle *d = *pp;
|
||||
*pp = d->next;
|
||||
free(d);
|
||||
return;
|
||||
}
|
||||
pp = &(*pp)->next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue