Commit 610c78d4ddaeba0cd0474afd382528c96efd079f
1 parent
fb22e6a1
Exists in
master
and in
3 other branches
Updating data types while trying to identify screen size detection
problem in some machines.
Showing
6 changed files
with
21 additions
and
22 deletions
Show diff stats
src/include/api.h
| @@ -219,7 +219,6 @@ | @@ -219,7 +219,6 @@ | ||
| 219 | LOCAL_EXTERN void screen_size(int *rows, int *cols); | 219 | LOCAL_EXTERN void screen_size(int *rows, int *cols); |
| 220 | 220 | ||
| 221 | #define lib3270_paste_string(str) lib3270_set_string(NULL,str) | 221 | #define lib3270_paste_string(str) lib3270_set_string(NULL,str) |
| 222 | - #define get_3270_terminal_size(h,r,c) lib3270_get_screen_size(h,r,c) | ||
| 223 | 222 | ||
| 224 | /* Keyboard */ | 223 | /* Keyboard */ |
| 225 | LOCAL_EXTERN int emulate_input(char *s, int len, int pasting); | 224 | LOCAL_EXTERN int emulate_input(char *s, int len, int pasting); |
src/include/ctlrc.h
| @@ -67,7 +67,7 @@ LIB3270_INTERNAL void mdt_set(H3270 *hSession, int baddr); | @@ -67,7 +67,7 @@ LIB3270_INTERNAL void mdt_set(H3270 *hSession, int baddr); | ||
| 67 | LIB3270_INTERNAL enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen); | 67 | LIB3270_INTERNAL enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen); |
| 68 | LIB3270_INTERNAL void ps_process(H3270 *hSession); | 68 | LIB3270_INTERNAL void ps_process(H3270 *hSession); |
| 69 | 69 | ||
| 70 | -LIB3270_INTERNAL void update_model_info(H3270 *session, int model, int cols, int rows); | 70 | +LIB3270_INTERNAL void update_model_info(H3270 *session, unsigned int model, unsigned int cols, unsigned int rows); |
| 71 | LIB3270_INTERNAL void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr); | 71 | LIB3270_INTERNAL void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr); |
| 72 | LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt); | 72 | LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt); |
| 73 | 73 |
src/include/lib3270.h
| @@ -409,7 +409,7 @@ | @@ -409,7 +409,7 @@ | ||
| 409 | * @param c Pointer to screen columns. | 409 | * @param c Pointer to screen columns. |
| 410 | * | 410 | * |
| 411 | */ | 411 | */ |
| 412 | - LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, int *r, int *c); | 412 | + LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, unsigned int *r, unsigned int *c); |
| 413 | 413 | ||
| 414 | /** | 414 | /** |
| 415 | * Get current screen width in columns. | 415 | * Get current screen width in columns. |
| @@ -419,7 +419,7 @@ | @@ -419,7 +419,7 @@ | ||
| 419 | * @return screen width. | 419 | * @return screen width. |
| 420 | * | 420 | * |
| 421 | */ | 421 | */ |
| 422 | - LIB3270_EXPORT int lib3270_get_width(H3270 *h); | 422 | + LIB3270_EXPORT unsigned int lib3270_get_width(H3270 *h); |
| 423 | 423 | ||
| 424 | /** | 424 | /** |
| 425 | * Get current screen width in rows. | 425 | * Get current screen width in rows. |
| @@ -429,9 +429,9 @@ | @@ -429,9 +429,9 @@ | ||
| 429 | * @return screen rows. | 429 | * @return screen rows. |
| 430 | * | 430 | * |
| 431 | */ | 431 | */ |
| 432 | - LIB3270_EXPORT int lib3270_get_height(H3270 *h); | 432 | + LIB3270_EXPORT unsigned int lib3270_get_height(H3270 *h); |
| 433 | 433 | ||
| 434 | - LIB3270_EXPORT int lib3270_get_length(H3270 *h); | 434 | + LIB3270_EXPORT unsigned int lib3270_get_length(H3270 *h); |
| 435 | 435 | ||
| 436 | /** | 436 | /** |
| 437 | * @brief Creates an empty TN3270 session. | 437 | * @brief Creates an empty TN3270 session. |
src/lib3270/private.h
| @@ -363,7 +363,7 @@ struct _h3270 | @@ -363,7 +363,7 @@ struct _h3270 | ||
| 363 | 363 | ||
| 364 | char full_model_name[LIB3270_FULL_MODEL_NAME_LENGTH+1]; | 364 | char full_model_name[LIB3270_FULL_MODEL_NAME_LENGTH+1]; |
| 365 | char * model_name; | 365 | char * model_name; |
| 366 | - int model_num; | 366 | + unsigned int model_num; |
| 367 | char * termtype; | 367 | char * termtype; |
| 368 | 368 | ||
| 369 | struct | 369 | struct |
| @@ -391,13 +391,13 @@ struct _h3270 | @@ -391,13 +391,13 @@ struct _h3270 | ||
| 391 | H3270FT * ft; /**< @brief Active file transfer data */ | 391 | H3270FT * ft; /**< @brief Active file transfer data */ |
| 392 | 392 | ||
| 393 | // screen info | 393 | // screen info |
| 394 | - int ov_rows; | ||
| 395 | - int ov_cols; | ||
| 396 | - int maxROWS; | ||
| 397 | - int maxCOLS; | ||
| 398 | - unsigned short rows; | ||
| 399 | - unsigned short cols; | ||
| 400 | - unsigned short pointer; /**< @brief Current pointer. */ | 394 | + unsigned int ov_rows; |
| 395 | + unsigned int ov_cols; | ||
| 396 | + unsigned int maxROWS; | ||
| 397 | + unsigned int maxCOLS; | ||
| 398 | + unsigned int rows; | ||
| 399 | + unsigned int cols; | ||
| 400 | + LIB3270_POINTER pointer; /**< @brief Current pointer. */ | ||
| 401 | int cursor_addr; | 401 | int cursor_addr; |
| 402 | int buffer_addr; | 402 | int buffer_addr; |
| 403 | char flipped; | 403 | char flipped; |
src/lib3270/screen.c
| @@ -244,13 +244,13 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) | @@ -244,13 +244,13 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) | ||
| 244 | return a; | 244 | return a; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | -LIB3270_EXPORT int lib3270_get_length(H3270 *h) | 247 | +LIB3270_EXPORT unsigned int lib3270_get_length(H3270 *h) |
| 248 | { | 248 | { |
| 249 | CHECK_SESSION_HANDLE(h); | 249 | CHECK_SESSION_HANDLE(h); |
| 250 | return h->rows * h->cols; | 250 | return h->rows * h->cols; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | -LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, int *r, int *c) | 253 | +LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, unsigned int *r, unsigned int *c) |
| 254 | { | 254 | { |
| 255 | CHECK_SESSION_HANDLE(h); | 255 | CHECK_SESSION_HANDLE(h); |
| 256 | *r = h->rows; | 256 | *r = h->rows; |
| @@ -260,19 +260,19 @@ LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, int *r, int *c) | @@ -260,19 +260,19 @@ LIB3270_EXPORT void lib3270_get_screen_size(H3270 *h, int *r, int *c) | ||
| 260 | 260 | ||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | -LIB3270_EXPORT int lib3270_get_width(H3270 *h) | 263 | +LIB3270_EXPORT unsigned int lib3270_get_width(H3270 *h) |
| 264 | { | 264 | { |
| 265 | CHECK_SESSION_HANDLE(h); | 265 | CHECK_SESSION_HANDLE(h); |
| 266 | return h->cols; | 266 | return h->cols; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | -LIB3270_EXPORT int lib3270_get_height(H3270 *h) | 269 | +LIB3270_EXPORT unsigned int lib3270_get_height(H3270 *h) |
| 270 | { | 270 | { |
| 271 | CHECK_SESSION_HANDLE(h); | 271 | CHECK_SESSION_HANDLE(h); |
| 272 | return h->rows; | 272 | return h->rows; |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | -void update_model_info(H3270 *session, int model, int cols, int rows) | 275 | +void update_model_info(H3270 *session, unsigned int model, unsigned int cols, unsigned int rows) |
| 276 | { | 276 | { |
| 277 | if(model == session->model_num && session->maxROWS == rows && session->maxCOLS == cols) | 277 | if(model == session->model_num && session->maxROWS == rows && session->maxCOLS == cols) |
| 278 | return; | 278 | return; |
src/lib3270/trace_ds.c
| @@ -260,11 +260,11 @@ void trace_screen(H3270 *session) | @@ -260,11 +260,11 @@ void trace_screen(H3270 *session) | ||
| 260 | 260 | ||
| 261 | if (lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) | 261 | if (lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) |
| 262 | { | 262 | { |
| 263 | - int row, baddr; | 263 | + unsigned int row, baddr; |
| 264 | 264 | ||
| 265 | for(row=baddr=0;row < session->rows;row++) | 265 | for(row=baddr=0;row < session->rows;row++) |
| 266 | { | 266 | { |
| 267 | - int col; | 267 | + unsigned int col; |
| 268 | wtrace(session,"%02d ",row+1); | 268 | wtrace(session,"%02d ",row+1); |
| 269 | 269 | ||
| 270 | for(col = 0; col < session->cols;col++) | 270 | for(col = 0; col < session->cols;col++) |
| @@ -302,7 +302,7 @@ void trace_char(H3270 *hSession, char c) | @@ -302,7 +302,7 @@ void trace_char(H3270 *hSession, char c) | ||
| 302 | */ | 302 | */ |
| 303 | void trace_ansi_disc(H3270 *hSession) | 303 | void trace_ansi_disc(H3270 *hSession) |
| 304 | { | 304 | { |
| 305 | - int i; | 305 | + unsigned int i; |
| 306 | 306 | ||
| 307 | wtrace(hSession,"%c",'\n'); | 307 | wtrace(hSession,"%c",'\n'); |
| 308 | for (i = 0; i < hSession->cols; i++) | 308 | for (i = 0; i < hSession->cols; i++) |