diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2016-10-07 08:55:18 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2016-10-07 08:55:18 +0200 |
commit | 27938d111e2f49ed3e8c39647d9a8fbc1482a686 (patch) | |
tree | 073f0cf2ebab7d7eb68a414fc553f0723da72b86 /src/nmt | |
parent | 8ef966aa21f58c867a9dd8b60108e489c1dc2f8f (diff) |
Added and fixed extra compiler warnings
Diffstat (limited to 'src/nmt')
-rw-r--r-- | src/nmt/Makefile.am | 2 | ||||
-rw-r--r-- | src/nmt/dms.c | 2 | ||||
-rw-r--r-- | src/nmt/frame.c | 28 | ||||
-rw-r--r-- | src/nmt/image.c | 2 | ||||
-rw-r--r-- | src/nmt/nmt.c | 8 | ||||
-rw-r--r-- | src/nmt/sms.c | 8 |
6 files changed, 25 insertions, 25 deletions
diff --git a/src/nmt/Makefile.am b/src/nmt/Makefile.am index 5c5c7cd..5d4dad9 100644 --- a/src/nmt/Makefile.am +++ b/src/nmt/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -Wall -g $(all_includes) +AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) bin_PROGRAMS = \ nmt diff --git a/src/nmt/dms.c b/src/nmt/dms.c index fa75a76..c871b5a 100644 --- a/src/nmt/dms.c +++ b/src/nmt/dms.c @@ -221,7 +221,7 @@ static void dms_frame_add_rand(nmt_t *nmt, int eight_bits) */ /* init instance */ -int dms_init_sender(nmt_t *nmt) +int dms_init_sender(nmt_t __attribute__((unused)) *nmt) { /* we need some simple random */ srandom((unsigned int)(get_time() * 1000)); diff --git a/src/nmt/frame.c b/src/nmt/frame.c index a903548..c63ff21 100644 --- a/src/nmt/frame.c +++ b/src/nmt/frame.c @@ -257,12 +257,12 @@ static int num_frames; const char *nmt_frame_name(enum nmt_mt mt) { - if (mt < 0 || mt >= num_frames) + if (mt < 0 || (int)mt >= num_frames) return "invalid"; return nmt_frame[mt].nr; } -static const char *param_integer(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_integer(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; sprintf(result, "%" PRIu64, value); @@ -270,7 +270,7 @@ static const char *param_integer(uint64_t value, int ndigits, enum nmt_direction return result; } -static const char *param_hex(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_hex(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; sprintf(result, "0x%" PRIx64, value); @@ -278,7 +278,7 @@ static const char *param_hex(uint64_t value, int ndigits, enum nmt_direction dir return result; } -static const char *param_channel_no(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_channel_no(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; int rc, channel, power; @@ -292,7 +292,7 @@ static const char *param_channel_no(uint64_t value, int ndigits, enum nmt_direct return result; } -static const char *param_country(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_country(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; @@ -321,7 +321,7 @@ static const char *param_country(uint64_t value, int ndigits, enum nmt_direction } } -static const char *param_number(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_number(uint64_t value, int ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; @@ -331,7 +331,7 @@ static const char *param_number(uint64_t value, int ndigits, enum nmt_direction return result; } -static const char *param_ta(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_ta(uint64_t value, int ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; @@ -341,7 +341,7 @@ static const char *param_ta(uint64_t value, int ndigits, enum nmt_direction dire return result; } -static const char *param_line_signal(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_line_signal(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction direction) { static char result[64], *desc = "Spare"; @@ -408,7 +408,7 @@ static const char *param_line_signal(uint64_t value, int ndigits, enum nmt_direc return result; } -static const char *param_digit(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_digit(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; @@ -425,7 +425,7 @@ static const char *param_digit(uint64_t value, int ndigits, enum nmt_direction d return result; } -static const char *param_supervisory(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_supervisory(uint64_t value, int __attribute__((unused)) ndigits, enum nmt_direction __attribute__((unused)) direction) { switch (value) { case 0: @@ -443,7 +443,7 @@ static const char *param_supervisory(uint64_t value, int ndigits, enum nmt_direc } } -static const char *param_password(uint64_t value, int ndigits, enum nmt_direction direction) +static const char *param_password(uint64_t value, int ndigits, enum nmt_direction __attribute__((unused)) direction) { static char result[32]; @@ -481,7 +481,7 @@ static struct nmt_parameter { { 'c', "c", param_hex }, { 'M', "Sequence Number", param_integer }, { 'W', "Checksum", param_hex }, - { 0, NULL } + { 0, NULL, NULL } }; /* Depending on P-value, direction and additional info, frame index (used for @@ -649,7 +649,7 @@ int init_frame(void) /* check if all digits actually exist */ for (i = 0; nmt_frame[i].digits; i++) { /* check mesage type */ - if (nmt_frame[i].message_type != i) { + if ((int)nmt_frame[i].message_type != i) { PDEBUG(DFRAME, DEBUG_ERROR, "Message type at message index #%d does not have a value of %d, but has %d, please fix!\n", i, i + 1, nmt_frame[i].message_type); return -1; } @@ -810,7 +810,7 @@ static void assemble_frame(frame_t *frame, uint8_t *digits, int debug) mt = frame->mt; - if (mt >= num_frames) { + if ((int)mt >= num_frames) { PDEBUG(DFRAME, DEBUG_ERROR, "Frame mt %d out of range (0..%d), please fix!\n", mt, num_frames - 1); abort(); } diff --git a/src/nmt/image.c b/src/nmt/image.c index e31167c..15d933f 100644 --- a/src/nmt/image.c +++ b/src/nmt/image.c @@ -35,7 +35,7 @@ void print_image(void) int i, j; for (i = 0; image[i]; i++) { - for (j = 0; j < strlen(image[i]); j++) { + for (j = 0; j < (int)strlen(image[i]); j++) { if (image[i][j] == '@') { j++; switch(image[i][j]) { diff --git a/src/nmt/nmt.c b/src/nmt/nmt.c index 558aa17..ea32edc 100644 --- a/src/nmt/nmt.c +++ b/src/nmt/nmt.c @@ -1760,7 +1760,7 @@ void call_out_disconnect(int callref, int cause) } /* Call control releases call toward mobile station. */ -void call_out_release(int callref, int cause) +void call_out_release(int callref, int __attribute__((unused)) cause) { transaction_t *trans; nmt_t *nmt; @@ -1831,14 +1831,14 @@ void sms_release(nmt_t *nmt) nmt_release(nmt); } -int sms_submit(nmt_t *nmt, uint8_t ref, const char *orig_address, uint8_t orig_type, uint8_t orig_plan, int msg_ref, const char *dest_address, uint8_t dest_type, uint8_t dest_plan, const char *message) +int sms_submit(nmt_t *nmt, uint8_t ref, const char *orig_address, uint8_t __attribute__((unused)) orig_type, uint8_t __attribute__((unused)) orig_plan, int __attribute__((unused)) msg_ref, const char *dest_address, uint8_t __attribute__((unused)) dest_type, uint8_t __attribute__((unused)) dest_plan, const char *message) { char sms[512]; if (!orig_address[0]) orig_address = &nmt->trans->subscriber.country; - PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Received SMS from '%s' to '%s'\n", orig_address, dest_address); + PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Received SMS from '%s' to '%s' (ref=%d)\n", orig_address, dest_address, ref); printf("SMS received '%s' -> '%s': %s\n", orig_address, dest_address, message); snprintf(sms, sizeof(sms) - 1, "%s,%s,%s", orig_address, dest_address, message); sms[sizeof(sms) - 1] = '\0'; @@ -1848,7 +1848,7 @@ int sms_submit(nmt_t *nmt, uint8_t ref, const char *orig_address, uint8_t orig_t void sms_deliver_report(nmt_t *nmt, uint8_t ref, int error, uint8_t cause) { - PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Got SMS deliver report\n"); + PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Got SMS deliver report (ref=%d)\n", ref); if (error) printf("SMS failed! (cause=%d)\n", cause); else { diff --git a/src/nmt/sms.c b/src/nmt/sms.c index df93ced..c1263b2 100644 --- a/src/nmt/sms.c +++ b/src/nmt/sms.c @@ -251,10 +251,10 @@ static int encode_userdata(uint8_t *data, const char *message) j = 0; pos = 0; for (i = 0; message[i]; i++) { - if (message[i] < 128) - character = message[i]; + if (message[i] >= 0) + character = message[i]; /* 0..127 */ else - character = '?'; + character = '?'; /* 128..255 */ j++; if (pos == 0) { /* character fits and is aligned to the right, new octet */ @@ -583,7 +583,7 @@ static int decode_deliver_report(nmt_t *nmt, const uint8_t *data, int length) } /* receive from DMS layer */ -void dms_receive(nmt_t *nmt, const uint8_t *data, int length, int eight_bits) +void dms_receive(nmt_t *nmt, const uint8_t *data, int length, int __attribute__((unused)) eight_bits) { sms_t *sms = &nmt->sms; int space; |