Commit ee5183e32558ecaa91f9eec6515fc8b63c2f8556

Authored by Perry Werneck
1 parent 880e5609

Fixing test pattern.

Fixing some build warmings.
rpm/lib3270.spec
... ... @@ -122,7 +122,8 @@ See more details at https://softwarepublico.gov.br/social/pw3270/
122 122 NOCONFIGURE=1 ./autogen.sh
123 123  
124 124 %configure \
125   - --with-sdk-version=%{version}
  125 + --with-sdk-version=%{version} \
  126 + --disable-static
126 127  
127 128 %build
128 129 make clean
... ... @@ -158,7 +159,6 @@ rm -rf $RPM_BUILD_ROOT
158 159  
159 160 %{_libdir}/pkgconfig/*.pc
160 161 %{_libdir}/*.so
161   -%{_libdir}/*.a
162 162  
163 163 %dir %{_datadir}/pw3270/pot
164 164 %{_datadir}/pw3270/pot/*.pot
... ...
src/include/lib3270.h
... ... @@ -664,7 +664,7 @@
664 664 * @return Current address or -1 if invalid (sets errno).
665 665 *
666 666 */
667   - LIB3270_EXPORT int lib3270_translate_to_address(H3270 *hSession, int row, int col);
  667 + LIB3270_EXPORT int lib3270_translate_to_address(H3270 *hSession, unsigned int row, unsigned int col);
668 668  
669 669 /**
670 670 * @brief Set string at current cursor position.
... ... @@ -719,7 +719,7 @@
719 719 *
720 720 * @return Old cursor address or -1 in case of error (sets errno).
721 721 */
722   - LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *hSession, int baddr);
  722 + LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *hSession, unsigned int baddr);
723 723  
724 724 /**
725 725 * @brief Set cursor position.
... ... @@ -731,7 +731,7 @@
731 731 * @return last cursor address or -1 if invalid (sets errno).
732 732 *
733 733 */
734   - LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *h, int row, int col);
  734 + LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *h, unsigned int row, unsigned int col);
735 735  
736 736 /**
737 737 * @brief Get cursor address.
... ... @@ -1174,7 +1174,7 @@
1174 1174 * @return 0 if ok, -1 if fails (sets errno).
1175 1175 *
1176 1176 */
1177   - LIB3270_EXPORT int lib3270_get_element(H3270 *h, int baddr, unsigned char *c, unsigned short *attr);
  1177 + LIB3270_EXPORT int lib3270_get_element(H3270 *h, unsigned int baddr, unsigned char *c, unsigned short *attr);
1178 1178  
1179 1179 /**
1180 1180 * @brief Check if the informed addr is marked as selected.
... ... @@ -1185,7 +1185,7 @@
1185 1185 * @return >0 zero if element is selected, 0 if not, -1 if fails (sets errno).
1186 1186 *
1187 1187 */
1188   - LIB3270_EXPORT int lib3270_is_selected(H3270 *hSession, int baddr);
  1188 + LIB3270_EXPORT int lib3270_is_selected(H3270 *hSession, unsigned int baddr);
1189 1189  
1190 1190 /**
1191 1191 * @brief Get attribute at the requested ADDR.
... ... @@ -1196,7 +1196,7 @@
1196 1196 * @return Attribute of the required address or -1 if failed.
1197 1197 *
1198 1198 */
1199   - LIB3270_EXPORT LIB3270_ATTR lib3270_get_attribute_at_address(H3270 *hSession, int baddr);
  1199 + LIB3270_EXPORT LIB3270_ATTR lib3270_get_attribute_at_address(H3270 *hSession, unsigned int baddr);
1200 1200  
1201 1201 /**
1202 1202 * Get field region
... ...
src/include/screenc.h
... ... @@ -49,7 +49,7 @@ LIB3270_INTERNAL void mcursor_set(H3270 *session,LIB3270_POINTER m);
49 49 #define mcursor_waiting(x) mcursor_set(x,LIB3270_POINTER_WAITING)
50 50  
51 51 LIB3270_INTERNAL void notify_toggle_changed(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason);
52   -LIB3270_INTERNAL void set_viewsize(H3270 *session, int rows, int cols);
  52 +LIB3270_INTERNAL void set_viewsize(H3270 *session, unsigned int rows, unsigned int cols);
53 53  
54 54 // LIB3270_INTERNAL Boolean escaped;
55 55  
... ...
src/lib3270/screen.c
... ... @@ -93,12 +93,12 @@ static void addch(H3270 *session, int baddr, unsigned char c, unsigned short att
93 93 session->cbk.update(session,baddr,c,attr,baddr == session->cursor_addr);
94 94 }
95 95  
96   -LIB3270_EXPORT LIB3270_ATTR lib3270_get_attribute_at_address(H3270 *hSession, int baddr)
  96 +LIB3270_EXPORT LIB3270_ATTR lib3270_get_attribute_at_address(H3270 *hSession, unsigned int baddr)
97 97 {
98 98 if(check_online_session(hSession))
99 99 return (LIB3270_ATTR) -1;
100 100  
101   - if(!hSession->text || baddr < 0 || baddr > (hSession->rows*hSession->cols))
  101 + if(!hSession->text ||baddr > (hSession->rows*hSession->cols))
102 102 {
103 103 errno = EINVAL;
104 104 return (LIB3270_ATTR) -1;
... ... @@ -107,11 +107,11 @@ LIB3270_EXPORT LIB3270_ATTR lib3270_get_attribute_at_address(H3270 *hSession, in
107 107 return hSession->text[baddr].attr;
108 108 }
109 109  
110   -LIB3270_EXPORT int lib3270_is_selected(H3270 *hSession, int baddr)
  110 +LIB3270_EXPORT int lib3270_is_selected(H3270 *hSession, unsigned int baddr)
111 111 {
112 112 FAIL_IF_NOT_ONLINE(hSession);
113 113  
114   - if(!hSession->text || baddr < 0 || baddr > (hSession->rows*hSession->cols))
  114 + if(!hSession->text || baddr > (hSession->rows*hSession->cols))
115 115 {
116 116 errno = EINVAL;
117 117 return -1;
... ... @@ -120,11 +120,11 @@ LIB3270_EXPORT int lib3270_is_selected(H3270 *hSession, int baddr)
120 120 return (hSession->text[baddr].attr & LIB3270_ATTR_SELECTED) != 0;
121 121 }
122 122  
123   -LIB3270_EXPORT int lib3270_get_element(H3270 *hSession, int baddr, unsigned char *c, unsigned short *attr)
  123 +LIB3270_EXPORT int lib3270_get_element(H3270 *hSession, unsigned int baddr, unsigned char *c, unsigned short *attr)
124 124 {
125 125 FAIL_IF_NOT_ONLINE(hSession);
126 126  
127   - if(!hSession->text || baddr < 0 || baddr > (hSession->rows*hSession->cols))
  127 + if(!hSession->text || baddr > (hSession->rows*hSession->cols))
128 128 {
129 129 errno = EINVAL;
130 130 return -1;
... ... @@ -420,14 +420,14 @@ LIB3270_EXPORT int lib3270_get_cursor_address(H3270 *h)
420 420 * @return Current address or -1 if invalid (sets errno).
421 421 *
422 422 */
423   -LIB3270_EXPORT int lib3270_translate_to_address(H3270 *hSession, int row, int col)
  423 +LIB3270_EXPORT int lib3270_translate_to_address(H3270 *hSession, unsigned int row, unsigned int col)
424 424 {
425 425 FAIL_IF_NOT_ONLINE(hSession);
426 426  
427 427 row--;
428 428 col--;
429 429  
430   - if(row < 0 || col < 0 || row > hSession->rows || col > hSession->cols)
  430 + if(row > hSession->rows || col > hSession->cols)
431 431 {
432 432 // Invalid coordinates
433 433 errno = EINVAL;
... ... @@ -449,13 +449,13 @@ LIB3270_EXPORT int lib3270_translate_to_address(H3270 *hSession, int row, int co
449 449 * @return Old cursor address or -1 in case of error (sets errno).
450 450 *
451 451 */
452   -LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *hSession, int baddr)
  452 +LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *hSession, unsigned int baddr)
453 453 {
454 454 FAIL_IF_NOT_ONLINE(hSession);
455 455  
456 456 trace("%s(%d)",__FUNCTION__,baddr);
457 457  
458   - if(baddr < 0 || baddr > (hSession->rows * hSession->cols))
  458 + if(baddr > (hSession->rows * hSession->cols))
459 459 {
460 460 errno = EINVAL;
461 461 return -1;
... ... @@ -479,7 +479,7 @@ LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *hSession, int baddr)
479 479 * @return Old cursor address or -1 in case of error (sets errno).
480 480 *
481 481 */
482   -LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *hSession, int row, int col)
  482 +LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *hSession, unsigned int row, unsigned int col)
483 483 {
484 484 return lib3270_set_cursor_address(hSession,lib3270_translate_to_address(hSession, row, col));
485 485  
... ... @@ -701,7 +701,7 @@ void status_twait(H3270 *session)
701 701 status_changed(session,LIB3270_MESSAGE_TWAIT);
702 702 }
703 703  
704   -void set_viewsize(H3270 *session, int rows, int cols)
  704 +void set_viewsize(H3270 *session, unsigned int rows, unsigned int cols)
705 705 {
706 706 CHECK_SESSION_HANDLE(session);
707 707  
... ... @@ -947,7 +947,7 @@ LIB3270_EXPORT int lib3270_testpattern(H3270 *hSession)
947 947 int f;
948 948 int fg = COLOR_BLUE;
949 949  
950   - FAIL_IF_NOT_ONLINE(hSession);
  950 + FAIL_IF_ONLINE(hSession);
951 951  
952 952 max = (hSession->maxROWS * hSession->maxCOLS);
953 953 for(f=0;f<max;f++)
... ...