minor stylistic updates.

This commit is contained in:
Keith Bostic 2012-02-16 19:24:18 -05:00
parent 212a735339
commit c89d6deaea

View file

@ -132,8 +132,8 @@ static ERL_NIF_TERM wterl_conn_open(ErlNifEnv* env, int argc, const ERL_NIF_TERM
int rc = wiredtiger_open(homedir, NULL, config, &conn); int rc = wiredtiger_open(homedir, NULL, config, &conn);
if (rc == 0) if (rc == 0)
{ {
wterl_conn_handle* conn_handle = enif_alloc_resource(wterl_conn_RESOURCE, wterl_conn_handle* conn_handle =
sizeof(wterl_conn_handle)); enif_alloc_resource(wterl_conn_RESOURCE, sizeof(wterl_conn_handle));
conn_handle->conn = conn; conn_handle->conn = conn;
ERL_NIF_TERM result = enif_make_resource(env, conn_handle); ERL_NIF_TERM result = enif_make_resource(env, conn_handle);
enif_release_resource(conn_handle); enif_release_resource(conn_handle);
@ -179,8 +179,8 @@ static inline ERL_NIF_TERM wterl_session_worker(ErlNifEnv* env, int argc, const
if (enif_get_resource(env, argv[0], wterl_session_RESOURCE, (void**)&session_handle)) if (enif_get_resource(env, argv[0], wterl_session_RESOURCE, (void**)&session_handle))
{ {
WT_SESSION* session = session_handle->session; WT_SESSION* session = session_handle->session;
Uri uri;
Config config; Config config;
Uri uri;
if (enif_get_string(env, argv[1], uri, sizeof uri, ERL_NIF_LATIN1) && if (enif_get_string(env, argv[1], uri, sizeof uri, ERL_NIF_LATIN1) &&
enif_get_string(env, argv[2], config, sizeof config, ERL_NIF_LATIN1)) enif_get_string(env, argv[2], config, sizeof config, ERL_NIF_LATIN1))
{ {
@ -234,8 +234,8 @@ static ERL_NIF_TERM wterl_session_open(ErlNifEnv* env, int argc, const ERL_NIF_T
int rc = conn->open_session(conn, NULL, NULL, &session); int rc = conn->open_session(conn, NULL, NULL, &session);
if (rc == 0) if (rc == 0)
{ {
wterl_session_handle* session_handle = enif_alloc_resource(wterl_session_RESOURCE, wterl_session_handle* session_handle =
sizeof(wterl_session_handle)); enif_alloc_resource(wterl_session_RESOURCE, sizeof(wterl_session_handle));
session_handle->session = session; session_handle->session = session;
ERL_NIF_TERM result = enif_make_resource(env, session_handle); ERL_NIF_TERM result = enif_make_resource(env, session_handle);
enif_keep_resource(conn_handle); enif_keep_resource(conn_handle);
@ -457,8 +457,8 @@ static ERL_NIF_TERM wterl_cursor_open(ErlNifEnv* env, int argc, const ERL_NIF_TE
int rc = session->open_cursor(session, uri, NULL, "overwrite,raw", &cursor); int rc = session->open_cursor(session, uri, NULL, "overwrite,raw", &cursor);
if (rc == 0) if (rc == 0)
{ {
wterl_cursor_handle* cursor_handle = enif_alloc_resource(wterl_cursor_RESOURCE, wterl_cursor_handle* cursor_handle =
sizeof(wterl_cursor_handle)); enif_alloc_resource(wterl_cursor_RESOURCE, sizeof(wterl_cursor_handle));
cursor_handle->cursor = cursor; cursor_handle->cursor = cursor;
ERL_NIF_TERM result = enif_make_resource(env, cursor_handle); ERL_NIF_TERM result = enif_make_resource(env, cursor_handle);
enif_keep_resource(session_handle); enif_keep_resource(session_handle);