summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-09-05 06:59:36 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-09-05 06:59:36 +0200
commit6717646008b6996c15b84e6ab91355fc65beb550 (patch)
tree566838606c7f3c48f53047c4b9880c9c19c68c85
parent5b09d42cb4ccea745dbb0146058c97f277b55849 (diff)
downloadofono-6717646008b6996c15b84e6ab91355fc65beb550.tar.bz2
Fix mixed declarations and code
-rw-r--r--gatmux/gsm0710.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gatmux/gsm0710.c b/gatmux/gsm0710.c
index d1faa7c2..a870c74f 100644
--- a/gatmux/gsm0710.c
+++ b/gatmux/gsm0710.c
@@ -274,6 +274,8 @@ static int gsm0710_packet( struct gsm0710_context *ctx, int channel, int type,
} else if (type == GSM0710_STATUS_ACK && channel == 0) {
+ char resp[33];
+
/* Status change message */
if (len >= 2) {
/* Handle status changes on other channels */
@@ -287,7 +289,6 @@ static int gsm0710_packet( struct gsm0710_context *ctx, int channel, int type,
/* Send the response to the status change request to ACK it */
gsm0710_debug(ctx, "received status line signal, sending response");
- char resp[33];
if ( len > 31 )
len = 31;
resp[0] = (char)GSM0710_STATUS_ACK;
@@ -325,10 +326,12 @@ static int gsm0710_packet( struct gsm0710_context *ctx, int channel, int type,
A callback will be made to ctx->read to get the data for processing */
void gsm0710_ready_read(struct gsm0710_context *ctx)
{
+ int len, posn, posn2, header_size, channel, type;
+
/* Read more data from the underlying serial device */
if (!ctx->read)
return;
- int len = (*(ctx->read))(ctx, ctx->buffer + ctx->buffer_used,
+ len = (*(ctx->read))(ctx, ctx->buffer + ctx->buffer_used,
sizeof(ctx->buffer) - ctx->buffer_used);
if ( len <= 0 )
return;
@@ -345,10 +348,7 @@ void gsm0710_ready_read(struct gsm0710_context *ctx)
}
/* Break the incoming data up into packets */
- int posn = 0;
- int posn2;
- int header_size;
- int channel, type;
+ posn = 0;
while (posn < ctx->buffer_used) {
if (ctx->buffer[posn] == (char)0xF9) {