From 5b7a245572fb88a6c0aa2e753c74040105571ceb Mon Sep 17 00:00:00 2001 From: Adi Masputra Date: Sat, 15 Apr 2000 01:27:13 +0000 Subject: [PATCH] Some tiny fixes (minor castings) to remove annoying compiler warnings --- pppd/auth.c | 8 ++++---- pppd/ccp.c | 8 ++++---- pppd/demand.c | 4 ++-- pppd/ipcp.c | 10 +++++----- pppd/ipv6cp.c | 16 ++++++++-------- pppd/lcp.c | 6 +++--- pppd/main.c | 6 +++--- pppd/options.c | 26 +++++++++++++------------- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/pppd/auth.c b/pppd/auth.c index 023653d..4ca883c 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -32,7 +32,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: auth.c,v 1.64 2000/04/13 12:05:57 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.65 2000/04/15 01:27:10 masputra Exp $" #include #include @@ -229,14 +229,14 @@ option_t auth_options[] = { "Use system password database for PAP", 1 }, { "papcrypt", o_bool, &cryptpap, "PAP passwords are encrypted", 1 }, - { "+ua", o_special, setupapfile, + { "+ua", o_special, (void *)setupapfile, "Get PAP user and password from file" }, { "password", o_string, passwd, "Password for authenticating us to the peer", OPT_STATIC, NULL, MAXSECRETLEN }, - { "privgroup", o_special, privgroup, + { "privgroup", o_special, (void *)privgroup, "Allow group members to use privileged options", OPT_PRIV }, - { "allow-ip", o_special, set_noauth_addr, + { "allow-ip", o_special, (void *)set_noauth_addr, "Set IP address(es) which can be used without authentication", OPT_PRIV }, { NULL } diff --git a/pppd/ccp.c b/pppd/ccp.c index d6da2d5..7cfd692 100644 --- a/pppd/ccp.c +++ b/pppd/ccp.c @@ -25,7 +25,7 @@ * OR MODIFICATIONS. */ -#define RCSID "$Id: ccp.c,v 1.29 1999/08/13 06:46:11 paulus Exp $" +#define RCSID "$Id: ccp.c,v 1.30 2000/04/15 01:27:11 masputra Exp $" #include #include @@ -48,7 +48,7 @@ static option_t ccp_option_list[] = { "Disable CCP negotiation" }, { "-ccp", o_bool, &ccp_protent.enabled_flag, "Disable CCP negotiation" }, - { "bsdcomp", o_special, setbsdcomp, + { "bsdcomp", o_special, (void *)setbsdcomp, "Request BSD-Compress packet compression" }, { "nobsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, "don't allow BSD-Compress", OPT_A2COPY, @@ -56,7 +56,7 @@ static option_t ccp_option_list[] = { { "-bsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, "don't allow BSD-Compress", OPT_A2COPY, &ccp_allowoptions[0].bsd_compress }, - { "deflate", 1, setdeflate, + { "deflate", 1, (void *)setdeflate, "request Deflate compression" }, { "nodeflate", o_bool, &ccp_wantoptions[0].deflate, "don't allow Deflate compression", OPT_A2COPY, @@ -1150,7 +1150,7 @@ ccp_printpkt(p, plen, printer, arg) case TERMACK: case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { - print_string(p, len, printer, arg); + print_string((char *)p, len, printer, arg); p += len; len = 0; } diff --git a/pppd/demand.c b/pppd/demand.c index bb6538c..adb12b9 100644 --- a/pppd/demand.c +++ b/pppd/demand.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: demand.c,v 1.12 1999/08/13 06:46:12 paulus Exp $"; +#define RCSID "$Id: demand.c,v 1.13 2000/04/15 01:27:11 masputra Exp $" #include #include @@ -216,7 +216,7 @@ loop_chars(p, n) if (!escape_flag && !flush_flag && framelen > 2 && fcs == PPP_GOODFCS) { framelen -= 2; - if (loop_frame(frame, framelen)) + if (loop_frame((unsigned char *)frame, framelen)) rv = 1; } framelen = 0; diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 829b2c9..484c00c 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: ipcp.c,v 1.53 2000/04/04 07:06:49 paulus Exp $" +#define RCSID "$Id: ipcp.c,v 1.54 2000/04/15 01:27:11 masputra Exp $" /* * TODO: @@ -115,7 +115,7 @@ static option_t ipcp_option_list[] = { { "-vjccomp", o_bool, &ipcp_wantoptions[0].cflag, "Disable VJ connection-ID compression", OPT_A2COPY, &ipcp_allowoptions[0].cflag }, - { "vj-max-slots", 1, setvjslots, + { "vj-max-slots", 1, (void *)setvjslots, "Set maximum VJ header slots" }, { "ipcp-accept-local", o_bool, &ipcp_wantoptions[0].accept_local, "Accept peer's address for us", 1 }, @@ -125,9 +125,9 @@ static option_t ipcp_option_list[] = { "Set ip script parameter" }, { "noipdefault", o_bool, &disable_defaultip, "Don't use name for default IP adrs", 1 }, - { "ms-dns", 1, setdnsaddr, + { "ms-dns", 1, (void *)setdnsaddr, "DNS address for the peer's use" }, - { "ms-wins", 1, setwinsaddr, + { "ms-wins", 1, (void *)setwinsaddr, "Nameserver for SMB over TCP/IP for peer" }, { "ipcp-restart", o_int, &ipcp_fsm[0].timeouttime, "Set timeout for IPCP" }, @@ -1793,7 +1793,7 @@ ipcp_printpkt(p, plen, printer, arg) case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { printer(arg, " "); - print_string(p, len, printer, arg); + print_string((char *)p, len, printer, arg); p += len; len = 0; } diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c index 98cae54..a80f222 100644 --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c @@ -95,10 +95,10 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ipv6cp.c,v 1.8 2000/04/04 07:06:50 paulus Exp $ + * $Id: ipv6cp.c,v 1.9 2000/04/15 01:27:11 masputra Exp $ */ -#define RCSID "$Id: ipv6cp.c,v 1.8 2000/04/04 07:06:50 paulus Exp $" +#define RCSID "$Id: ipv6cp.c,v 1.9 2000/04/15 01:27:11 masputra Exp $" /* * TODO: @@ -179,7 +179,7 @@ static fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ static int setifaceid __P((char **arg)); static option_t ipv6cp_option_list[] = { - { "ipv6", o_special, setifaceid, + { "ipv6", o_special, (void *)setifaceid, "Set interface identifiers for IPV6" }, { "noipv6", o_bool, &ipv6cp_protent.enabled_flag, "Disable IPv6 and IPv6CP" }, @@ -916,14 +916,14 @@ ipv6cp_reqci(f, inp, len, reject_if_disagree) orc = CONFREJ; break; } -#else - orc = CONFREJ; - break; -#endif ho->neg_vj = 1; ho->vj_protocol = cishort; break; +#else + orc = CONFREJ; + break; +#endif default: orc = CONFREJ; @@ -1423,7 +1423,7 @@ ipv6cp_printpkt(p, plen, printer, arg) case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { printer(arg, " "); - print_string(p, len, printer, arg); + print_string((char *)p, len, printer, arg); p += len; len = 0; } diff --git a/pppd/lcp.c b/pppd/lcp.c index ff17fb0..f0e453d 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: lcp.c,v 1.51 2000/04/13 12:05:57 paulus Exp $"; +#define RCSID "$Id: lcp.c,v 1.52 2000/04/15 01:27:12 masputra Exp $" /* * TODO: @@ -96,7 +96,7 @@ static option_t lcp_option_list[] = { "Set passive mode", 1 }, { "silent", o_bool, &lcp_wantoptions[0].silent, "Set silent mode", 1 }, - { "escape", o_special, setescape, + { "escape", o_special, (void *)setescape, "List of character codes to escape on transmission" }, { "lcp-echo-failure", o_int, &lcp_echo_fails, "Set number of consecutive echo failures to indicate link failure" }, @@ -1986,7 +1986,7 @@ lcp_printpkt(p, plen, printer, arg) case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { printer(arg, " "); - print_string(p, len, printer, arg); + print_string((char *)p, len, printer, arg); p += len; len = 0; } diff --git a/pppd/main.c b/pppd/main.c index ca6e50a..ad7c90d 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: main.c,v 1.93 2000/04/13 12:05:59 paulus Exp $" +#define RCSID "$Id: main.c,v 1.94 2000/04/15 01:27:13 masputra Exp $" #include #include @@ -83,7 +83,7 @@ static uid_t uid; /* Our real user-id */ static int conn_running; /* we have a [dis]connector running */ int ttyfd; /* Serial port file descriptor */ -mode_t tty_mode = -1; /* Original access permissions to tty */ +mode_t tty_mode = (mode_t)-1; /* Original access permissions to tty */ int baud_rate; /* Actual bits/second for serial device */ int hungup; /* terminal has been hung up */ int privileged; /* we're running as real uid root */ @@ -2143,7 +2143,7 @@ open_socket(dest) sad.sin_family = AF_INET; sad.sin_port = htons(port); sad.sin_addr.s_addr = host; - if (connect(sock, &sad, sizeof(sad)) < 0) { + if (connect(sock, (struct sockaddr *)&sad, sizeof(sad)) < 0) { error("Can't connect to %s: %m", dest); close(sock); return -1; diff --git a/pppd/options.c b/pppd/options.c index 5f22c17..9e8158a 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: options.c,v 1.73 2000/04/13 12:05:16 paulus Exp $" +#define RCSID "$Id: options.c,v 1.74 2000/04/15 01:27:13 masputra Exp $" #include #include @@ -192,7 +192,7 @@ option_t general_options[] = { "Set time in seconds before disconnecting idle link" }, { "lock", o_bool, &lockflag, "Lock serial device with UUCP-style lock file", 1 }, - { "-all", o_special_noarg, noopt, + { "-all", o_special_noarg, (void *)noopt, "Don't request/allow any LCP or IPCP options (useless)" }, { "init", o_string, &initializer, "A program to initialize the device", @@ -227,21 +227,21 @@ option_t general_options[] = { "Set alternate hardware (DTR/CTS) flow control", OPT_NOARG|OPT_VAL(2) }, { "nocdtrcts", o_int, &crtscts, "Disable hardware flow control", OPT_NOARG|OPT_VAL(-1) }, - { "xonxoff", o_special_noarg, setxonxoff, + { "xonxoff", o_special_noarg, (void *)setxonxoff, "Set software (XON/XOFF) flow control" }, - { "domain", o_special, setdomain, + { "domain", o_special, (void *)setdomain, "Add given domain name to hostname" }, { "mtu", o_int, &lcp_allowoptions[0].mru, "Set our MTU", OPT_LIMITS, NULL, MAXMRU, MINMRU }, - { "netmask", o_special, setnetmask, + { "netmask", o_special, (void *)setnetmask, "set netmask" }, { "modem", o_bool, &modem, "Use modem control lines", 1 }, { "local", o_bool, &modem, "Don't use modem control lines" }, - { "file", o_special, readfile, + { "file", o_special, (void *)readfile, "Take options from a file", OPT_PREPASS }, - { "call", o_special, callfile, + { "call", o_special, (void *)callfile, "Take options from a privileged file", OPT_PREPASS }, { "persist", o_bool, &persist, "Keep on reopening connection after close", 1 }, @@ -249,18 +249,18 @@ option_t general_options[] = { "Turn off persist option" }, { "demand", o_bool, &demand, "Dial on demand", OPT_INITONLY | 1, &persist }, - { "--version", o_special_noarg, showversion, + { "--version", o_special_noarg, (void *)showversion, "Show version number" }, - { "--help", o_special_noarg, showhelp, + { "--help", o_special_noarg, (void *)showhelp, "Show brief listing of options" }, - { "-h", o_special_noarg, showhelp, + { "-h", o_special_noarg, (void *)showhelp, "Show brief listing of options" }, { "sync", o_bool, &sync_serial, "Use synchronous HDLC serial encoding", 1 }, { "logfd", o_int, &log_to_fd, "Send log messages to this file descriptor", 0, &log_to_specific_fd }, - { "logfile", o_special, setlogfile, + { "logfile", o_special, (void *)setlogfile, "Append log messages to this file" }, { "nolog", o_int, &log_to_fd, "Don't send log messages to any file", @@ -296,7 +296,7 @@ option_t general_options[] = { "Bundle name for multilink" }, #endif /* HAVE_MULTILINK */ #ifdef PLUGIN - { "plugin", o_special, loadplugin, + { "plugin", o_special, (void *)loadplugin, "Load a plug-in module into pppd", OPT_PRIV }, #endif @@ -1601,7 +1601,7 @@ loadplugin(argv) option_error("Couldn't load plugin %s", arg); return 0; } - init = dlsym(handle, "plugin_init"); + init = (void (*)(void))dlsym(handle, "plugin_init"); if (init == 0) { option_error("%s has no initialization entry point", arg); dlclose(handle); -- 2.39.2