Skip to content

Commit 7de7634

Browse files
authored
Enforce clang-format (#265)
1 parent 9708b12 commit 7de7634

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- run: mix deps.get
3434
- run: mix deps.compile
3535
- run: mix format --check-formatted
36+
- run: clang-format --dry-run --Werror c_src/sqlite3_nif.c
3637
- run: mix deps.unlock --check-unused
3738
- run: mix credo --all
3839
- run: mix test_sqlite_version

c_src/sqlite3_nif.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Elixir workaround for . in module names
66
#ifdef STATIC_ERLANG_NIF
7-
#define STATIC_ERLANG_NIF_LIBNAME sqlite3_nif
7+
#define STATIC_ERLANG_NIF_LIBNAME sqlite3_nif
88
#endif
99

1010
#include <erl_nif.h>
@@ -13,8 +13,8 @@
1313
#define MAX_ATOM_LENGTH 255
1414
#define MAX_PATHNAME 512
1515

16-
static ErlNifResourceType* connection_type = NULL;
17-
static ErlNifResourceType* statement_type = NULL;
16+
static ErlNifResourceType* connection_type = NULL;
17+
static ErlNifResourceType* statement_type = NULL;
1818
static sqlite3_mem_methods default_alloc_methods = {0};
1919

2020
typedef struct connection
@@ -1027,10 +1027,10 @@ update_callback(void* arg, int sqlite_operation_type, char const* sqlite_databas
10271027
default:
10281028
return;
10291029
}
1030-
ERL_NIF_TERM rowid = enif_make_int64(msg_env, sqlite_rowid);
1030+
ERL_NIF_TERM rowid = enif_make_int64(msg_env, sqlite_rowid);
10311031
ERL_NIF_TERM database = make_binary(msg_env, sqlite_database, strlen(sqlite_database));
1032-
ERL_NIF_TERM table = make_binary(msg_env, sqlite_table, strlen(sqlite_table));
1033-
ERL_NIF_TERM msg = enif_make_tuple4(msg_env, change_type, database, table, rowid);
1032+
ERL_NIF_TERM table = make_binary(msg_env, sqlite_table, strlen(sqlite_table));
1033+
ERL_NIF_TERM msg = enif_make_tuple4(msg_env, change_type, database, table, rowid);
10341034

10351035
if (!enif_send(NULL, &conn->update_hook_pid, msg_env, msg)) {
10361036
sqlite3_update_hook(conn->db, NULL, NULL);

0 commit comments

Comments
 (0)