[FL-2868] Remove string_push_uint64 (#1832)

* Remove string_pust_uint64
* Oops, furi strings now
* Remove dead code
* Remove unneeded import

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Astra
2022-10-06 21:51:30 +03:00
committed by GitHub
parent dde18cd343
commit eaa3adf98a
4 changed files with 3 additions and 62 deletions

View File

@@ -1,5 +1,4 @@
#include "nfc_supported_card.h"
#include "plantain_parser.h" // For luhn and string_push_uint64
#include <gui/modules/widget.h>
#include <nfc_worker_i.h>
@@ -121,26 +120,15 @@ bool plantain_4k_parser_parse(NfcDeviceData* dev_data) {
FuriString* card_number_str;
card_number_str = furi_string_alloc();
// Should look like "361301047292848684"
// %llu doesn't work for some reason in sprintf, so we use string_push_uint64 instead
string_push_uint64(card_number, card_number_str);
furi_string_printf(card_number_str, "%llu", card_number);
// Add suffix with luhn checksum (1 digit) to the card number string
FuriString* card_number_suffix;
card_number_suffix = furi_string_alloc();
// The number to calculate the checksum on doesn't fit into uint64_t, idk
//uint8_t luhn_checksum = plantain_calculate_luhn(card_number);
// // Convert luhn checksum to string
// FuriString* luhn_checksum_str;
// luhn_checksum_str = furi_string_alloc();
// string_push_uint64(luhn_checksum, luhn_checksum_str);
furi_string_cat_printf(card_number_suffix, "-");
// FURI_LOG_D("plant4k", "Card checksum: %d", luhn_checksum);
furi_string_cat_printf(card_number_str, furi_string_get_cstr(card_number_suffix));
// Free all not needed strings
furi_string_free(card_number_suffix);
// furi_string_free(luhn_checksum_str);
furi_string_printf(
dev_data->parsed_data,