Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flash-hmcfgusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int parse_hmcfgusb(uint8_t *buf, int buf_len, void *data)
return 1;
}

void flash_hmcfgusb_syntax(char *prog)
void flash_hmcfgusb_syntax(const char *prog)
{
fprintf(stderr, "Syntax: %s [options] filename.enc\n\n", prog);
fprintf(stderr, "Possible options:\n");
Expand Down
2 changes: 1 addition & 1 deletion flash-hmmoduart.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int parse_hmuartlgw(enum hmuartlgw_dst __attribute__((unused)) dst, uint8
return 1;
}

void flash_hmmoduart_syntax(char *prog)
void flash_hmmoduart_syntax(const char *prog)
{
fprintf(stderr, "Syntax: %s [options] -U /dev/ttyAMA0 filename.eq3\n\n", prog);
fprintf(stderr, "Mandatory parameter:\n");
Expand Down
10 changes: 5 additions & 5 deletions flash-ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ static int switch_speed(struct hm_dev *dev, struct recv_data *rdata, uint8_t spe
return 1;
}

void flash_ota_syntax(char *prog)
void flash_ota_syntax(const char *prog)
{
fprintf(stderr, "Syntax: %s parameters options\n\n", prog);
fprintf(stderr, "Mandatory parameters:\n");
Expand Down Expand Up @@ -1214,7 +1214,7 @@ int main(int argc, char **argv)
if (debug) {
printf("\n");
} else {
printf(": %04u/%04u %c", 0u, (unsigned int)fw->fw_blocks, twiddlie[0]);
printf(": %04d/%04d %c", 0, fw->fw_blocks, twiddlie[0]);
fflush(stdout);
}

Expand Down Expand Up @@ -1272,15 +1272,15 @@ int main(int argc, char **argv)
fprintf(stderr, "\nToo many errors, giving up!\n");
exit(EXIT_FAILURE);
} else {
printf("Flashing %d blocks: %04u/%04u %c", fw->fw_blocks, (unsigned int)(block + 1), (unsigned int)fw->fw_blocks, twiddlie[msgnum % sizeof(twiddlie)]);
printf("Flashing %d blocks: %04d/%04d %c", fw->fw_blocks, block + 1, fw->fw_blocks, twiddlie[msgnum % sizeof(twiddlie)]);
}
}

msgnum++;

if (!debug) {
printf("\b\b\b\b\b\b\b\b\b\b\b%04u/%04u %c",
(unsigned int)(block + 1), (unsigned int)fw->fw_blocks, twiddlie[msgnum % sizeof(twiddlie)]);
printf("\b\b\b\b\b\b\b\b\b\b\b%04d/%04d %c",
block + 1, fw->fw_blocks, twiddlie[msgnum % sizeof(twiddlie)]);
fflush(stdout);
}
} while((pos - &(fw->fw[block][2])) < len);
Expand Down
5 changes: 5 additions & 0 deletions hexdump.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef HEXDUMP_H
#define HEXDUMP_H

/* simple hexdumper
*
* Copyright (c) 2004-2016 Michael Gernoth <michael@gernoth.net>
Expand Down Expand Up @@ -56,3 +59,5 @@ static void hexdump(const unsigned char *buf, int len, const char *prefix)
asciishow(buf+i-(i%16), (i%16));
fprintf(stderr, "\n");
}

#endif /* HEXDUMP_H */
4 changes: 2 additions & 2 deletions hmland.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ __attribute__((noreturn)) void sigterm_handler(int __attribute__((unused)) sig)
#define FLAG_DAEMON (1 << 0)
#define FLAG_PID_FILE (1 << 1)

static int socket_server(char *iface, int port, int flags)
static int socket_server(const char *iface, int port, int flags)
{
struct sigaction sact;
struct sockaddr_in sin;
Expand Down Expand Up @@ -804,7 +804,7 @@ static int interactive_server(int flags)
return EXIT_SUCCESS;
}

void hmlan_syntax(char *prog)
void hmlan_syntax(const char *prog)
{
fprintf(stderr, "Syntax: %s options\n\n", prog);
fprintf(stderr, "Possible options:\n");
Expand Down
2 changes: 1 addition & 1 deletion hmsniff.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static int parse_hmuartlgw(enum hmuartlgw_dst dst, uint8_t *buf, int buf_len, vo
return 1;
}

void hmsniff_syntax(char *prog)
void hmsniff_syntax(const char *prog)
{
fprintf(stderr, "Syntax: %s options\n\n", prog);
fprintf(stderr, "Possible options:\n");
Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ __attribute__((const)) int validate_nibble(uint8_t a)
return 0;
}

__attribute__((const)) char nibble_to_ascii(uint8_t n)
__attribute__((pure)) char nibble_to_ascii(uint8_t n)
{
const uint8_t nibble[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'};
Expand Down
2 changes: 1 addition & 1 deletion util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

__attribute__((const)) uint8_t ascii_to_nibble(uint8_t a);
__attribute__((const)) int validate_nibble(uint8_t a);
__attribute__((const)) char nibble_to_ascii(uint8_t n);
__attribute__((pure)) char nibble_to_ascii(uint8_t n);

#endif /* UTIL_H */
7 changes: 6 additions & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
#define VERSION "0.103-git"
#ifndef VERSION_H
#define VERSION_H

#define VERSION "1.0.1"

#endif /* VERSION_H */
Loading