Commit 26ded741ccbe047e2412914215d7c9727fc4cfad

Authored by perry.werneck@gmail.com
1 parent 83bd5a96

Removendo warning durante a compilacao da lib em windows

src/lib3270/appres.h
@@ -228,7 +228,7 @@ typedef struct { @@ -228,7 +228,7 @@ typedef struct {
228 228
229 } AppRes, *AppResptr; 229 } AppRes, *AppResptr;
230 230
231 -LIB3270_INTERNAL AppRes appres; 231 +extern AppRes appres;
232 232
233 // FIXME (perry#2#): Check for right implementation 233 // FIXME (perry#2#): Check for right implementation
234 #define _( x ) x 234 #define _( x ) x
src/lib3270/ctlr.c
@@ -2841,6 +2841,7 @@ toggle_nop(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt unuse @@ -2841,6 +2841,7 @@ toggle_nop(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt unuse
2841 { 2841 {
2842 } 2842 }
2843 2843
  2844 +/*
2844 int ctlr_get_rows(void) 2845 int ctlr_get_rows(void)
2845 { 2846 {
2846 return h3270.rows; 2847 return h3270.rows;
@@ -2850,4 +2851,4 @@ int ctlr_get_cols(void) @@ -2850,4 +2851,4 @@ int ctlr_get_cols(void)
2850 { 2851 {
2851 return h3270.cols; 2852 return h3270.cols;
2852 } 2853 }
2853 - 2854 +*/
src/lib3270/ctlr.h
@@ -17,8 +17,5 @@ @@ -17,8 +17,5 @@
17 * External declarations for ctlr.c data structures. 17 * External declarations for ctlr.c data structures.
18 */ 18 */
19 19
20 -LIB3270_INTERNAL int buffer_addr; /**< buffer address */  
21 -// LIB3270_INTERNAL int cursor_addr; /**< cursor address */  
22 -LIB3270_INTERNAL struct ea *ea_buf; /**< 3270 device buffer */  
23 -//LIB3270_INTERNAL Boolean formatted; /**< contains at least one field? */  
24 -//LIB3270_INTERNAL Boolean is_altbuffer; /**< in alternate-buffer mode? */ 20 +extern int buffer_addr; /**< buffer address */
  21 +extern struct ea *ea_buf; /**< 3270 device buffer */
src/lib3270/ftc.h
@@ -24,7 +24,7 @@ LIB3270_INTERNAL Boolean ascii_flag; @@ -24,7 +24,7 @@ LIB3270_INTERNAL Boolean ascii_flag;
24 LIB3270_INTERNAL Boolean cr_flag; 24 LIB3270_INTERNAL Boolean cr_flag;
25 LIB3270_INTERNAL unsigned long ft_length; 25 LIB3270_INTERNAL unsigned long ft_length;
26 LIB3270_INTERNAL FILE *ft_local_file; 26 LIB3270_INTERNAL FILE *ft_local_file;
27 -LIB3270_INTERNAL char *ft_local_filename; 27 +extern char *ft_local_filename;
28 28
29 LIB3270_INTERNAL Boolean ft_last_cr; 29 LIB3270_INTERNAL Boolean ft_last_cr;
30 LIB3270_INTERNAL Boolean remap_flag; 30 LIB3270_INTERNAL Boolean remap_flag;
src/lib3270/globals.h
@@ -145,7 +145,7 @@ enum iaction { @@ -145,7 +145,7 @@ enum iaction {
145 145
146 LIB3270_INTERNAL int COLS; 146 LIB3270_INTERNAL int COLS;
147 LIB3270_INTERNAL int ROWS; 147 LIB3270_INTERNAL int ROWS;
148 -LIB3270_INTERNAL H3270 h3270; 148 +extern H3270 h3270;
149 149
150 #if defined(X3270_DISPLAY) /*[*/ 150 #if defined(X3270_DISPLAY) /*[*/
151 LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding; 151 LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding;
@@ -209,7 +209,7 @@ LIB3270_INTERNAL Boolean no_login_host; @@ -209,7 +209,7 @@ LIB3270_INTERNAL Boolean no_login_host;
209 LIB3270_INTERNAL Boolean non_tn3270e_host; 209 LIB3270_INTERNAL Boolean non_tn3270e_host;
210 // LIB3270_INTERNAL int ov_cols, ov_rows; 210 // LIB3270_INTERNAL int ov_cols, ov_rows;
211 LIB3270_INTERNAL Boolean passthru_host; 211 LIB3270_INTERNAL Boolean passthru_host;
212 -LIB3270_INTERNAL const char *programname; 212 +extern const char *programname;
213 LIB3270_INTERNAL char *qualified_host; 213 LIB3270_INTERNAL char *qualified_host;
214 LIB3270_INTERNAL char *reconnect_host; 214 LIB3270_INTERNAL char *reconnect_host;
215 LIB3270_INTERNAL int screen_depth; 215 LIB3270_INTERNAL int screen_depth;
src/lib3270/printer.c
@@ -438,8 +438,7 @@ printer_start(const char *lu) @@ -438,8 +438,7 @@ printer_start(const char *lu)
438 NULL, 438 NULL,
439 &startupinfo, 439 &startupinfo,
440 &process_information) == 0) { 440 &process_information) == 0) {
441 - popup_an_error("CreateProcess(%s) failed: %s", subcommand,  
442 - win32_strerror(GetLastError())); 441 + popup_an_error(NULL,"CreateProcess(%s) failed: %s", subcommand,win32_strerror(GetLastError()));
443 } 442 }
444 printer_handle = process_information.hProcess; 443 printer_handle = process_information.hProcess;
445 CloseHandle(process_information.hThread); 444 CloseHandle(process_information.hThread);
@@ -599,8 +598,7 @@ printer_check(void) @@ -599,8 +598,7 @@ printer_check(void)
599 598
600 st_changed(ST_PRINTER, False); 599 st_changed(ST_PRINTER, False);
601 600
602 - popup_an_error("Printer process exited with status %d",  
603 - exit_code); 601 + popup_an_error(NULL,"Printer process exited with status %d",exit_code);
604 } 602 }
605 } 603 }
606 #endif /*]*/ 604 #endif /*]*/
src/lib3270/screen.c
@@ -688,6 +688,7 @@ void show_3270_popup_dialog(H3270 *session, LIB3270_NOTIFY type, const char *tit @@ -688,6 +688,7 @@ void show_3270_popup_dialog(H3270 *session, LIB3270_NOTIFY type, const char *tit
688 static int logpopup(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) 688 static int logpopup(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg)
689 { 689 {
690 lib3270_write_va_log(session,"lib3270",fmt,arg); 690 lib3270_write_va_log(session,"lib3270",fmt,arg);
  691 + return 0;
691 } 692 }
692 693
693 void Error(H3270 *session, const char *fmt, ...) 694 void Error(H3270 *session, const char *fmt, ...)
src/lib3270/selection.c
@@ -166,8 +166,6 @@ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session) @@ -166,8 +166,6 @@ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session)
166 166
167 for(a = 0; a < session->rows*session->cols; a++) 167 for(a = 0; a < session->rows*session->cols; a++)
168 { 168 {
169 - unsigned short attr = ea_buf[a].attr;  
170 -  
171 if(ea_buf[a].attr & LIB3270_ATTR_SELECTED) 169 if(ea_buf[a].attr & LIB3270_ATTR_SELECTED)
172 { 170 {
173 ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED; 171 ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED;
src/lib3270/telnet.c
@@ -390,33 +390,23 @@ static union { @@ -390,33 +390,23 @@ static union {
390 } haddr; 390 } haddr;
391 socklen_t ha_len = sizeof(haddr); 391 socklen_t ha_len = sizeof(haddr);
392 392
393 -#if defined(_WIN32)  
394 -void popup_a_sockerr(char *fmt, ...)  
395 -{  
396 - va_list args;  
397 - char buffer[4096];  
398 -  
399 - va_start(args, fmt);  
400 - vsprintf(buffer, fmt, args);  
401 - va_end(args);  
402 -  
403 - popup_system_error( N_( "Network error" ), buffer, win32_strerror(socket_errno()));  
404 -  
405 -}  
406 -#else  
407 void popup_a_sockerr(H3270 *session, char *fmt, ...) 393 void popup_a_sockerr(H3270 *session, char *fmt, ...)
408 { 394 {
  395 +#if defined(_WIN32)
  396 + const char *msg = win32_strerror(socket_errno());
  397 +#else
  398 + const char *msg = strerror(errno)
  399 +#endif // WIN32
409 va_list args; 400 va_list args;
410 char buffer[4096]; 401 char buffer[4096];
411 402
412 va_start(args, fmt); 403 va_start(args, fmt);
413 - vsprintf(buffer, fmt, args); 404 + vsnprintf(buffer, 4095, fmt, args);
414 va_end(args); 405 va_end(args);
415 406
416 - popup_system_error(session, N_( "Network error" ), buffer, strerror(errno)); 407 + popup_system_error(session, N_( "Network error" ), buffer, "%s", msg);
417 408
418 } 409 }
419 -#endif  
420 410
421 /* 411 /*
422 * net_connect 412 * net_connect
@@ -2780,8 +2770,7 @@ tn3270e_nak(enum pds rv) @@ -2780,8 +2770,7 @@ tn3270e_nak(enum pds rv)
2780 } 2770 }
2781 rsp_buf[rsp_len++] = IAC; 2771 rsp_buf[rsp_len++] = IAC;
2782 rsp_buf[rsp_len++] = EOR; 2772 rsp_buf[rsp_len++] = EOR;
2783 - trace_dsn("SENT TN3270E(RESPONSE NEGATIVE-RESPONSE %u) %s\n",  
2784 - h_in->seq_number[0] << 8 | h_in->seq_number[1], neg); 2773 + trace_dsn("SENT TN3270E(RESPONSE NEGATIVE-RESPONSE %u) %s\n",h_in->seq_number[0] << 8 | h_in->seq_number[1], neg);
2785 net_rawout(rsp_buf, rsp_len); 2774 net_rawout(rsp_buf, rsp_len);
2786 } 2775 }
2787 2776
src/lib3270/telnetc.h
@@ -20,7 +20,8 @@ @@ -20,7 +20,8 @@
20 */ 20 */
21 21
22 /* Output buffer. */ 22 /* Output buffer. */
23 -LIB3270_INTERNAL unsigned char *obuf, *obptr; 23 +extern unsigned char *obuf;
  24 +extern unsigned char *obptr;
24 25
25 /* Spelled-out tty control character. */ 26 /* Spelled-out tty control character. */
26 struct ctl_char { 27 struct ctl_char {