diff options
| author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-09-11 10:38:43 +0200 | 
|---|---|---|
| committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-09-11 10:38:43 +0200 | 
| commit | cc7d9ec20e3ee2cda8d3df3192e7b02a67cda1d7 (patch) | |
| tree | 921a4b5905d3fe80aff1b2e44c9f453ad83403e8 | |
| parent | 06f645542cc9ca4e881eb3c0a441b510866a1a9f (diff) | |
gsm: Address compiler warning about unused variable 'z'
The comment explains why we don't care about the content of z,
stop storing it.
gsm_utils.c: In function 'gsm_7bit_encode':
gsm_utils.c:253:13: warning: variable 'z' set but not used [-Wunused-but-set-variable]
| -rw-r--r-- | src/gsm/gsm_utils.c | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 8d072a1f..3f3a73f6 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -250,16 +250,17 @@ int gsm_septets2octets(uint8_t *result, uint8_t *rdata, uint8_t septet_len, uint  /* GSM 03.38 6.2.1 Character packing */  int gsm_7bit_encode(uint8_t *result, const char *data)  { -	int y = 0, z = 0; +	int y = 0; +  	/* prepare for the worst case, every character expanding to two bytes */  	uint8_t *rdata = calloc(strlen(data) * 2, sizeof(uint8_t));  	y = gsm_septet_encode(rdata, data); -	z = gsm_septets2octets(result, rdata, y, 0); +	gsm_septets2octets(result, rdata, y, 0);  	free(rdata);  	/* -	 * We don't care about the number of octets (z), because they are not +	 * We don't care about the number of octets, because they are not  	 * unique. E.g.:  	 *  1.) 46 non-extension characters + 1 extension character  	 *         => (46 * 7 bit + (1 * (2 * 7 bit))) / 8 bit =  42 octets  | 
