diff --git a/src/file.js.c b/src/file.js.c index a1f756cb..ded27164 100644 --- a/src/file.js.c +++ b/src/file.js.c @@ -33,8 +33,8 @@ typedef struct file_stat_t { typedef struct fs_req_t { uv_fs_t fs; - uv_file file; size_t size; + uv_file file; char buffer[]; } fs_req_t; diff --git a/src/ssb.c b/src/ssb.c index 367800dc..25cc59dd 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -102,11 +102,11 @@ typedef struct _tf_ssb_debug_close_t typedef struct _tf_ssb_request_t { - int32_t request_number; tf_ssb_rpc_callback_t* callback; tf_ssb_callback_cleanup_t* cleanup; void* user_data; tf_ssb_connection_t* dependent_connection; + int32_t request_number; } tf_ssb_request_t; typedef struct _tf_ssb_broadcast_t @@ -252,8 +252,8 @@ typedef struct _tf_ssb_t typedef struct _tf_ssb_connection_message_request_t { - char author[k_id_base64_len]; int32_t request_number; + char author[k_id_base64_len]; bool keys; } tf_ssb_connection_message_request_t; @@ -3553,12 +3553,11 @@ tf_ssb_blob_wants_t* tf_ssb_connection_get_blob_wants_state(tf_ssb_connection_t* typedef struct _store_t { tf_ssb_t* ssb; + tf_ssb_verify_strip_store_callback_t* callback; + void* user_data; bool verified; bool stored; char id[crypto_hash_sha256_BYTES * 2 + 1]; - - tf_ssb_verify_strip_store_callback_t* callback; - void* user_data; } store_t; static void _tf_ssb_verify_strip_and_store_finish(store_t* store) diff --git a/src/ssb.db.h b/src/ssb.db.h index 64dda5fd..1505e028 100644 --- a/src/ssb.db.h +++ b/src/ssb.db.h @@ -50,11 +50,11 @@ JSValue tf_ssb_format_message( typedef struct _tf_ssb_following_t { - char id[k_id_base64_len]; int following_count; int blocking_count; int followed_by_count; int blocked_by_count; + char id[k_id_base64_len]; } tf_ssb_following_t; const char** tf_ssb_db_following_deep_ids(tf_ssb_t* ssb, const char** ids, int count, int depth); diff --git a/src/ssb.h b/src/ssb.h index 59cc6965..963cd01e 100644 --- a/src/ssb.h +++ b/src/ssb.h @@ -67,15 +67,15 @@ typedef struct _tf_ssb_stats_t typedef struct _tf_ssb_blob_wants_t { int32_t request_number; - char last_id[k_blob_id_len]; int wants_sent; + char last_id[k_blob_id_len]; } tf_ssb_blob_wants_t; typedef struct _tf_ssb_store_queue_t { - bool running; void* head; void* tail; + bool running; } tf_ssb_store_queue_t; tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, const char* db_path); diff --git a/src/ssb.js.c b/src/ssb.js.c index 4f4ab00e..661b6f3a 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -599,21 +599,21 @@ static JSValue _tf_ssb_closeConnection(JSContext* context, JSValueConst this_val typedef struct _sql_work_t { + tf_ssb_t* ssb; + sqlite3* db; + char* error; + const char* query; + uint8_t* binds; + uint8_t* rows; + size_t binds_count; + size_t rows_count; uv_work_t request; uv_async_t async; uv_timer_t timeout; - tf_ssb_t* ssb; - sqlite3* db; uv_mutex_t lock; - const char* query; - uint8_t* binds; - size_t binds_count; - uint8_t* rows; - size_t rows_count; JSValue callback; JSValue promise[2]; int result; - char* error; } sql_work_t; static void _tf_ssb_sql_append(uint8_t** rows, size_t* rows_count, const void* data, size_t size) diff --git a/src/ssb.tests.c b/src/ssb.tests.c index 72a67546..becc1d57 100644 --- a/src/ssb.tests.c +++ b/src/ssb.tests.c @@ -711,9 +711,9 @@ typedef struct _close_t { tf_ssb_t* ssb; tf_ssb_connection_t* connection; - char id[k_id_base64_len]; - int32_t request_number; uv_timer_t timer; + int32_t request_number; + char id[k_id_base64_len]; } close_t; static void _timer_close(uv_handle_t* handle) diff --git a/src/task.c b/src/task.c index 59dc84a3..b7430d1f 100644 --- a/src/task.c +++ b/src/task.c @@ -71,10 +71,10 @@ typedef struct _promise_t typedef struct _promise_stack_t { uint32_t hash; + int count; const char* stack; void* cstack[32]; int cstack_count; - int count; } promise_stack_t; typedef struct _hitch_t