# HG changeset patch # User Matt Johnston # Date 1171636928 0 # Node ID c216212001fc5e6a58187006e15d61f722b1aab2 # Parent 517e76bdfb2d1473c28ecf90ddacc375ad6ce82e Fix for -pedantic -ansi compilation, change // to /**/, plus some signedness and trailing-comma-in-array issues diff -r 517e76bdfb2d -r c216212001fc cli-session.c --- a/cli-session.c Tue Feb 13 10:30:02 2007 +0000 +++ b/cli-session.c Fri Feb 16 14:42:08 2007 +0000 @@ -215,8 +215,8 @@ if (cli_opts.backgrounded) { int devnull; - // keeping stdin open steals input from the terminal and - // is confusing, though stdout/stderr could be useful. + /* keeping stdin open steals input from the terminal and + is confusing, though stdout/stderr could be useful. */ devnull = open(_PATH_DEVNULL, O_RDONLY); if (devnull < 0) { dropbear_exit("opening /dev/null: %d %s", diff -r 517e76bdfb2d -r c216212001fc common-channel.c --- a/common-channel.c Tue Feb 13 10:30:02 2007 +0000 +++ b/common-channel.c Fri Feb 16 14:42:08 2007 +0000 @@ -461,7 +461,7 @@ FD_SET(channel->writefd, writefds); } - if (ERRFD_IS_WRITE(channel) != NULL && channel->errfd >= 0 + if (ERRFD_IS_WRITE(channel) && channel->errfd >= 0 && cbuf_getused(channel->extrabuf) > 0 ) { FD_SET(channel->errfd, writefds); } @@ -640,7 +640,7 @@ /* If we receive less data than we requested when flushing, we've reached the equivalent of EOF */ - if (channel->flushing && len < maxlen) + if (channel->flushing && len < (ssize_t)maxlen) { TRACE(("closing from channel, flushing out.")) close_chan_fd(channel, fd, SHUT_RD); diff -r 517e76bdfb2d -r c216212001fc dbutil.c --- a/dbutil.c Tue Feb 13 10:30:02 2007 +0000 +++ b/dbutil.c Fri Feb 16 14:42:08 2007 +0000 @@ -199,10 +199,10 @@ hints.ai_family = AF_UNSPEC; /* TODO: let them flag v4 only etc */ hints.ai_socktype = SOCK_STREAM; - // for calling getaddrinfo: - // address == NULL and !AI_PASSIVE: local loopback - // address == NULL and AI_PASSIVE: all interfaces - // address != NULL: whatever the address says + /* for calling getaddrinfo: + address == NULL and !AI_PASSIVE: local loopback + address == NULL and AI_PASSIVE: all interfaces + address != NULL: whatever the address says */ if (!address) { TRACE(("dropbear_listen: local loopback")) } else { diff -r 517e76bdfb2d -r c216212001fc random.c --- a/random.c Tue Feb 13 10:30:02 2007 +0000 +++ b/random.c Fri Feb 16 14:42:08 2007 +0000 @@ -214,7 +214,7 @@ unsigned char *randbuf = NULL; unsigned int len = 0; - const char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; + const unsigned char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; const int size_bits = mp_count_bits(max); diff -r 517e76bdfb2d -r c216212001fc session.h --- a/session.h Tue Feb 13 10:30:02 2007 +0000 +++ b/session.h Fri Feb 16 14:42:08 2007 +0000 @@ -190,8 +190,7 @@ KEX_NOTHING, KEXINIT_RCVD, KEXDH_INIT_SENT, - KEXDONE, - + KEXDONE } cli_kex_state; typedef enum { @@ -203,8 +202,7 @@ USERAUTH_REQ_SENT, USERAUTH_FAIL_RCVD, USERAUTH_SUCCESS_RCVD, - SESSION_RUNNING, - + SESSION_RUNNING } cli_state; struct clientsession { diff -r 517e76bdfb2d -r c216212001fc svr-main.c --- a/svr-main.c Tue Feb 13 10:30:02 2007 +0000 +++ b/svr-main.c Fri Feb 16 14:42:08 2007 +0000 @@ -125,8 +125,9 @@ int childsock; int childpipe[2]; - // Note: commonsetup() must happen before we daemon()ise. Otherwise - // daemon() will chdir("/"), and we won't be able to find local-dir hostkeys. + /* Note: commonsetup() must happen before we daemon()ise. Otherwise + daemon() will chdir("/"), and we won't be able to find local-dir + hostkeys. */ commonsetup(); /* fork */ diff -r 517e76bdfb2d -r c216212001fc svr-session.c --- a/svr-session.c Tue Feb 13 10:30:02 2007 +0000 +++ b/svr-session.c Fri Feb 16 14:42:08 2007 +0000 @@ -188,7 +188,7 @@ || strftime(datestr, sizeof(datestr), "%b %d %H:%M:%S", localtime(×ec)) == 0) { - // upon failure, just print the epoch-seconds time. + /* upon failure, just print the epoch-seconds time. */ snprintf(datestr, sizeof(datestr), "%d", timesec); } fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf); diff -r 517e76bdfb2d -r c216212001fc tcp-accept.c --- a/tcp-accept.c Tue Feb 13 10:30:02 2007 +0000 +++ b/tcp-accept.c Fri Feb 16 14:42:08 2007 +0000 @@ -104,7 +104,7 @@ struct Listener *listener = NULL; int nsocks; char* errstring = NULL; - // listen_spec = NULL indicates localhost + /* listen_spec = NULL indicates localhost */ const char* listen_spec = NULL; TRACE(("enter listen_tcpfwd"))