Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Sep 18, 2024
1 parent 1eae49b commit 7444b87
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 45 deletions.
8 changes: 6 additions & 2 deletions flipbip.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ FlipBip* flipbip_app_alloc() {

// Scene additions
app->view_dispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(app->view_dispatcher);

app->scene_manager = scene_manager_alloc(&flipbip_scene_handlers, app);
view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
Expand Down Expand Up @@ -171,7 +170,12 @@ FlipBip* flipbip_app_alloc() {
dialog_ex_set_left_button_text(app->renew_dialog, "No");
dialog_ex_set_right_button_text(app->renew_dialog, "Yes");
dialog_ex_set_header(
app->renew_dialog, "Current wallet\nwill be deleted!\nProceed?", 16, 12, AlignLeft, AlignTop);
app->renew_dialog,
"Current wallet\nwill be deleted!\nProceed?",
16,
12,
AlignLeft,
AlignTop);
view_dispatcher_add_view(
app->view_dispatcher, FlipBipViewRenewConfirm, dialog_ex_get_view(app->renew_dialog));

Expand Down
6 changes: 3 additions & 3 deletions flipbip.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

#define FLIPBIP_VERSION "v1.16"

#define COIN_BTC 0
#define COIN_BTC 0
#define COIN_DOGE 3
#define COIN_ETH 60
#define COIN_ZEC 133
#define COIN_ETH 60
#define COIN_ZEC 133

#define TEXT_BUFFER_SIZE 256

Expand Down
2 changes: 1 addition & 1 deletion helpers/flipbip_custom_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ typedef enum {
FlipBipCustomEventScene1Right,
FlipBipCustomEventScene1Ok,
FlipBipCustomEventScene1Back,
} FlipBipCustomEvent;
} FlipBipCustomEvent;
26 changes: 13 additions & 13 deletions helpers/flipbip_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
#include <rand.h>

// #define FLIPBIP_APP_BASE_FOLDER APP_DATA_PATH("flipbip")
#define FLIPBIP_APP_BASE_FOLDER EXT_PATH("apps_data/flipbip")
#define FLIPBIP_APP_BASE_FOLDER EXT_PATH("apps_data/flipbip")
#define FLIPBIP_APP_BASE_FOLDER_PATH(path) FLIPBIP_APP_BASE_FOLDER "/" path
#define FLIPBIP_DAT_FILE_NAME ".flipbip.dat"
#define FLIPBIP_DAT_FILE_NAME ".flipbip.dat"
// #define FLIPBIP_DAT_FILE_NAME ".flipbip.dat.txt"
#define FLIPBIP_DAT_FILE_NAME_BAK ".flipbip.dat.bak"
#define FLIPBIP_KEY_FILE_NAME ".flipbip.key"
#define FLIPBIP_DAT_FILE_NAME_BAK ".flipbip.dat.bak"
#define FLIPBIP_KEY_FILE_NAME ".flipbip.key"
// #define FLIPBIP_KEY_FILE_NAME ".flipbip.key.txt"
#define FLIPBIP_KEY_FILE_NAME_BAK ".flipbip.key.bak"
#define FLIPBIP_DAT_PATH FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_DAT_FILE_NAME)
#define FLIPBIP_DAT_PATH_BAK FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_DAT_FILE_NAME_BAK)
#define FLIPBIP_KEY_PATH FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_KEY_FILE_NAME)
#define FLIPBIP_KEY_PATH_BAK FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_KEY_FILE_NAME_BAK)
#define FLIPBIP_KEY_FILE_NAME_BAK ".flipbip.key.bak"
#define FLIPBIP_DAT_PATH FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_DAT_FILE_NAME)
#define FLIPBIP_DAT_PATH_BAK FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_DAT_FILE_NAME_BAK)
#define FLIPBIP_KEY_PATH FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_KEY_FILE_NAME)
#define FLIPBIP_KEY_PATH_BAK FLIPBIP_APP_BASE_FOLDER_PATH(FLIPBIP_KEY_FILE_NAME_BAK)

const char* TEXT_QRFILE = "Filetype: QRCode\n"
"Version: 0\n"
"Message: "; // 37 chars + 1 null
#define FILE_HLEN 4
#define FILE_KLEN 256
#define FILE_SLEN 512
#define FILE_MAX_PATH_LEN 48
#define FILE_HLEN 4
#define FILE_KLEN 256
#define FILE_SLEN 512
#define FILE_MAX_PATH_LEN 48
#define FILE_MAX_QRFILE_CONTENT 90
const char* FILE_HSTR = "fb01";
const char* FILE_K1 = "fb0131d5cf688221c109163908ebe51debb46227c6cc8b37641910833222772a"
Expand Down
2 changes: 1 addition & 1 deletion helpers/flipbip_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ void flipbip_cipher(
flipbip_btox(buf, io_len / 2, out);

memzero(buf, 256);
}
}
2 changes: 1 addition & 1 deletion helpers/flipbip_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ void flipbip_cipher(
const unsigned int key_len,
const char* in,
char* out,
const unsigned int io_len);
const unsigned int io_len);
2 changes: 2 additions & 0 deletions lib/crypto/monero/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote
// developers

#include "options.h"

#if USE_MONERO

#ifndef __XMR_BASE58_H__
Expand Down
2 changes: 1 addition & 1 deletion scenes/flipbip_scene_config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ADD_SCENE(flipbip, menu, Menu)
ADD_SCENE(flipbip, scene_1, Scene_1)
ADD_SCENE(flipbip, settings, Settings)
ADD_SCENE(flipbip, settings, Settings)
2 changes: 1 addition & 1 deletion scenes/flipbip_scene_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ bool flipbip_scene_menu_on_event(void* context, SceneManagerEvent event) {
void flipbip_scene_menu_on_exit(void* context) {
FlipBip* app = context;
submenu_reset(app->submenu);
}
}
2 changes: 1 addition & 1 deletion scenes/flipbip_scene_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ bool flipbip_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
void flipbip_scene_scene_1_on_exit(void* context) {
FlipBip* app = context;
UNUSED(app);
}
}
4 changes: 2 additions & 2 deletions scenes/flipbip_scene_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// From: lib/crypto
#include <memzero.h>

#define TEXT_LABEL_ON "ON"
#define TEXT_LABEL_ON "ON"
#define TEXT_LABEL_OFF "OFF"

const char* const bip39_strength_text[3] = {
Expand Down Expand Up @@ -92,4 +92,4 @@ void flipbip_scene_settings_on_exit(void* context) {
FlipBip* app = context;
variable_item_list_set_selected_item(app->variable_item_list, 0);
variable_item_list_reset(app->variable_item_list);
}
}
35 changes: 17 additions & 18 deletions views/flipbip_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@

#define DERIV_PURPOSE 44
#define DERIV_ACCOUNT 0
#define DERIV_CHANGE 0
#define DERIV_CHANGE 0

#define MAX_TEXT_LEN 30 // 30 = max length of text
#define MAX_TEXT_BUF (MAX_TEXT_LEN + 1) // max length of text + null terminator
#define MAX_ADDR_BUF (42 + 1) // 42 = max length of address + null terminator
#define NUM_ADDRS 6

#define PAGE_LOADING 0
#define PAGE_INFO 1
#define PAGE_MNEMONIC 2
#define PAGE_SEED 3
#define PAGE_XPRV_ROOT 4
#define PAGE_XPRV_ACCT 5
#define PAGE_XPUB_ACCT 6
#define PAGE_XPRV_EXTD 7
#define PAGE_XPUB_EXTD 8
#define NUM_ADDRS 6

#define PAGE_LOADING 0
#define PAGE_INFO 1
#define PAGE_MNEMONIC 2
#define PAGE_SEED 3
#define PAGE_XPRV_ROOT 4
#define PAGE_XPRV_ACCT 5
#define PAGE_XPUB_ACCT 6
#define PAGE_XPRV_EXTD 7
#define PAGE_XPUB_EXTD 8
#define PAGE_ADDR_BEGIN 9
#define PAGE_ADDR_END (PAGE_ADDR_BEGIN + NUM_ADDRS - 1)
#define PAGE_ADDR_END (PAGE_ADDR_BEGIN + NUM_ADDRS - 1)

#define TEXT_LOADING "Loading..."
#define TEXT_NEW_WALLET "New wallet"
#define TEXT_DEFAULT_COIN "Coin"
#define TEXT_LOADING "Loading..."
#define TEXT_NEW_WALLET "New wallet"
#define TEXT_DEFAULT_COIN "Coin"
#define TEXT_RECEIVE_ADDRESS "receive address:"
// #define TEXT_DEFAULT_DERIV "m/44'/X'/0'/0"
const char* TEXT_INFO = "-Scroll pages with up/down-"
Expand Down Expand Up @@ -735,8 +735,7 @@ FlipBipScene1* flipbip_scene_1_alloc() {
void flipbip_scene_1_free(FlipBipScene1* instance) {
furi_assert(instance);

with_view_model(
instance->view, FlipBipScene1Model * model, { UNUSED(model); }, true);
with_view_model(instance->view, FlipBipScene1Model * model, { UNUSED(model); }, true);

// free the address node
memzero(s_addr_node, sizeof(HDNode));
Expand Down
2 changes: 1 addition & 1 deletion views/flipbip_scene_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ View* flipbip_scene_1_get_view(FlipBipScene1* flipbip_static);

FlipBipScene1* flipbip_scene_1_alloc();

void flipbip_scene_1_free(FlipBipScene1* flipbip_static);
void flipbip_scene_1_free(FlipBipScene1* flipbip_static);

0 comments on commit 7444b87

Please sign in to comment.