make style

This commit is contained in:
Anže Jenšterle 2021-02-09 16:56:55 +01:00
parent e22cb088c1
commit cd36770c5e
No known key found for this signature in database
GPG key ID: 56821505069EBF5F
22 changed files with 99 additions and 99 deletions

View file

@ -52,8 +52,8 @@ static void fill_buff(uint8_t bit) {
static void construct_EM410x_emul(uint64_t id) {
int i, j;
int binary[4] = {0,0,0,0};
int parity[4] = {0,0,0,0};
int binary[4] = {0, 0, 0, 0};
int parity[4] = {0, 0, 0, 0};
buflen = 0;
for (i = 0; i < 9; i++)

View file

@ -100,8 +100,8 @@ static void fill_buff(uint8_t bit) {
static void construct_EM410x_emul(uint64_t id) {
int i, j;
int binary[4] = {0,0,0,0};
int parity[4] = {0,0,0,0};
int binary[4] = {0, 0, 0, 0};
int parity[4] = {0, 0, 0, 0};
buflen = 0;
for (i = 0; i < 9; i++)

View file

@ -67,8 +67,8 @@ static void fill_buff(uint8_t bit) {
static void construct_EM410x_emul(uint64_t id) {
int i, j;
int binary[4] = {0,0,0,0};
int parity[4] = {0,0,0,0};
int binary[4] = {0, 0, 0, 0};
int parity[4] = {0, 0, 0, 0};
buflen = 0;
for (i = 0; i < 9; i++)

View file

@ -1885,7 +1885,7 @@ void iClass_WriteBlock(uint8_t *msg) {
res = false;
switch_off();
if (payload->req.send_reply)
reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_ETEAROFF, (uint8_t*)&res, sizeof(uint8_t));
reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_ETEAROFF, (uint8_t *)&res, sizeof(uint8_t));
return;
} else {
@ -1927,7 +1927,7 @@ out:
switch_off();
if (payload->req.send_reply)
reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_SUCCESS, (uint8_t*)&res, sizeof(uint8_t));
reply_ng(CMD_HF_ICLASS_WRITEBL, PM3_SUCCESS, (uint8_t *)&res, sizeof(uint8_t));
}
void iClass_Restore(iclass_restore_req_t *msg) {

View file

@ -239,11 +239,11 @@ int CmdLFCommandRead(const char *Cmd) {
int cmd_len = 128;
char cmd[128] = {0};
CLIGetStrWithReturn(ctx, 2, (uint8_t*)cmd, &cmd_len);
CLIGetStrWithReturn(ctx, 2, (uint8_t *)cmd, &cmd_len);
int extra_arg_len = 250;
char extra_arg[250] = {0};
CLIGetStrWithReturn(ctx, 3, (uint8_t*)extra_arg, &extra_arg_len);
CLIGetStrWithReturn(ctx, 3, (uint8_t *)extra_arg, &extra_arg_len);
uint16_t period_1 = arg_get_u32_def(ctx, 4, 0);
uint16_t period_0 = arg_get_u32_def(ctx, 5, 0);
@ -276,7 +276,7 @@ int CmdLFCommandRead(const char *Cmd) {
// extra symbol definition
uint8_t index_extra = 0;
int i = 0;
for (; i < extra_arg_len; ) {
for (; i < extra_arg_len;) {
if (index_extra < LF_CMDREAD_MAX_EXTRA_SYMBOLS - 1) {
payload.symbol_extra[index_extra] = extra_arg[i];
@ -516,7 +516,7 @@ int CmdLFConfig(const char *Cmd) {
}
if (use_125 + use_134 > 1) {
PrintAndLogEx(ERR,"use only one of 125 or 134 params");
PrintAndLogEx(ERR, "use only one of 125 or 134 params");
return PM3_EINVARG;
}
@ -555,14 +555,14 @@ int CmdLFConfig(const char *Cmd) {
config.bits_per_sample = 8;
}
if ( dec > -1 ) {
if (dec > -1) {
// decimation is limited to 8
config.decimation = (dec & 0x0F);
if (config.decimation > 8)
config.decimation = 8;
}
if ( div > -1 ) {
if (div > -1) {
config.divisor = div;
if (config.divisor < 19) {
PrintAndLogEx(ERR, "divisor must be between 19 and 255");
@ -570,7 +570,7 @@ int CmdLFConfig(const char *Cmd) {
}
}
if (freq > -1 ) {
if (freq > -1) {
config.divisor = LF_FREQ2DIV(freq);
if (config.divisor < 19) {
PrintAndLogEx(ERR, "freq must be between 47 and 600");
@ -862,7 +862,7 @@ int CmdLFfskSim(const char *Cmd) {
int raw_len = 64;
char raw[64] = {0};
CLIGetStrWithReturn(ctx, 5, (uint8_t*)raw, &raw_len);
CLIGetStrWithReturn(ctx, 5, (uint8_t *)raw, &raw_len);
bool verbose = arg_get_lit(ctx, 6);
CLIParserFree(ctx);
@ -972,7 +972,7 @@ int CmdLFaskSim(const char *Cmd) {
int raw_len = 64;
char raw[64] = {0};
CLIGetStrWithReturn(ctx, 7, (uint8_t*)raw, &raw_len);
CLIGetStrWithReturn(ctx, 7, (uint8_t *)raw, &raw_len);
bool verbose = arg_get_lit(ctx, 8);
CLIParserFree(ctx);
@ -1082,7 +1082,7 @@ int CmdLFpskSim(const char *Cmd) {
uint8_t carrier = arg_get_u32_def(ctx, 6, 2);
int raw_len = 64;
char raw[64] = {0};
CLIGetStrWithReturn(ctx, 7, (uint8_t*)raw, &raw_len);
CLIGetStrWithReturn(ctx, 7, (uint8_t *)raw, &raw_len);
bool verbose = arg_get_lit(ctx, 8);
CLIParserFree(ctx);
@ -1120,7 +1120,7 @@ int CmdLFpskSim(const char *Cmd) {
int res = 0;
if (clk == 0) {
res = GetPskClock("", verbose);
if ( res < 1) {
if (res < 1) {
clk = 32;
} else {
clk = (uint8_t)res;
@ -1129,7 +1129,7 @@ int CmdLFpskSim(const char *Cmd) {
if (carrier == 0) {
res = GetPskCarrier(verbose);
if (res < 1 ) {
if (res < 1) {
carrier = 2;
} else {
carrier = (uint8_t)res;

View file

@ -1719,7 +1719,7 @@ static int CmdT55xxDangerousRaw(const char *Cmd) {
return PM3_EINVARG;
}
int bs_len = binstring2binarray(ng.data, (char*)bin, bin_len);
int bs_len = binstring2binarray(ng.data, (char *)bin, bin_len);
if (bs_len == 0) {
return PM3_EINVARG;
}

View file

@ -811,7 +811,7 @@ void binarraytobinstring(char *target, char *source, int length) {
*target = '\0';
}
int binstring2binarray(uint8_t* target, char *source, int length) {
int binstring2binarray(uint8_t *target, char *source, int length) {
int count = 0;
char *start = source;
while (length--) {

View file

@ -83,7 +83,7 @@ int hextobinarray(char *target, char *source);
int hextobinstring(char *target, char *source);
int binarraytohex(char *target, const size_t targetlen, char *source, size_t srclen);
void binarraytobinstring(char *target, char *source, int length);
int binstring2binarray(uint8_t* target, char *source, int length);
int binstring2binarray(uint8_t *target, char *source, int length);
uint8_t GetParity(uint8_t *bits, uint8_t type, int length);
void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length);

View file

@ -121,7 +121,7 @@ bool set_nonlinear_field(wiegand_message_t *data, uint64_t value, uint8_t numBit
}
static uint8_t get_length_from_header(wiegand_message_t *data) {
/**
/**
* detect if message has "preamble" / "sentinel bit"
*
*/

View file

@ -534,13 +534,13 @@ Check column "offline" for their availability.
|------- |------- |-----------
|`lf help `|Y |`This help`
|`lf config `|N |`Get/Set config for LF sampling, bit/sample, decimation, frequency`
|`lf cmdread `|N |`Modulate LF reader field to send command before read (all periods in microseconds)`
|`lf cmdread `|N |`Modulate LF reader field to send command before read`
|`lf read `|N |`Read LF tag`
|`lf search `|Y |`Read and Search for valid known tag (in offline mode it you can load first then search)`
|`lf sim `|N |`Simulate LF tag from buffer with optional GAP (in microseconds)`
|`lf simask `|N |`Simulate LF ASK tag from demodbuffer or input`
|`lf simfsk `|N |`Simulate LF FSK tag from demodbuffer or input`
|`lf simpsk `|N |`Simulate LF PSK tag from demodbuffer or input`
|`lf search `|Y |`Read and Search for valid known tag`
|`lf sim `|N |`Simulate LF tag from buffer`
|`lf simask `|N |`Simulate ASK tag`
|`lf simfsk `|N |`Simulate FSK tag`
|`lf simpsk `|N |`Simulate PSK tag`
|`lf simbidir `|N |`Simulate LF tag (with bidirectional data transmission between reader and tag)`
|`lf sniff `|N |`Sniff LF traffic between reader and tag`
|`lf tune `|N |`Continuously measure LF antenna tuning`

View file

@ -254,7 +254,7 @@ int discoverDevices(unsigned int profile_selected, uint32_t device_types_selecte
if (verbose) printf("%14s: %s\n", "Device Type", (device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : (device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : "Other");
if ((*cd_ctx)[platform_idx].selected == false) (*cd_ctx)[platform_idx].device[device_idx].selected = false;
if ((*cd_ctx)[platform_idx].selected == false)(*cd_ctx)[platform_idx].device[device_idx].selected = false;
else (*cd_ctx)[platform_idx].device[device_idx].selected = plat_dev_enabled(global_device_id, dev_sel, dev_cnt, (unsigned int) device_type, device_types_selected);
global_device_id++;
if ((*cd_ctx)[platform_idx].device[device_idx].selected)(*selected_devices_cnt)++;