Commit 28325580d30d1dc745f1aa74406df7a3cdbbddfc

Authored by perry.werneck@gmail.com
1 parent 4f80c9e5

Removendo warnings

Showing 3 changed files with 61 additions and 57 deletions   Show diff stats
Makefile.in
... ... @@ -36,7 +36,7 @@ LDFLAGS=@LDFLAGS@ -Wl,-soname,@DLLPREFIX@3270@DLLEXT@.@VERSION@
36 36  
37 37 LIBS=@LIBS@ @LIBSSL_LIBS@ @INTL_LIBS@ @SOCKET_LIBS@
38 38  
39   -DEBUG_CFLAGS=-DDEBUG=1 -g
  39 +DEBUG_CFLAGS=-DDEBUG=1 -g -Wall
40 40 DEPENDS ?= *.h ../include/*.h ../include/lib3270/*.h Makefile
41 41  
42 42 #---[ Paths ]------------------------------------------------------------------
... ...
telnet.c
... ... @@ -224,8 +224,8 @@ static const char *tn3270e_function_names(const unsigned char *, int);
224 224 #endif /*]*/
225 225 static void tn3270e_subneg_send(H3270 *hSession, unsigned char, unsigned long);
226 226 static unsigned long tn3270e_fdecode(const unsigned char *, int);
227   -static void tn3270e_ack(void);
228   -static void tn3270e_nak(enum pds);
  227 +static void tn3270e_ack(H3270 *hSession);
  228 +static void tn3270e_nak(H3270 *hSession, enum pds);
229 229 #endif /*]*/
230 230  
231 231 #if defined(X3270_ANSI) /*[*/
... ... @@ -236,9 +236,9 @@ static void do_cerase(H3270 *hSession, char c);
236 236 static void do_werase(H3270 *hSession, char c);
237 237 static void do_kill(H3270 *hSession, char c);
238 238 static void do_rprnt(H3270 *hSession, char c);
239   -static void do_eof(char c);
240   -static void do_eol(char c);
241   -static void do_lnext(char c);
  239 +static void do_eof(H3270 *hSession, char c);
  240 +static void do_eol(H3270 *hSession, char c);
  241 +static void do_lnext(H3270 *hSession, char c);
242 242 static char parse_ctlchar(char *s);
243 243 static void cooked_init(H3270 *hSession);
244 244 #endif /*]*/
... ... @@ -1891,10 +1891,10 @@ process_eor(void)
1891 1891 (h3270.ibptr - h3270.ibuf) - EH_SIZE);
1892 1892 if (rv < 0 &&
1893 1893 h3270.response_required != TN3270E_RSF_NO_RESPONSE)
1894   - tn3270e_nak(rv);
  1894 + tn3270e_nak(&h3270,rv);
1895 1895 else if (rv == PDS_OKAY_NO_OUTPUT &&
1896 1896 h3270.response_required == TN3270E_RSF_ALWAYS_RESPONSE)
1897   - tn3270e_ack();
  1897 + tn3270e_ack(&h3270);
1898 1898 h3270.response_required = TN3270E_RSF_NO_RESPONSE;
1899 1899 return 0;
1900 1900 case TN3270E_DT_BIND_IMAGE:
... ... @@ -2158,7 +2158,7 @@ static void net_cookout(H3270 *hSession, const char *buf, int len)
2158 2158  
2159 2159 /* Control chars. */
2160 2160 if (c == '\n')
2161   - do_eol(c);
  2161 + do_eol(hSession,c);
2162 2162 else if (c == vintr)
2163 2163 do_intr(hSession, c);
2164 2164 else if (c == vquit)
... ... @@ -2172,9 +2172,9 @@ static void net_cookout(H3270 *hSession, const char *buf, int len)
2172 2172 else if (c == vrprnt)
2173 2173 do_rprnt(hSession,c);
2174 2174 else if (c == veof)
2175   - do_eof(c);
  2175 + do_eof(hSession,c);
2176 2176 else if (c == vlnext)
2177   - do_lnext(c);
  2177 + do_lnext(hSession,c);
2178 2178 else if (c == 0x08 || c == 0x7f) /* Yes, a hack. */
2179 2179 do_cerase(hSession,c);
2180 2180 else
... ... @@ -2343,16 +2343,15 @@ static void do_rprnt(H3270 *hSession, char c)
2343 2343 ansi_process_s(ctl_see((int) *p));
2344 2344 }
2345 2345  
2346   -static void
2347   -do_eof(char c)
  2346 +static void do_eof(H3270 *hSession, char c)
2348 2347 {
2349   - if (h3270.backslashed) {
2350   - h3270.lbptr--;
  2348 + if (hSession->backslashed) {
  2349 + hSession->lbptr--;
2351 2350 ansi_process_s("\b");
2352 2351 do_data(c);
2353 2352 return;
2354 2353 }
2355   - if (h3270.lnext) {
  2354 + if (hSession->lnext) {
2356 2355 do_data(c);
2357 2356 return;
2358 2357 }
... ... @@ -2360,31 +2359,29 @@ do_eof(char c)
2360 2359 forward_data();
2361 2360 }
2362 2361  
2363   -static void
2364   -do_eol(char c)
  2362 +static void do_eol(H3270 *hSession, char c)
2365 2363 {
2366   - if (h3270.lnext) {
  2364 + if (hSession->lnext) {
2367 2365 do_data(c);
2368 2366 return;
2369 2367 }
2370   - if (h3270.lbptr+2 >= h3270.lbuf + BUFSZ) {
  2368 + if (hSession->lbptr+2 >= hSession->lbuf + BUFSZ) {
2371 2369 ansi_process_s("\007");
2372 2370 return;
2373 2371 }
2374   - *h3270.lbptr++ = '\r';
2375   - *h3270.lbptr++ = '\n';
  2372 + *hSession->lbptr++ = '\r';
  2373 + *hSession->lbptr++ = '\n';
2376 2374 ansi_process_s("\r\n");
2377 2375 forward_data();
2378 2376 }
2379 2377  
2380   -static void
2381   -do_lnext(char c)
  2378 +static void do_lnext(H3270 *hSession, char c)
2382 2379 {
2383   - if (h3270.lnext) {
  2380 + if (hSession->lnext) {
2384 2381 do_data(c);
2385 2382 return;
2386 2383 }
2387   - h3270.lnext = 1;
  2384 + hSession->lnext = 1;
2388 2385 ansi_process_s("^\b");
2389 2386 }
2390 2387 #endif /*]*/
... ... @@ -2679,7 +2676,7 @@ net_output(void)
2679 2676  
2680 2677 /* Check for sending a TN3270E response. */
2681 2678 if (h3270.response_required == TN3270E_RSF_ALWAYS_RESPONSE) {
2682   - tn3270e_ack();
  2679 + tn3270e_ack(&h3270);
2683 2680 h3270.response_required = TN3270E_RSF_NO_RESPONSE;
2684 2681 }
2685 2682  
... ... @@ -2727,11 +2724,10 @@ net_output(void)
2727 2724  
2728 2725 #if defined(X3270_TN3270E) /*[*/
2729 2726 /* Send a TN3270E positive response to the server. */
2730   -static void
2731   -tn3270e_ack(void)
  2727 +static void tn3270e_ack(H3270 *hSession)
2732 2728 {
2733 2729 unsigned char rsp_buf[10];
2734   - tn3270e_header *h_in = (tn3270e_header *) h3270.ibuf;
  2730 + tn3270e_header *h_in = (tn3270e_header *) hSession->ibuf;
2735 2731 int rsp_len = 0;
2736 2732  
2737 2733 rsp_len = 0;
... ... @@ -2739,26 +2735,28 @@ tn3270e_ack(void)
2739 2735 rsp_buf[rsp_len++] = 0; /* request_flag */
2740 2736 rsp_buf[rsp_len++] = TN3270E_RSF_POSITIVE_RESPONSE; /* response_flag */
2741 2737 rsp_buf[rsp_len++] = h_in->seq_number[0]; /* seq_number[0] */
  2738 +
2742 2739 if (h_in->seq_number[0] == IAC)
2743 2740 rsp_buf[rsp_len++] = IAC;
  2741 +
2744 2742 rsp_buf[rsp_len++] = h_in->seq_number[1]; /* seq_number[1] */
  2743 +
2745 2744 if (h_in->seq_number[1] == IAC)
2746 2745 rsp_buf[rsp_len++] = IAC;
  2746 +
2747 2747 rsp_buf[rsp_len++] = TN3270E_POS_DEVICE_END;
2748 2748 rsp_buf[rsp_len++] = IAC;
2749 2749 rsp_buf[rsp_len++] = EOR;
2750   - trace_dsn("SENT TN3270E(RESPONSE POSITIVE-RESPONSE "
2751   - "%u) DEVICE-END\n",
  2750 + trace_dsn("SENT TN3270E(RESPONSE POSITIVE-RESPONSE %u) DEVICE-END\n",
2752 2751 h_in->seq_number[0] << 8 | h_in->seq_number[1]);
2753   - net_rawout(&h3270, rsp_buf, rsp_len);
  2752 + net_rawout(hSession, rsp_buf, rsp_len);
2754 2753 }
2755 2754  
2756 2755 /* Send a TN3270E negative response to the server. */
2757   -static void
2758   -tn3270e_nak(enum pds rv)
  2756 +static void tn3270e_nak(H3270 *hSession, enum pds rv)
2759 2757 {
2760 2758 unsigned char rsp_buf[10];
2761   - tn3270e_header *h_in = (tn3270e_header *) h3270.ibuf;
  2759 + tn3270e_header *h_in = (tn3270e_header *) hSession->ibuf;
2762 2760 int rsp_len = 0;
2763 2761 char *neg = NULL;
2764 2762  
... ... @@ -2785,7 +2783,7 @@ tn3270e_nak(enum pds rv)
2785 2783 rsp_buf[rsp_len++] = IAC;
2786 2784 rsp_buf[rsp_len++] = EOR;
2787 2785 trace_dsn("SENT TN3270E(RESPONSE NEGATIVE-RESPONSE %u) %s\n",h_in->seq_number[0] << 8 | h_in->seq_number[1], neg);
2788   - net_rawout(&h3270, rsp_buf, rsp_len);
  2786 + net_rawout(hSession, rsp_buf, rsp_len);
2789 2787 }
2790 2788  
2791 2789 #if defined(X3270_TRACE) /*[*/
... ... @@ -2908,7 +2906,7 @@ net_send_werase(void)
2908 2906 #if defined(X3270_MENUS) /*[*/
2909 2907 /*
2910 2908 * External entry points to negotiate line or character mode.
2911   - */
  2909 + */ /*
2912 2910 void
2913 2911 net_linemode(void)
2914 2912 {
... ... @@ -2925,6 +2923,7 @@ net_linemode(void)
2925 2923 trace_dsn("SENT %s %s\n", cmd(DONT), opt(TELOPT_SGA));
2926 2924 }
2927 2925 }
  2926 +*/
2928 2927  
2929 2928 void
2930 2929 net_charmode(void)
... ... @@ -3044,7 +3043,7 @@ parse_ctlchar(char *s)
3044 3043 /*
3045 3044 * net_linemode_chars
3046 3045 * Report line-mode characters.
3047   - */
  3046 + */ /*
3048 3047 struct ctl_char *
3049 3048 net_linemode_chars(void)
3050 3049 {
... ... @@ -3061,14 +3060,14 @@ net_linemode_chars(void)
3061 3060 c[8].name = 0;
3062 3061  
3063 3062 return c;
3064   -}
  3063 +} */
3065 3064 #endif /*]*/
3066 3065  
3067 3066 #if defined(X3270_TRACE) /*[*/
3068 3067 /*
3069 3068 * Construct a string to reproduce the current TELNET options.
3070 3069 * Returns a Boolean indicating whether it is necessary.
3071   - */
  3070 + */ /*
3072 3071 Boolean
3073 3072 net_snap_options(void)
3074 3073 {
... ... @@ -3084,7 +3083,7 @@ net_snap_options(void)
3084 3083  
3085 3084 h3270.obptr = h3270.obuf;
3086 3085  
3087   - /* Do TTYPE first. */
  3086 + // Do TTYPE first.
3088 3087 if (h3270.myopts[TELOPT_TTYPE]) {
3089 3088 unsigned j;
3090 3089  
... ... @@ -3093,7 +3092,7 @@ net_snap_options(void)
3093 3092 *h3270.obptr++ = ttype_str[j];
3094 3093 }
3095 3094  
3096   - /* Do the other options. */
  3095 + // Do the other options.
3097 3096 for (i = 0; i < LIB3270_TELNET_N_OPTS; i++) {
3098 3097 space3270out(6);
3099 3098 if (i == TELOPT_TTYPE)
... ... @@ -3112,8 +3111,8 @@ net_snap_options(void)
3112 3111 }
3113 3112 }
3114 3113  
3115   -#if defined(X3270_TN3270E) /*[*/
3116   - /* If we're in TN3270E mode, snap the subnegotations as well. */
  3114 +#if defined(X3270_TN3270E)
  3115 + // If we're in TN3270E mode, snap the subnegotations as well.
3117 3116 if (h3270.myopts[TELOPT_TN3270E]) {
3118 3117 any = True;
3119 3118  
... ... @@ -3160,15 +3159,17 @@ net_snap_options(void)
3160 3159 h->seq_number[0] = 0;
3161 3160 h->seq_number[1] = 0;
3162 3161 h3270.obptr += EH_SIZE;
3163   - *h3270.obptr++ = 1; /* dummy */
  3162 + *h3270.obptr++ = 1; // dummy
3164 3163 *h3270.obptr++ = IAC;
3165 3164 *h3270.obptr++ = EOR;
3166 3165 }
3167 3166 }
3168   -#endif /*]*/
  3167 +#endif
3169 3168 return any;
3170 3169 }
3171   -#endif /*]*/
  3170 +*/
  3171 +#endif
  3172 +
3172 3173  
3173 3174 /*
3174 3175 * Set blocking/non-blocking mode on the socket. On error, pops up an error
... ... @@ -3436,7 +3437,7 @@ int net_getsockname(const H3270 *session, void *buf, int *len)
3436 3437 return getsockname(session->sock, buf, (socklen_t *)(void *)len);
3437 3438 }
3438 3439  
3439   -/* Return a text version of the current proxy type, or NULL. */
  3440 +/* Return a text version of the current proxy type, or NULL. */ /*
3440 3441 char *
3441 3442 net_proxy_type(void)
3442 3443 {
... ... @@ -3445,8 +3446,9 @@ net_proxy_type(void)
3445 3446 else
3446 3447 return NULL;
3447 3448 }
  3449 +*/
3448 3450  
3449   -/* Return the current proxy host, or NULL. */
  3451 +/* Return the current proxy host, or NULL. */ /*
3450 3452 char *
3451 3453 net_proxy_host(void)
3452 3454 {
... ... @@ -3455,8 +3457,9 @@ net_proxy_host(void)
3455 3457 else
3456 3458 return NULL;
3457 3459 }
  3460 +*/
3458 3461  
3459   -/* Return the current proxy port, or NULL. */
  3462 +/* Return the current proxy port, or NULL. */ /*
3460 3463 char *
3461 3464 net_proxy_port(void)
3462 3465 {
... ... @@ -3465,6 +3468,7 @@ net_proxy_port(void)
3465 3468 else
3466 3469 return NULL;
3467 3470 }
  3471 +*/
3468 3472  
3469 3473 LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session)
3470 3474 {
... ...
telnetc.h
... ... @@ -40,8 +40,8 @@ LIB3270_INTERNAL void net_exception(H3270 *session);
40 40 // LIB3270_INTERNAL void net_hexansi_out(unsigned char *buf, int len);
41 41 LIB3270_INTERNAL void net_input(H3270 *session);
42 42 LIB3270_INTERNAL void net_interrupt(void);
43   -LIB3270_INTERNAL void net_linemode(void);
44   -LIB3270_INTERNAL struct ctl_char *net_linemode_chars(void);
  43 +// LIB3270_INTERNAL void net_linemode(void);
  44 +// LIB3270_INTERNAL struct ctl_char *net_linemode_chars(void);
45 45 LIB3270_INTERNAL void net_output(void);
46 46 LIB3270_INTERNAL const char *net_query_bind_plu_name(void);
47 47 LIB3270_INTERNAL const char *net_query_connection_state(void);
... ... @@ -52,12 +52,12 @@ LIB3270_INTERNAL void net_sends(const char *s);
52 52 LIB3270_INTERNAL void net_send_erase(void);
53 53 LIB3270_INTERNAL void net_send_kill(void);
54 54 LIB3270_INTERNAL void net_send_werase(void);
55   -LIB3270_INTERNAL Boolean net_snap_options(void);
  55 +// LIB3270_INTERNAL Boolean net_snap_options(void);
56 56 LIB3270_INTERNAL void space3270out(int n);
57 57 // LIB3270_INTERNAL const char *tn3270e_current_opts(void);
58   -LIB3270_INTERNAL char *net_proxy_type(void);
59   -LIB3270_INTERNAL char *net_proxy_host(void);
60   -LIB3270_INTERNAL char *net_proxy_port(void);
  58 +// LIB3270_INTERNAL char *net_proxy_type(void);
  59 +//LIB3270_INTERNAL char *net_proxy_host(void);
  60 +// LIB3270_INTERNAL char *net_proxy_port(void);
61 61  
62 62 #if defined(X3270_TRACE)
63 63 LIB3270_INTERNAL void trace_netdata(char direction, unsigned const char *buf, int len);
... ...