From fa53273fe03e111aa0aecaa448573e9f3171b4d9 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 6 Jun 2003 13:50:22 +0000 Subject: [PATCH] Patch level : 2.0 nopatch Files correlati : Ricompilazione Demo : [ ] Commento : Compilazione Linux git-svn-id: svn://10.65.10.50/trunk@11220 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xi/xi.c | 68 +++++++++++++++++++++++++++++++++++++++++-------- xi/xi2.c | 59 +++++++++++++++++++++++++++--------------- xi/xicf.c | 10 ++++++-- xi/xidbg.c | 4 +++ xi/xilm.c | 10 ++++++-- xi/xilm2.c | 41 ++++++++++++++++------------- xi/xilm3.c | 39 ++++++++++++++++++---------- xi/xilmst.c | 5 ++-- xi/xiport.c | 61 +++++++++++++++++++++++++++++++------------- xi/xiport.h | 22 ++-------------- xi/xistx.c | 35 +++++++++++++------------ xi/xitext.c | 27 ++++++++++++-------- xi/xiutils.c | 68 +++++++++++++++++++++++++++++++++++++++++-------- xvaga/xvaga.cpp | 6 ++--- 14 files changed, 307 insertions(+), 148 deletions(-) diff --git a/xi/xi.c b/xi/xi.c index 2957ba7c1..abe54d826 100755 --- a/xi/xi.c +++ b/xi/xi.c @@ -443,9 +443,13 @@ control_event( XI_OBJ * itf, XinWindow win, XinEvent * ep ) xi_control_event_scroll( xi_obj, XI_SCROLL_FIRST, percent, TRUE ); break; } + default: + break; } break; } + default: + break; } } if ( xi_is_itf( itf ) && @@ -488,8 +492,12 @@ control_event( XI_OBJ * itf, XinWindow win, XinEvent * ep ) control_event_hscroll( xi_obj, XI_SCROLL_FIRST, pos ); break; } + default: + break; } break; + default: + break; } } } @@ -536,6 +544,8 @@ destroy_controls( XI_OBJ * xi_obj ) xi_bitmap_destroy( xi_obj->v.btn->down_bitmap ); xi_bitmap_destroy( xi_obj->v.btn->disabled_bitmap ); break; + default: + break; } objp = xi_obj->children; for ( i = xi_obj->nbr_children; i > 0; i--, objp++ ) @@ -637,6 +647,8 @@ do_edit_menu( XI_OBJ * itf, XinEvent * ep ) attrib = xi_get_attrib( column ); break; } + default: + break; } if ( attrib & XI_ATR_EDITMENU ) { @@ -1195,7 +1207,7 @@ xi_draw_field_button( XI_OBJ * xi_obj ) r.top++; r.left++; r.bottom--; - r.right--; + r.right--; if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) ) xi_draw_3d_rect(win, &r, fd->down, 2, color_light, color_ctrl, color_dark); else @@ -1354,6 +1366,9 @@ field_event( XI_OBJ * xi_obj, XinEvent * ep ) } } break; + default: + break; + } } @@ -1459,8 +1474,10 @@ form_event( XI_OBJ * xi_obj, XinEvent * ep ) static BOOLEAN invalidate_button_rect( XI_OBJ * xi_obj, XI_BTN_DATA * bd, XinRect * rct ) { - if ( ( bd->type == XIBT_BUTTON || bd->type == XIBT_BUTTON_CHECKBOX || - bd->type == XIBT_RADIOBTN ) && bd->drawable || bd->type == XIBT_TABBTN ) +// if (( bd->type == XIBT_BUTTON || bd->type == XIBT_BUTTON_CHECKBOX || +// bd->type == XIBT_RADIOBTN ) && bd->drawable || bd->type == XIBT_TABBTN) + if ((( bd->type == XIBT_BUTTON || bd->type == XIBT_BUTTON_CHECKBOX || + bd->type == XIBT_RADIOBTN ) && bd->drawable) || bd->type == XIBT_TABBTN) { XinRect r; XinWindow win; @@ -1603,6 +1620,8 @@ btn_event( XI_OBJ * xi_obj, XinEvent * ep ) } } break; + default: + break; } } ret_val = TRUE; @@ -1629,7 +1648,7 @@ draw_list_button( XinWindow win, XinRect * rct, BOOLEAN down ) r = *rct; xi_set_clip( win, NULL ); // XI forgot this! - + XinWindowPenSet( win, &black_cpen ); XinWindowBrushSet( win, &hollow_cbrush ); xi_draw_rect( win, &r ); @@ -1642,7 +1661,7 @@ draw_list_button( XinWindow win, XinRect * rct, BOOLEAN down ) const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT); const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL); const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK); - + xi_draw_3d_rect(win, &r, down, 2, color_light, color_ctrl, color_dark); } else @@ -1770,6 +1789,8 @@ list_event( XI_OBJ * xi_obj, XinEvent * ep ) } } break; + default: + break; } } } @@ -1878,6 +1899,8 @@ itf_event( XI_OBJ * xi_obj, XinEvent * ep ) xi_move_focus( obj ); ep->v.character.consumed = TRUE; break; + default: + break; } } } @@ -2235,6 +2258,9 @@ xi_event( XinWindow win, XinEvent * ep ) new_cursor = ( XinCursor ) xi_get_pref( XI_PREF_VSIZE_CURSOR_RID ); break; + default: + new_cursor = XI_CURSOR_ARROW; + break; } if ( itf_data->cursor != new_cursor && !itf_data->cursor_override ) { @@ -2311,6 +2337,8 @@ xi_event( XinWindow win, XinEvent * ep ) XinNativeHelp( win, itf->help_key ); break; } + default: + break; } if ( ep->type == XinEventPaint ) @@ -2677,7 +2705,7 @@ void xi_set_rect( XI_OBJ * xi_obj, XinRect * rctp, BOOLEAN do_invalidates ) { XinRect old_rect; - XinWindow win; + XinWindow win = 0L; if (do_invalidates) { win = xi_get_window( xi_obj ); @@ -2686,7 +2714,7 @@ xi_set_rect( XI_OBJ * xi_obj, XinRect * rctp, BOOLEAN do_invalidates ) } xi_set_rect_internal( xi_obj, rctp ); - + if (do_invalidates) { xi_get_rect_internal( xi_obj, &old_rect, NULL, NULL ); @@ -2740,6 +2768,8 @@ xi_get_sel( XI_OBJ * xi_obj, int *selstart, int *selstop ) case XIT_TEXT: XinError( 20022, XinSeverityFatal, 0L ); break; + default: + break; } } @@ -2784,6 +2814,8 @@ xi_get_text( XI_OBJ * xi_obj, char *s, int len ) if ( s ) *s = '\0'; break; + default: + break; } if ( s && b ) tstrncpy( s, b, len ); @@ -2966,6 +2998,8 @@ xi_set_fore_color( XI_OBJ * xi_obj, XinColor color ) } break; } + default: + break; } } @@ -3143,6 +3177,8 @@ xi_set_bufsize( XI_OBJ * xi_obj, int size ) for ( i = xi_obj->nbr_children; i > 0; i--, objp++ ) xi_set_bufsize( *objp, size ); break; + default: + break; } } @@ -3151,7 +3187,7 @@ xi_set_sel( XI_OBJ * xi_obj, int selstart, int selstop ) { switch ( xi_obj->type ) { -case XIT_CELL: + case XIT_CELL: xi_set_focus( xi_obj ); lm_set_sel( xi_obj->parent->v.list->lm, xi_obj->v.cell.row, xi_obj->v.cell.column, xi_obj->v.cell.is_vert_scrolled, @@ -3171,6 +3207,8 @@ case XIT_CELL: case XIT_ROW: XinError( 20028, XinSeverityFatal, 0L ); break; + default: + break; } } @@ -3265,6 +3303,8 @@ xi_set_text( XI_OBJ * xi_obj, char *s ) case XIT_FORM: case XIT_LIST: break; + default: + break; } } @@ -3410,7 +3450,7 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, xi_inflate_rect( &r, -3 ); } XinWindowDrawModeSet( win, XinDrawModeCopy ); - xi_draw_3d_rect( win, &r, ( BOOLEAN ) ( down || bd->checked ), 2, color_light, color_ctrl, color_dark ); + xi_draw_3d_rect( win, &r, ( BOOLEAN ) ( down || bd->checked ), 2, color_light, color_ctrl, color_dark ); if ( bd->up_icon_rid ) { int x, @@ -4017,6 +4057,8 @@ xi_get_handle( XI_OBJ * list, XI_OBJ * child ) return lm_data->recs[row]; break; } + default: + break; } return -1L; } @@ -4282,6 +4324,8 @@ xi_container_def_get_width( XI_OBJ_DEF * obj_def ) } case XI_STACK_VERTICAL: return xi_container_def_get_btn_width( obj_def ); + default: + break; } return 0; } @@ -4328,6 +4372,10 @@ xi_container_def_get_height( XI_OBJ_DEF * obj_def ) vert_spacing = 0; top_offset = 0; break; + default: + vert_spacing = 0; + top_offset = 0; + break; } return height * obj_def->nbr_children + vert_spacing * ( obj_def->nbr_children - 1 ) + top_offset; @@ -4352,7 +4400,7 @@ xi_force_focus_cell_visible( XI_OBJ * list ) lm_focus_cell_visible_force( &args ); } -BOOLEAN +BOOLEAN xi_cell_data_valid( XI_OBJ * cell ) { XI_OBJ * list = cell->parent; diff --git a/xi/xi2.c b/xi/xi2.c index 7db00e6de..c34e90243 100755 --- a/xi/xi2.c +++ b/xi/xi2.c @@ -243,9 +243,8 @@ XI_OBJ * xi_find_next_obj( XI_OBJ * focus_obj, XI_NEXT_TYPE tab_type, long c ) { XI_OBJ_TYPE type; - XI_OBJ *itf, - *obj; - int tab_cid; + XI_OBJ *itf, *obj = NULL; + int tab_cid = 0; if ( focus_obj == NULL || focus_obj->type == XIT_ITF ) { @@ -271,6 +270,8 @@ xi_find_next_obj( XI_OBJ * focus_obj, XI_NEXT_TYPE tab_type, long c ) if ( obj->type == XIT_ITF ) /* No container, ignore it */ return NULL; break; + default: + break; } while ( TRUE ) { @@ -303,7 +304,7 @@ xi_find_next_obj( XI_OBJ * focus_obj, XI_NEXT_TYPE tab_type, long c ) && ( obj->type == XIT_BTN || obj->type == XIT_CONTAINER ) ) continue; #endif - if ( + if ( ( xi_get_attrib( obj ) & ( XI_ATR_ENABLED | XI_ATR_VISIBLE ) ) != ( XI_ATR_ENABLED | XI_ATR_VISIBLE ) ) continue; @@ -389,6 +390,8 @@ xi_find_next_obj( XI_OBJ * focus_obj, XI_NEXT_TYPE tab_type, long c ) if ( obj->type == XIT_ITF ) /* No container, ignore it */ return NULL; break; + default: + break; } while ( TRUE ) { @@ -403,7 +406,7 @@ xi_find_next_obj( XI_OBJ * focus_obj, XI_NEXT_TYPE tab_type, long c ) && ( obj->type == XIT_BTN || obj->type == XIT_CONTAINER ) ) continue; #endif - if ( + if ( ( xi_get_attrib( obj ) & ( XI_ATR_ENABLED | XI_ATR_VISIBLE ) ) != ( XI_ATR_ENABLED | XI_ATR_VISIBLE ) ) continue; @@ -774,6 +777,8 @@ gen_place_focus_events( XI_OBJ * old_focus, XI_OBJ * new_focus, BOOLEAN old_is_c return FALSE; return ( move_group_focus( new_focus, old_focus, itf, XIE_ON_GROUP, old_is_cell ) && send_object_event( new_focus, XIE_ON_FIELD ) ); + default: + break; } return move_group_focus( new_focus, old_focus, itf, XIE_ON_GROUP, old_is_cell ); } @@ -844,7 +849,7 @@ move_focus_to_list( XI_OBJ ** focus_result ) attrib = lmp->lm_column_data[col]->attrib; if ( ( attrib & XI_ATR_ENABLED ) && !( attrib & XI_ATR_SELECTABLE ) && ( col < lm_get_fixed_columns( list_data->lm ) - || col >= first_col && col <= last_col ) ) + || (col >= first_col && col <= last_col ))) { new_focus->v.cell.column = ( unsigned char ) col; break; @@ -925,6 +930,8 @@ determine_new_focus( XI_OBJ ** new_focus ) case XIT_CONTAINER: *new_focus = determine_focus_button( *new_focus ); break; + default: + break; } } while ( *new_focus != NULL && ( ( *new_focus )->type == XIT_CONTAINER || @@ -967,6 +974,8 @@ check_new_focus_enabled( XI_OBJ * xi_obj ) XinError( 20007, XinSeverityFatal, 0L ); break; } + default: + break; } } @@ -1339,7 +1348,7 @@ static void xi_stx_cb( STX_CB_DATA * stx_cb_data ) { XI_EVENT xiev; - BOOLEAN send_cb; + BOOLEAN send_cb = FALSE; XI_OBJ *xi_obj; xi_obj = xiev.v.xi_obj = ( XI_OBJ * ) stx_get_app_data( stx_cb_data->stx ); @@ -1508,6 +1517,8 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data ) case LM_CB_GET_LAST: xiev.type = XIE_GET_LAST; break; + default: + break; } xiev.v.rec_request.list = lm_obj; xiev.v.rec_request.spec_rec = lm_cb_data->v.rec_request.spec_rec; @@ -1524,7 +1535,7 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data ) send_cb = TRUE; break; case LM_CB_SELECT: - { + { if ( lm_cb_data->row == 255 && lm_cb_data->column == 255 ) { xiev.type = XIE_SELECT; @@ -1671,6 +1682,8 @@ xi_lm_cb( LM_CB_DATA * lm_cb_data ) case LM_CB_COL_SIZE: lm_cb_data->v.column.refused = xiev.refused; break; + default: + break; } } @@ -1928,7 +1941,7 @@ xi_itf_closing_is( XI_OBJ * itf ) return itf->v.itf->closing; } -BOOLEAN +BOOLEAN xi_itf_in_event_destroy( XI_OBJ * itf ) { if (itf == NULL || itf->type != XIT_ITF ) @@ -2243,7 +2256,7 @@ container_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * container ) int i, len, max_len; - XI_BTN_TYPE button_type; + XI_BTN_TYPE button_type = XIBT_BUTTON; int border; if ( xi_obj_def->nbr_children <= 0 ) @@ -2288,7 +2301,7 @@ container_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * container ) create_children( xi_obj_def, container, FALSE ); } -void +void xi_container_set_rect_internal( XI_OBJ *xi_obj, XinRect *rect ) { XI_CONTAINER_DATA *cdata; @@ -2296,7 +2309,7 @@ xi_container_set_rect_internal( XI_OBJ *xi_obj, XinRect *rect ) len, max_len; int border; - XI_OBJ *child; + XI_OBJ *child = NULL; XinRect child_rect; cdata = xi_obj->v.container; @@ -2329,7 +2342,7 @@ xi_container_set_rect_internal( XI_OBJ *xi_obj, XinRect *rect ) case XIBT_TABBTN: { int top_ofst, - vert_spacing, + vert_spacing = 0, vert_form_unit; vert_form_unit = xi_get_fu_height( xi_obj->itf ); if ( !cdata->packed ) @@ -2342,6 +2355,8 @@ xi_container_set_rect_internal( XI_OBJ *xi_obj, XinRect *rect ) cdata->rct.bottom -= top_ofst; } break; + default: + break; } } @@ -2468,7 +2483,7 @@ line_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * line ) pnt2; XinRect rct; - line_data = ( XI_LINE_DATA * ) xi_tree_malloc( + line_data = ( XI_LINE_DATA * ) xi_tree_malloc( sizeof( XI_LINE_DATA ), line ); line_data->fore_color = line_def->fore_color; line_data->back_color = line_def->back_color; @@ -2749,7 +2764,7 @@ field_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * field ) field_data->btn_rct.right = field_data->btn_rct.left + btn_dim_x; if (field_data->no_button_space == XinFlagFalse || - (field_data->no_button_space == XinFlagNotSet && + (field_data->no_button_space == XinFlagNotSet && !xi_get_pref( XI_PREF_NO_BUTTON_SPACE ))) { if ( xi_fd->pixel_button_distance ) @@ -2815,7 +2830,7 @@ field_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * field ) field_data->btn_rct.right = field_data->btn_rct.left + btn_dim_x; if (field_data->no_button_space == XinFlagFalse || - (field_data->no_button_space == XinFlagNotSet && + (field_data->no_button_space == XinFlagNotSet && !xi_get_pref( XI_PREF_NO_BUTTON_SPACE ))) { stxdef.xi_rct.left += p.h; @@ -2890,7 +2905,7 @@ field_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * field ) XinError( 20053, XinSeverityFatal, 0L ); } -void +void xi_field_set_rect_internal( XI_OBJ *field_obj, XinRect *rect ) { XI_FIELD_DATA *field_data; @@ -2933,7 +2948,7 @@ xi_field_set_rect_internal( XI_OBJ *field_obj, XinRect *rect ) btn_dim_x = ( int ) ( ( ( long ) btn_dim_x * fu_width ) / XI_FU_MULTIPLE ); btn_dim_x2 = ( int ) ( ( ( long ) btn_dim_x2 * fu_width ) / XI_FU_MULTIPLE ); XinWindowFontMap( itf_win, xi_text_font_get( stx_xi_text_get( field_data->stx ) ) ); - XinFontMetricsGet( xi_text_font_get( stx_xi_text_get( field_data->stx ) ), + XinFontMetricsGet( xi_text_font_get( stx_xi_text_get( field_data->stx ) ), &leading, &ascent, &descent ); font_height = ascent + leading + descent; edit_height = font_height + ( 2 * EDIT_BORDER_WIDTH_Y ) + @@ -2952,7 +2967,7 @@ xi_field_set_rect_internal( XI_OBJ *field_obj, XinRect *rect ) field_data->btn_rct.right = field_data->btn_rct.left + btn_dim_x; if (field_data->no_button_space == XinFlagFalse || - (field_data->no_button_space == XinFlagNotSet && + (field_data->no_button_space == XinFlagNotSet && !xi_get_pref( XI_PREF_NO_BUTTON_SPACE ))) { stx_rect.left += p.h; @@ -3041,7 +3056,7 @@ group_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * group, group_data = ( XI_GROUP_DATA * ) xi_tree_malloc( sizeof( XI_GROUP_DATA ), group ); group_data->nbr_cids = group_def->nbr_cids; - group_data->cidlist = ( int * ) xi_tree_malloc( + group_data->cidlist = ( int * ) xi_tree_malloc( sizeof( int ) * group_def->nbr_cids, group_data ); memcpy( ( char * ) group_data->cidlist, ( char * ) group_def->cids, @@ -3077,10 +3092,12 @@ column_create( XI_OBJ_DEF * xi_obj_def, XI_OBJ * obj, lm_column_def.attrib = col_def->attrib; char_pixel_width = xi_get_fu_width( obj->itf ); if ( col_def->pixel_width == 0 ) + { if ( xi_get_xil_pref( obj->parent->parent ) ) col_def->pixel_width = col_def->width * char_pixel_width; else col_def->pixel_width = col_def->width * char_pixel_width / XI_FU_MULTIPLE; + } pixel_width = col_def->pixel_width; if ( list_data->width ) { @@ -3888,7 +3905,7 @@ xi_move_column_internal( XI_OBJ * column, int position, BOOLEAN in_hscrolling ) lm_column_def.position = position; lm_column_def.pix_width = col_data->pix_width; lm_column_def.text_size = col_data->text_size; - lm_column_def.heading_text = ( char * ) xi_tree_malloc( + lm_column_def.heading_text = ( char * ) xi_tree_malloc( strlen( col_data->heading_text ) + 1, list_data ); strcpy( lm_column_def.heading_text, col_data->heading_text ); lm_column_def.center_heading = col_data->center_heading; diff --git a/xi/xicf.c b/xi/xicf.c index 0cc0d4b37..35a0cde03 100755 --- a/xi/xicf.c +++ b/xi/xicf.c @@ -405,7 +405,7 @@ xi_get_column_def( XI_OBJ * column_obj, column->type = XIT_COLUMN; column->cid = column_obj->cid; column->app_data = column_obj->app_data; - column->v.column = xi_cd = ( XI_COLUMN_DEF * ) xi_tree_malloc( + column->v.column = xi_cd = ( XI_COLUMN_DEF * ) xi_tree_malloc( sizeof( XI_COLUMN_DEF ), column ); xi_cd->attrib = lmcdp->attrib; xi_cd->sort_number = index * 10; @@ -420,7 +420,7 @@ xi_get_column_def( XI_OBJ * column_obj, xi_cd->width = lmcdp->width * XI_FU_MULTIPLE; } xi_cd->text_size = lmcdp->text_size; - xi_cd->heading_text = ( char * ) xi_tree_malloc( strlen( + xi_cd->heading_text = ( char * ) xi_tree_malloc( strlen( lmcdp->heading_text ) + 1, column ); strcpy( xi_cd->heading_text, lmcdp->heading_text ); xi_cd->center_heading = lmcdp->center_heading; @@ -794,6 +794,8 @@ case XIT_LIST: xi_rd->bitmap = xi_bitmap_copy( rect_data->bitmap ); return rect; } + default: + break; } return NULL; } @@ -869,6 +871,8 @@ xi_def_free_internal( XI_OBJ_DEF* obj_def ) case XIT_RECT: xi_bitmap_destroy( obj_def->v.rect->bitmap ); break; + default: + break; } for ( num = 0; num < obj_def->nbr_children; num++ ) xi_def_free_internal( obj_def->children[ num ] ); @@ -1333,6 +1337,8 @@ xi_button_set_default( XI_OBJ * xi_obj, BOOLEAN set ) xi_button_set_default( *ptr, FALSE ); return TRUE; } + default: + break; } return FALSE; } diff --git a/xi/xidbg.c b/xi/xidbg.c index e6fb77ae4..eb5762f84 100755 --- a/xi/xidbg.c +++ b/xi/xidbg.c @@ -408,6 +408,8 @@ xi_event_debug( char *tag, XI_EVENT * xiev, char *s, int len ) object_type[k].desc, char_str, xiev->v.chr.shift, xiev->v.chr.control, xiev->v.chr.alt ); break; + default: + break; } break; } @@ -463,6 +465,8 @@ xi_event_debug( char *tag, XI_EVENT * xiev, char *s, int len ) xiev->v.column.list->cid, xiev->v.column.col_nbr, xiev->v.column.new_col_width, xiev->v.column.new_col_pixel_width ); break; + default: + break; } tmp = ( char * ) xi_tree_malloc( strlen( str ) + strlen( str2 ) + 2, NULL ); strcpy( tmp, str ); diff --git a/xi/xilm.c b/xi/xilm.c index f4cd75afe..6bc80fd06 100755 --- a/xi/xilm.c +++ b/xi/xilm.c @@ -553,7 +553,7 @@ do_lm_cb_text( LM_DATA * lmp, int row, int col, BOOLEAN preserve_focus_text ) cell_data->attrib = lm_cb_data.v.text.attrib; cell_data->color = lm_cb_data.v.text.color; cell_data->back_color = lm_cb_data.v.text.back_color; - if ( lm_column_data->var_len_text && + if ( lm_column_data->var_len_text && lm_cb_data.v.text.text != xi_text_get( cell_data->xi_text )) { /* The callback func reallocated the string, so the old pointer is simply not valid. */ @@ -763,6 +763,8 @@ lm_get_rect( LM lm, LM_PART part, int idx, XinRect * rct ) rct->right = lmp->rct.right; break; } + default: + break; } return rct; } @@ -995,6 +997,8 @@ lm_set_color( LM lm, LM_PART part, int idx, int idx2, BOOLEAN v_scrolled, cell_data->color = color; } break; + default: + break; } } @@ -1462,6 +1466,8 @@ lm_set_font( LM lm, LM_PART part, int idx, int idx2, XinFont * font ) XinWindowFontMap( lmp->win, cell_data->font ); break; } + default: + break; } } @@ -1533,7 +1539,7 @@ Up arrow and down arrow work. If the focus is on a cell, the focus stays Page up and down should work. If the focus is on the last editable cell, and tab_wrap is set, then the focus moves to the next row. -If the focus is +If the focus is the focus move to the current row. Have an option on a list by list basis, enter selects if a row has the focus. Enter will act like a double click selection. diff --git a/xi/xilm2.c b/xi/xilm2.c index 6f7072468..a59c7bb55 100755 --- a/xi/xilm2.c +++ b/xi/xilm2.c @@ -15,6 +15,7 @@ #include "xiutils.h" #include "xidisply.h" #include "xi_int.h" +#include #define REALIZED_ROWS_GRANULE 4 #define REC_AT_TOP 1 @@ -98,11 +99,11 @@ lm_allocate_rec_info( LM_DATA * lmp, int realized_rows_array_len ) lmp->cell_data = ( LM_CELL_DATA ** ) xi_tree_realloc( lmp->cell_data, sizeof( LM_CELL_DATA * ) * realized_rows_array_len ); for ( i = old_len; i < realized_rows_array_len; ++i ) - lmp->cell_data[i] = ( LM_CELL_DATA * ) xi_tree_malloc( + lmp->cell_data[i] = ( LM_CELL_DATA * ) xi_tree_malloc( ( lmp->nbr_columns + 1 ) * sizeof( LM_CELL_DATA ), lmp ); } else - lmp->cell_data = ( LM_CELL_DATA ** ) xi_tree_malloc( + lmp->cell_data = ( LM_CELL_DATA ** ) xi_tree_malloc( sizeof( LM_CELL_DATA * ) * realized_rows_array_len, lmp ); } @@ -276,7 +277,7 @@ lm_create( XinWindow win, LM_DEF * lm_def, void *parent ) for ( i = 0; i < lmp->realized_rows_array_len; ++i ) { - lmp->cell_data[i] = ( LM_CELL_DATA * ) xi_tree_malloc( + lmp->cell_data[i] = ( LM_CELL_DATA * ) xi_tree_malloc( lmp->nbr_columns * sizeof( LM_CELL_DATA ), lmp ); lmp->row_attribs[i] = LM_ROW_ATR_ENABLED; } @@ -1150,7 +1151,7 @@ fill_previous( LM_DATA * lmp ) calculate_visibles( lmp ); /* if we finally have enough rows to display the entire list - * + * * note: we subtract 1 from the space necessary because it is not necessary to * create space for the pixel at the bottom of the last row. */ height = lmp->pix_heights[lmp->nbr_realized_rows - 1]; @@ -2653,7 +2654,7 @@ lm_insert_row( LM lm, int row ) { if ( row > 0 && lmp->nbr_realized_rows ) { - int idx, + int idx = 0, row_height, pix; XinRect r, @@ -3496,7 +3497,7 @@ lm_set_buf_size( LM lm, LM_PART part, int idx, int size ) /* ------------------------------------------------------------------------ */ static BOOLEAN -adjust_focus_for_column_delete( LM_DATA * lmp, int column_nbr, +adjust_focus_for_column_delete( LM_DATA * lmp, int column_nbr, BOOLEAN adjust_focus_column ) { XI_OBJ *focus_obj; @@ -3534,7 +3535,7 @@ adjust_focus_for_column_delete( LM_DATA * lmp, int column_nbr, } return xi_move_focus( lmp->itf_obj ); } - if ( adjust_focus_column && + if ( adjust_focus_column && ( int ) focus_obj->v.cell.column > ( int ) column_nbr ) focus_obj->v.cell.column--; return TRUE; @@ -3955,7 +3956,7 @@ lm_create_column( LM lm, LM_COLUMN_DEF * lcdef, BOOLEAN not_creating_list, lcdata->heading_platform = lcdef->heading_platform; lcdata->column_well = lcdef->column_well; lcdata->column_platform = lcdef->column_platform; - lcdata->heading_text = ( char * ) xi_tree_malloc( + lcdata->heading_text = ( char * ) xi_tree_malloc( strlen( lcdef->heading_text ) + 1, ( char * ) lm ); strcpy( lcdata->heading_text, lcdef->heading_text ); if ( lcdef->font ) @@ -3978,7 +3979,7 @@ lm_create_column( LM lm, LM_COLUMN_DEF * lcdef, BOOLEAN not_creating_list, /* allocate new columns */ column_data = lmp->lm_column_data = - ( LM_COLUMN_DATA * * ) xi_tree_realloc2( + ( LM_COLUMN_DATA * * ) xi_tree_realloc2( ( char * ) lmp->lm_column_data, sizeof( LM_COLUMN_DATA * ) * ( lmp->nbr_columns + 1 ), ( char * ) lm ); @@ -4226,7 +4227,7 @@ lm_move_event( LM_DATA * lmp, XinEvent * ep ) break; case XinEventMouseMove: { - static autoscroll_count = 0; + static int autoscroll_count = 0; BOOLEAN scrolled = FALSE; if ( lmp->pixel_width != 0 ) @@ -4294,8 +4295,8 @@ lm_move_event( LM_DATA * lmp, XinEvent * ep ) rct.top > ( lmp->pix_row1_top + 8 ) ) ) { /* If the focus is in the column to be deleted, we will move focus as if - the tab key had been pressed before deleting the col. This is so the - Bridge doesn't try to reference a deleted column object in the + the tab key had been pressed before deleting the col. This is so the + Bridge doesn't try to reference a deleted column object in the OFF_CELL event. */ XI_OBJ *old_focus; BOOLEAN deleteable = TRUE; @@ -4304,7 +4305,7 @@ lm_move_event( LM_DATA * lmp, XinEvent * ep ) old_focus = lmp->itf_obj->v.itf->focus_obj; if (old_focus->type == XIT_CELL && old_focus->parent == lmp->list_obj && old_focus->v.cell.column == column) - { + { if (adjust_focus_for_column_delete( lmp, column, FALSE )) return_focus = TRUE; else @@ -4436,6 +4437,8 @@ lm_move_event( LM_DATA * lmp, XinEvent * ep ) lm_focus_cell_visible_attempt( lmp ); break; } + default: + break; } } @@ -4592,7 +4595,7 @@ lm_drag_row_event( XI_OBJ * itf, LM_DATA * lmp, XinEvent * ep, XinEvent * oevp ) { case XinEventMouseMove: { - static autoscroll_count = 0; + static int autoscroll_count = 0; BOOLEAN scrolled = FALSE; XI_OBJ *new_itf; @@ -4724,7 +4727,7 @@ lm_drag_row_event( XI_OBJ * itf, LM_DATA * lmp, XinEvent * ep, XinEvent * oevp ) { /* Generate drop rows event */ int row; - int column; + int column = 0; LM_CB_DATA lm_cb_data; XinRect list_rct; @@ -4763,6 +4766,8 @@ lm_drag_row_event( XI_OBJ * itf, LM_DATA * lmp, XinEvent * ep, XinEvent * oevp ) } break; } + default: + break; } } @@ -4940,6 +4945,8 @@ lm_size_event( LM_DATA * lmp, XinEvent * ep ) lm_focus_cell_visible_attempt( lmp ); break; } + default: + break; } } @@ -5242,7 +5249,7 @@ lm_is_button_full_cell( LM lm, int row, int col ) return cell_data->button_full_cell; } -void +void lm_set_rect( LM lm, XinRect *rect ) { LM_DATA *lmp; @@ -5270,5 +5277,5 @@ lm_set_rect( LM lm, XinRect *rect ) the first time you resize, the list gets shorter by a scrollbar height, and thereafter it doesn't change. */ lm_recalc_metrics( lm ); - + } diff --git a/xi/xilm3.c b/xi/xilm3.c index dc467f906..e77ee2c79 100755 --- a/xi/xilm3.c +++ b/xi/xilm3.c @@ -14,6 +14,7 @@ #include "xilmst.h" #include "xiutils.h" #include "xidisply.h" +#include static XinDrawTools lm_normal_ctools; @@ -1465,7 +1466,7 @@ draw_background_rects( LM_DATA * lmp, XinWindow win, ROW_INFO * row_info, brush_color = lmp->back_color; if ( cell_data->back_color ) brush_color = cell_data->back_color; -/* +/* TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES if (brush_color == lmp->back_color) continue; @@ -1509,10 +1510,10 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES XinRect rct; brush_color = lmp->disabled_back_color; -/* +/* TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES if (brush_color == lmp->back_color) - continue; + continue; */ if ( brush_color != last_brush_color ) { @@ -1564,10 +1565,10 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES brush_color = lmp->disabled_color; if ( cell_data->back_color && lmp->retain_back_color_on_select ) brush_color = cell_data->back_color; -/* +/* TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES if (brush_color == lmp->back_color) - continue; + continue; */ if ( brush_color != last_brush_color ) { @@ -1608,12 +1609,12 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES rct = column_data->prct; rct.top = ri->prct.top; rct.bottom = ri->prct.bottom; - if ( column_data->column_well || column_data->column_platform ) + if ( column_data->column_well || column_data->column_platform ) { const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT); const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL); const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK); - + xi_draw_3d_rect( win, &rct, ( BOOLEAN ) ( CELL_IS_SELECTED( lmp, row, col ) ? !column_data->column_well : column_data->column_well ), 2, color_light, color_ctrl, color_dark ); } @@ -2529,6 +2530,8 @@ lm_cell_btn_event( LM_DATA * lmp, XinEvent * ep, XinEvent * oevp ) redraw_cell( ( LM ) lmp, lmp->btn_down_row, lmp->btn_down_col, FALSE ); break; } + default: + break; } } @@ -3049,7 +3052,7 @@ TO OPTIMIZE BACKGROUND DRAWING, USE THE FOLLOWING LINE, AND DON'T SET TO HOLLOW draw_cells( lmp, update ); draw_other_rectangles( lmp, &actual_rct ); - + xi_set_clip( win, NULL ); } @@ -3273,6 +3276,8 @@ lm_vsize_event( LM_DATA * lmp, XinEvent * ep ) lm_focus_cell_visible_attempt( lmp ); break; } + default: + break; } } @@ -3651,6 +3656,8 @@ lm_select_cell_event( LM_DATA * lmp, XinEvent * ep ) } } break; + default: + break; } } @@ -3733,6 +3740,8 @@ lm_event( XI_OBJ * itf, LM lm, XinEvent * ep ) } break; } + default: + break; } switch ( ep->type ) { @@ -4665,7 +4674,7 @@ lm_event( XI_OBJ * itf, LM lm, XinEvent * ep ) BOOLEAN right_row = FALSE; int comp_len; int comp_result; - long spec_rec, data_rec, swap_rec, start_rec; + long spec_rec, data_rec = 0L, swap_rec, start_rec = 0L; XI_EVENT xiev; char text_buffer[200]; int col_nbr; @@ -4700,12 +4709,12 @@ lm_event( XI_OBJ * itf, LM lm, XinEvent * ep ) (itf->v.itf->xi_eh) ( itf, &xiev ); if ( xiev.refused ) return FALSE; - data_rec = xiev.v.rec_allocate.record; + data_rec = xiev.v.rec_allocate.record; } - + if (old_len > len || len == 1) do_first = TRUE; - + while (!found) { MEMCLEAR( xiev ); @@ -4775,12 +4784,12 @@ lm_event( XI_OBJ * itf, LM lm, XinEvent * ep ) do_get = TRUE; } if (right_row) - { + { int i; long test_rec; if (do_get) test_rec = spec_rec; - else + else test_rec = start_rec; for (i = 0; i < lmp->nbr_realized_rows; i++) @@ -4863,6 +4872,8 @@ lm_event( XI_OBJ * itf, LM lm, XinEvent * ep ) if ( lm_focus_state_get( lmp ) == LM_FOCUS_VISIBLE ) retval = send_cell_event( lm, ep, FALSE, TRUE ); break; + default: + break; } if ( ep_needs_restore ) *ep = oevt; diff --git a/xi/xilmst.c b/xi/xilmst.c index c42c707b7..041ccedf1 100755 --- a/xi/xilmst.c +++ b/xi/xilmst.c @@ -15,6 +15,7 @@ #include "xilmst.h" #include "xiutils.h" #include "xidisply.h" +#include void lm_focus_set( long lm, int row, int column, BOOLEAN v_scrolled, BOOLEAN set ) @@ -353,7 +354,7 @@ lm_stop_edit( LM lm, BOOLEAN do_update, int row, int column, LM_FOCUS state_was /* if lmp->row_focus_border is TRUE, don't redraw, because old focus row will * be invalidated */ if ( ( do_update && state_was == LM_FOCUS_VISIBLE ) || - do_update && cell_data->button_full_cell ) + (do_update && cell_data->button_full_cell)) redraw_cell( lm, row, column, FALSE ); } @@ -451,7 +452,7 @@ lm_focus_cell_visible_attempt( LM_DATA * lmp ) if ( cell_data->xi_text != NULL ) xi_text_clip_set( cell_data->xi_text, &mr ); if ( text_was_invisible ) - { + { cell_data->attrib = lmp->focus_state->focus_cell_attrib; if ( cell_data->font ) XinFontDestroy( cell_data->font ); diff --git a/xi/xiport.c b/xi/xiport.c index 444858cbd..869b2b01d 100755 --- a/xi/xiport.c +++ b/xi/xiport.c @@ -1076,19 +1076,19 @@ XinDialogAsk( char *Btn1, char *Btn2, char *Btn3, char *format,... ) strncpy( button1, Btn1, 199 ); button1[199] = '\0'; Btn1 = button1; - } + } if (Btn2 != NULL && strlen(Btn2) >= 200) { strncpy( button2, Btn2, 199 ); button2[199] = '\0'; Btn2 = button2; - } + } if (Btn3 != NULL && strlen(Btn3) >= 200) { strncpy( button3, Btn3, 199 ); button3[199] = '\0'; Btn3 = button3; - } + } ask_response = xvt_dm_post_ask( Btn1, Btn2, Btn3, xin_buffer ); switch ( ask_response ) { @@ -1445,10 +1445,12 @@ PATToBrushPattern( PAT_STYLE pat ) { switch ( pat ) { -case PAT_SOLID: + case PAT_SOLID: return XinBrushSolid; case PAT_HOLLOW: return XinBrushHollow; + default: + break; } return XinBrushSolid; } @@ -1458,12 +1460,14 @@ PATToPenPattern( PAT_STYLE pat ) { switch ( pat ) { -case PAT_SOLID: + case PAT_SOLID: return XinPenSolid; case PAT_HOLLOW: return XinPenHollow; case PAT_RUBBER: return XinPenDashed; + default: + break; } return XinPenSolid; } @@ -1749,6 +1753,8 @@ case SC_LINE_UP: return XinScrollBarActionThumb; case SC_THUMBTRACK: return XinScrollBarActionThumbTrack; + default: + break; } return XinScrollBarActionLineUp; } @@ -1779,9 +1785,9 @@ XinFontXvtDestroy( void *font_id ) #define FONT_ATTR_SIZE 256 /* family or native_desc size */ -/* +/* This function fills out a font based on its native fontid, perhaps one from a font dialog. -Afterwards, the font is guaranteed to respond correctly to family, size, bold, and italic +Afterwards, the font is guaranteed to respond correctly to family, size, bold, and italic inquiries, except that family may be XinFontFamilyOther. */ static int xin_stricmp( const char* s1, const char* s2 ) @@ -1816,7 +1822,7 @@ XinFontNativeConvert( XinFont * font ) WINDOW font_win; XinWindowDef Def; XinRect rect = {-1000, -1000, -900, -900}; - + MEMCLEAR( Def ); Def.type = XinWindowTypeDocument; Def.border_style = XinBorderFixed; @@ -2011,6 +2017,8 @@ ConvertEvent( EVENT * ep, XinEvent * xiep ) xiep->v.control.ctrl_info.v.scroll.action = ConvertWhat( ep->v.ctl.ci.v.scroll.what ); xiep->v.control.ctrl_info.v.scroll.position = ep->v.ctl.ci.v.scroll.pos; break; + default: + break; } break; case E_TIMER: @@ -2210,6 +2218,8 @@ XinWindowCreate( XinWindowDef * Def ) else parent = TASK_WIN; break; + default: + break; } #if XIWS == XIWS_WIN || XIWS == XIWS_PM if ( Def->iconizable && Def->icon_rid != 0 ) @@ -2297,6 +2307,8 @@ XinWindowCreate( XinWindowDef * Def ) case XinModalAutoclose: xin_autoclose_win = win; break; + default: + break; } #if XVT_PTK_VERSION_MAJOR == 4 && XVT_PTK_VERSION_MINOR >= 50 } @@ -2334,6 +2346,8 @@ XinWindowCreate( XinWindowDef * Def ) Def->title = ""; ctl_def.wtype = WC_VSCROLL; break; + default: + break; } flags = ( Def->visible ? 0 : CTL_FLAG_INVISIBLE ); if ( !Def->enabled ) @@ -2355,6 +2369,8 @@ XinWindowCreate( XinWindowDef * Def ) #endif return ( XinWindow ) xvt_ctl_create_def( &ctl_def, ( WINDOW ) Def->parent, 0L ); } + default: + break; } return 0L; /*START*/ @@ -2571,10 +2587,12 @@ MODEToDrawMode( DRAW_MODE Mode ) { switch ( Mode ) { -case M_COPY: + case M_COPY: return XinDrawModeCopy; case M_XOR: return XinDrawModeXor; + default: + break; } return XinDrawModeCopy; } @@ -2702,6 +2720,8 @@ XinWindowDrawToolsSet( XinWindow win, XinDrawTools * ct ) case XinPenDashed: xct.pen.style = P_DASH; break; + default: + break; } xct.brush.color = ct->brush.fore_color; xct.brush.pat = BrushPatternToPAT( ct->brush.pattern ); @@ -3779,7 +3799,7 @@ XinWindowDropDownParentGet( XinWindow creating_win ) #if XIWS == XIWS_WIN #if 0 if ( creating_win == xin_modal_win || xin_use_mdi_flag ) - return ( XinWindow ) SCREEN_WIN; /* Unless creating_win is modal, this + return ( XinWindow ) SCREEN_WIN; /* Unless creating_win is modal, this will have a title bar. Life sucks. */ return ( XinWindow ) TASK_WIN; #endif @@ -4106,6 +4126,9 @@ XinClipboardPut( XinClipboardFormat format, long size, void *data ) case XinClipboardFormatBitmap: xvt_format = CB_PICT; break; + default: + xvt_format = CB_APPL; + break; } xvt_cb_put_data( xvt_format, NULL, size + 1, ( PICTURE ) buf ); xvt_cb_free_data( ); @@ -4942,6 +4965,8 @@ XinFontFamilySet( XinFont * font, XinFontFamily family ) case XinFontFamilyHelvetica: xvt_font_set_family( font->xvt_fntid, XVT_FFN_HELVETICA ); break; + default: + break; } /*START*/ } @@ -5188,17 +5213,17 @@ XinPrintRecordValidate( XinPrintRecord * rec ) /*START*/ } -/* +/* This function gets the height and width of the printer area in pixels (or dots), -and the vertical and horizontal resolution in pixels per inch. +and the vertical and horizontal resolution in pixels per inch. */ -void -XinPrintRecordMetricsGet( XinPrintRecord * rec, long * height, long * width, +void +XinPrintRecordMetricsGet( XinPrintRecord * rec, long * height, long * width, long * vres, long * hres ) { /*END*/ - xvt_app_escape(XVT_ESC_GET_PRINTER_INFO, ( PRINT_RCD * ) rec, height, + xvt_app_escape(XVT_ESC_GET_PRINTER_INFO, ( PRINT_RCD * ) rec, height, width, vres, hres); /*START*/ } @@ -5799,7 +5824,7 @@ static char *xin_help_file_name = NULL; /*START*/ /* Native help (only implemented on Windows - these calls do nothing elsewhere) */ -void +void XinHelpFileNameSet( char *filename ) { /*END*/ @@ -5819,7 +5844,7 @@ XinHelpFileNameGet() } /* This function only does anything on Windows. */ -BOOLEAN +BOOLEAN XinNativeHelp( XinWindow win, char *help_key ) { /*END*/ @@ -5827,7 +5852,7 @@ XinNativeHelp( XinWindow win, char *help_key ) if (xin_help_file_name != NULL && win != XI_NULL_WINDOW && help_key != NULL) { - return WinHelp( (HWND)XinWindowNativeGet( win ), xin_help_file_name, + return WinHelp( (HWND)XinWindowNativeGet( win ), xin_help_file_name, HELP_KEY, (long)help_key ); } return FALSE; diff --git a/xi/xiport.h b/xi/xiport.h index ddd236ce1..c60878c47 100755 --- a/xi/xiport.h +++ b/xi/xiport.h @@ -79,7 +79,7 @@ from the XI source code when we don't use XVT. #endif typedef enum -{ +{ XinFlagNotSet, XinFlagTrue, XinFlagFalse @@ -601,24 +601,6 @@ XIN_FAKE_TYPE( s_XinPrintRecord, XinPrintRecord ); #define XI_COLOR_LTGRAY 0x00C0C0C0L #define XI_COLOR_WHITE 0x00FFFFFFL -#ifndef USHRT_MAX -#define USHRT_MAX (unsigned short)(~0) -#endif -#ifndef SHRT_MAX -#define SHRT_MAX ((short)(USHRT_MAX >> 1)) -#endif -#ifndef UINT_MAX -#define UINT_MAX (unsigned)(~0) -#endif -#ifndef INT_MAX -#define INT_MAX ((int)(UINT_MAX >> 1)) -#endif -#ifndef ULONG_MAX -#define ULONG_MAX (unsigned long)(~0) -#endif -#ifndef LONG_MAX -#define LONG_MAX ((long)(ULONG_MAX >> 1 )) -#endif /* New -- values for Motif */ #if XIWS == XIWS_XM @@ -843,7 +825,7 @@ extern "C" BOOLEAN XinPrintThreadStart( XinPrintHandler func, long app_data ); XinWindow XinPrintWindowCreate( XinPrintRecord * rec, char *title ); void XinPrintWindowDestroy( XinWindow win ); - void XinPrintRecordMetricsGet( XinPrintRecord * rec, long * height, long * width, + void XinPrintRecordMetricsGet( XinPrintRecord * rec, long * height, long * width, long * vres, long * hres ); /* Files and Directories */ diff --git a/xi/xistx.c b/xi/xistx.c index 4a367e317..4d8dad43a 100755 --- a/xi/xistx.c +++ b/xi/xistx.c @@ -14,6 +14,7 @@ #include "xistx.h" #include "xiutils.h" #include "xi_int.h" +#include /* error codes 30100 - 30104 */ @@ -54,7 +55,7 @@ draw_back_rect( STX_DATA * stxp, XinRect * r ) dt.brush.pattern = XinBrushSolid; if ( stxp->has_focus ) dt.brush.fore_color = stxp->active_back_color; - else + else { if (stxp->attrib & XI_ATR_ENABLED) dt.brush.fore_color = stxp->back_color; @@ -78,7 +79,7 @@ stx_redraw( STX stx, BOOLEAN update ) BOOLEAN do_border = FALSE; unsigned long tattrib; XinRect rct; - XinColor border_color; + XinColor border_color = 0L; #if XIWS == XIWS_WM XinRect r; @@ -179,15 +180,15 @@ stx_redraw( STX stx, BOOLEAN update ) { XinRect r; - r = stxp->edit_rect; + r = stxp->edit_rect; xi_text_prect_set( stxp->xi_text, &r ); xi_text_clip_set( stxp->xi_text, &r ); xi_text_draw( stxp->xi_text, 0L, 0L, update ); } - if ( stxp->button && - (stxp->no_button_space == XinFlagTrue || - (stxp->no_button_space == XinFlagNotSet && + if ( stxp->button && + (stxp->no_button_space == XinFlagTrue || + (stxp->no_button_space == XinFlagNotSet && ( BOOLEAN ) xi_get_pref( XI_PREF_NO_BUTTON_SPACE ) ))) xi_draw_field_button( stxp->parent_obj ); } @@ -289,9 +290,9 @@ stx_create( XinWindow win, STX_DEF * stx_def, XinRect * field_button ) inflate = -( BORDER_WIDTH + BORDER_SPACE ); xt_rect = stxp->rct; xi_inflate_rect( &xt_rect, inflate ); - if ( stx_def->button && + if ( stx_def->button && (stx_def->no_button_space == XinFlagTrue || - (stx_def->no_button_space == XinFlagNotSet && + (stx_def->no_button_space == XinFlagNotSet && ( BOOLEAN ) xi_get_pref( XI_PREF_NO_BUTTON_SPACE ) ))) { int delta; @@ -417,7 +418,7 @@ stx_create( XinWindow win, STX_DEF * stx_def, XinRect * field_button ) return ( ( STX ) ( long ) stxp ); } -void +void stx_set_rect( XinWindow win, STX stx, XinRect *new_rect, XinRect *field_button ) { STX_DATA *stxp; @@ -431,7 +432,7 @@ stx_set_rect( XinWindow win, STX stx, XinRect *new_rect, XinRect *field_button ) inflate; XinWindowFontMap( win, xi_text_font_get( stx_xi_text_get( stx ) ) ); - XinFontMetricsGet( xi_text_font_get( stx_xi_text_get( stx ) ), + XinFontMetricsGet( xi_text_font_get( stx_xi_text_get( stx ) ), &leading, &ascent, &descent ); font_height = ascent + leading + descent; stxp = ( STX_DATA * ) stx; @@ -464,9 +465,9 @@ stx_set_rect( XinWindow win, STX stx, XinRect *new_rect, XinRect *field_button ) inflate = -( BORDER_WIDTH + BORDER_SPACE ); xt_rect = stxp->rct; xi_inflate_rect( &xt_rect, inflate ); - if ( stxp->button && + if ( stxp->button && (stxp->no_button_space == XinFlagTrue || - (stxp->no_button_space == XinFlagNotSet && + (stxp->no_button_space == XinFlagNotSet && ( BOOLEAN ) xi_get_pref( XI_PREF_NO_BUTTON_SPACE ) ))) { int delta; @@ -601,7 +602,7 @@ stx_focus_set( long stx, BOOLEAN set ) { STX_DATA *stxp = ( STX_DATA * ) stx; -/* verificare la correttezza +/* verificare la correttezza if ( set == stxp->has_focus ) XinError( 30101, XinSeverityFatal, 0L ); */ @@ -854,6 +855,8 @@ stx_event( STX stx, XinEvent * ep ) case XinEventMenuCommand: use_event = send_txt_event( stx, ep, FALSE ); break; + default: + break; } return use_event; } @@ -1173,8 +1176,8 @@ stx_set_pos( STX stx, XinPoint p ) inflate = -( BORDER_WIDTH + BORDER_SPACE ); r = stxp->rct; xi_inflate_rect( &r, inflate ); - if ( stxp->button && - (stxp->no_button_space == XinFlagTrue || + if ( stxp->button && + (stxp->no_button_space == XinFlagTrue || (stxp->no_button_space == XinFlagNotSet && ( BOOLEAN ) xi_get_pref( XI_PREF_NO_BUTTON_SPACE ) ))) { @@ -1679,7 +1682,7 @@ stx_set_font( STX stx, XinFont* font ) { STX_DATA *stxp = ( STX_DATA * ) stx; XinFont* font_copy; - + XinFontCopy( &font_copy, font ); if ( stxp->xi_text != NULL ) diff --git a/xi/xitext.c b/xi/xitext.c index f05878b15..2c288a975 100755 --- a/xi/xitext.c +++ b/xi/xitext.c @@ -17,6 +17,7 @@ #include "xilmst.h" #include "xiutils.h" #include "xistx.h" +#include #define is_word_char(ch) (ch != ' ' && ch != '\n') #define SB_DELTA 3 @@ -619,9 +620,9 @@ xi_text_draw_internal( XI_TEXT * text, XinColor color, XinColor back_color, BOOL { XinRect rct; char *s; - char *sws; + char *sws = NULL; int cnt, - nbr_lines, + nbr_lines = 0, baseline, line_to_draw, top_of_rect; @@ -780,7 +781,7 @@ xi_text_draw_internal( XI_TEXT * text, XinColor color, XinColor back_color, BOOL if ( !text->multi_line ) { char *str; - char *sw_str; + char *sw_str = NULL; int len, sw_len; BOOLEAN dont_draw; @@ -1216,7 +1217,7 @@ xi_text_caret_on( XI_TEXT * text ) cnt < nbr_lines; ++cnt, ++caret_line ) { - int ip; + int ip = 0; BOOLEAN set_caret = FALSE; lb = &text->line_breaks[caret_line]; @@ -1254,7 +1255,7 @@ xi_text_caret_on( XI_TEXT * text ) int ip = ( text->selection_start_ip == text->ip1 ) ? text->ip2 : text->ip1; int x; char *pwc = "#"; - int pwc_len; + int pwc_len = 0; if ( text->password ) { @@ -2209,7 +2210,7 @@ key_line_end( XI_TEXT * text, XinEvent * ep ) static int get_ip_one_word_left( XI_TEXT * text, int ip ) { - int line; + int line = 0; if ( text->multi_line ) { @@ -2326,7 +2327,7 @@ key_word_left( XI_TEXT * text, XinEvent * ep ) static int get_ip_one_word_right( XI_TEXT * text, int ip ) { - int line, + int line = 0, len, string_len; @@ -2663,7 +2664,7 @@ xi_text_hit_test( XI_TEXT * text, XinEvent * ep, int *ip ) { int del_y, del_x, - line, + line = 0, len, cnt, last_ip; @@ -2729,7 +2730,7 @@ xi_text_hit_test( XI_TEXT * text, XinEvent * ep, int *ip ) /* binary search - find cnt where the mathmatical line between characters is * closest to pix_len. - * + * * this binary search uses a deterministic algorythm. by this, when starting * searching, hpos is always a power of 2. d is the delta that is added to * or subtracted from hpos after each comparison. d is initialized as hpos / @@ -2819,6 +2820,8 @@ xi_text_control_event( XI_TEXT * text, XinEvent * ep ) set_pos_delta( text, percent, prop ); break; } + default: + break; } if ( save_text ) free_save_text_state( ); @@ -2890,7 +2893,7 @@ xi_text_character_event( XI_TEXT * text, XinEvent * ep, BOOLEAN * changed ) default: if ( text->read_only ) { - if ( ep->v.character.ch == '\033' || + if ( ep->v.character.ch == '\033' || ep->v.character.ch == '\r' || ep->v.character.ch == '\n' ) { @@ -3098,6 +3101,8 @@ xi_text_event( XI_TEXT * text, XinEvent * ep, BOOLEAN gaining_focus, BOOLEAN * c case XinEventTimer: xi_text_timer_event( text, ep ); break; + default: + break; } return retval; } @@ -3209,7 +3214,7 @@ xi_text_focus_get( XinWindow win ) void xi_text_buffer_size_set( XI_TEXT * text, int len ) { - int ip1, ip2, sip; + int ip1 = 0, ip2 = 0, sip = 0; BOOLEAN reset_ips = FALSE; if ( xi_text_editing_is( text ) ) diff --git a/xi/xiutils.c b/xi/xiutils.c index 488a14081..a965e7ef6 100755 --- a/xi/xiutils.c +++ b/xi/xiutils.c @@ -752,7 +752,7 @@ xi_set_font( XinFont * font ) XinFontDestroy( xi_sysfont ); XinFontCopy( &xi_sysfont, font ); } - + void xi_set_drag_list_obj( XI_OBJ * obj ) @@ -1435,7 +1435,7 @@ xi_get_font_metrics_font( XinFont * font, int *leading, { FONT_INFO* fi; int i; - XinWindow win; + XinWindow win = (XinWindow)0L; BOOLEAN close_win = FALSE; XinRect rct; @@ -1612,6 +1612,8 @@ move_controls( XI_OBJ * xi_obj ) } break; } + default: + break; } objlist = xi_get_member_list( xi_obj, &n ); for ( ; n > 0; n--, objlist++ ) @@ -1736,7 +1738,7 @@ xi_eh( XinWindow win, XinEvent * ep ) { XI_OBJ *itf; XI_ITF_DATA *itf_data; - int delta_x, + int delta_x = 0, old, d; @@ -1776,6 +1778,8 @@ xi_eh( XinWindow win, XinEvent * ep ) case XinScrollBarActionThumbTrack: delta_x = 0; break; + default: + break; } old = itf_data->phys_xi_pnt.h; itf_data->phys_xi_pnt.h += delta_x; @@ -1814,7 +1818,7 @@ xi_eh( XinWindow win, XinEvent * ep ) { XI_OBJ *itf; XI_ITF_DATA *itf_data; - int delta_y, + int delta_y = 0, old, d; @@ -1854,6 +1858,8 @@ xi_eh( XinWindow win, XinEvent * ep ) case XinScrollBarActionThumbTrack: delta_y = 0; break; + default: + break; } old = itf_data->phys_xi_pnt.v; itf_data->phys_xi_pnt.v += delta_y; @@ -1886,6 +1892,8 @@ xi_eh( XinWindow win, XinEvent * ep ) } break; } + default: + break; } return TRUE; } @@ -1977,6 +1985,8 @@ xi_make_obj_visible( XI_OBJ * xi_obj ) case XIT_COLUMN: case XIT_CONTAINER: return; + default: + break; } pref_h = ( int ) xi_get_pref( XI_PREF_VIR_SP_H ); pref_v = ( int ) xi_get_pref( XI_PREF_VIR_SP_V ); @@ -2261,10 +2271,12 @@ xi_menu_enable( XI_OBJ * itf, int tag, BOOLEAN enable ) XinWindowMenuItemEnable( win, ( short ) tag, enable ); xi_obj = xi_get_obj( itf, tag ); if ( xi_obj != NULL && xi_obj->type == XIT_BTN ) + { if ( enable ) xi_set_attrib( xi_obj, xi_get_attrib( xi_obj ) | XI_ATR_ENABLED ); else xi_set_attrib( xi_obj, xi_get_attrib( xi_obj ) & ~XI_ATR_ENABLED ); + } } void @@ -2636,6 +2648,8 @@ recalc_metrics( XI_OBJ * xi_obj ) break; } + default: + break; } for ( i = 0; i < xi_obj->nbr_children; ++i ) recalc_metrics( xi_obj->children[i] ); @@ -2706,6 +2720,8 @@ case XIT_ITF: xi_invalidate_rect( xi_get_window( xi_obj->itf ), &rct ); } break; + default: + break; } } @@ -2755,7 +2771,7 @@ xi_get_cell_selection( XI_OBJ * list, int *nbr_cellsp ) list_data->cell_spec = ( XI_CELL_SPEC * ) xi_tree_realloc( list_data->cell_spec, ( size_t ) nbr_cells * sizeof( XI_CELL_SPEC ) ); else - list_data->cell_spec = ( XI_CELL_SPEC * ) xi_tree_malloc( + list_data->cell_spec = ( XI_CELL_SPEC * ) xi_tree_malloc( ( size_t ) nbr_cells * sizeof( XI_CELL_SPEC ), list_data ); cnt = 0; for ( r = 0; r < nbr_rows; ++r ) @@ -2872,6 +2888,8 @@ xi_check( XI_OBJ * xi_obj, BOOLEAN check ) } break; } + default: + break; } } #endif @@ -3022,6 +3040,8 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( stxp->disabled_back_color != color ); stxp->disabled_back_color = color; break; + default: + break; } if ( changed ) stx_update_colors( xi_obj->v.field->stx ); @@ -3049,6 +3069,8 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( cell_data->back_color != color ); cell_data->back_color = color; break; + default: + break; } } break; @@ -3074,6 +3096,8 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( xi_td->back_color != color ); xi_td->back_color = color; break; + default: + break; } break; } @@ -3093,6 +3117,8 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( xi_ld->back_color != color ); xi_ld->back_color = color; break; + default: + break; } break; } @@ -3120,6 +3146,8 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( xi_rd->shadow_color != color ); xi_rd->shadow_color = color; break; + default: + break; } break; } @@ -3168,9 +3196,13 @@ xi_set_color( XI_OBJ * xi_obj, XI_COLOR_PART part, XinColor color ) changed = ( lmp->white_space_color != color ); lmp->white_space_color = color; break; + default: + break; } break; } + default: + break; } if ( changed ) @@ -3202,7 +3234,7 @@ xi_cell_request( XI_OBJ * xi_obj ) { switch ( xi_obj->type ) { -case XIT_LIST: + case XIT_LIST: lm_cell_request( xi_obj->v.list->lm, LM_LIST, 0, 0 ); break; case XIT_COLUMN: @@ -3216,6 +3248,8 @@ case XIT_LIST: lm_cell_request( xi_obj->parent->v.list->lm, LM_CELL, xi_obj->v.cell.row, xi_obj->v.cell.column ); break; + default: + break; } } @@ -3247,10 +3281,10 @@ calc_horizontal_stack( XI_OBJ * itf, XI_CONTAINER_DATA * container, int btn_width, max_width, horz_spacing, - btn_height; + btn_height = 0; long horz_form_unit; long vert_form_unit; - BOOLEAN center; + BOOLEAN center = FALSE; XinRect container_rect; container_rect = container->rct; @@ -3334,8 +3368,8 @@ calc_vertical_stack( XI_OBJ * itf, XI_CONTAINER_DATA * container, { int btn_height, max_height, - top_ofst, - vert_spacing; + top_ofst = 0, + vert_spacing = 0; XinRect container_rect; long vert_form_unit; @@ -3360,6 +3394,8 @@ calc_vertical_stack( XI_OBJ * itf, XI_CONTAINER_DATA * container, vert_spacing = 0; top_ofst = 0; break; + default: + break; } if ( container->pix_height ) btn_height = container->pix_height; @@ -3374,6 +3410,8 @@ calc_vertical_stack( XI_OBJ * itf, XI_CONTAINER_DATA * container, case XIBT_RADIOBTN: btn_height = ( int ) vert_form_unit; break; + default: + break; } if ( btn_height > max_height ) btn_height = max_height; @@ -3507,7 +3545,7 @@ void xi_button_rect_calc( XI_OBJ * btn_obj, int sequence ) { XinRect rct; - BOOLEAN packed; /* button has no dflt or focus rects */ + BOOLEAN packed = FALSE; /* button has no dflt or focus rects */ if ( btn_obj->parent->type == XIT_CONTAINER ) { @@ -3538,6 +3576,10 @@ xi_button_rect_calc( XI_OBJ * btn_obj, int sequence ) row = sequence - col * cdata->nbr_down; packed = cdata->packed; break; + default: + row = col = 0; + break; + } rct.top = cdata->rct.top + row * cdata->step_down; rct.left = cdata->rct.left + col * cdata->step_across; @@ -3677,6 +3719,8 @@ xi_def_get_font( XI_OBJ_DEF * obj_def ) } #endif break; + default: + break; } if ( font != NULL ) return font; @@ -3903,6 +3947,8 @@ xi_get_native_controls( XI_OBJ * obj ) return FALSE; case XIBT_NATIVE: return TRUE; + default: + break; } return ( BOOLEAN ) xi_get_pref( XI_PREF_NATIVE_CTRLS ); } diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index d0ed1fb54..bcd61e72d 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -19,11 +19,11 @@ #ifdef WIN32 #include "oswin32.h" +#include #else #include #include "oslinux.h" #endif -#include // Funzione interna di utilita' MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m); @@ -952,7 +952,7 @@ void TwxWindow::SetMenuTree(const MENU_ITEM* tree) TwxWindow::TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : TwxWindowBase(parent, id, title, pos, size, style), - _timer(NULL), m_menu(NULL), _eh(NULL) + m_menu(NULL), _eh(NULL), _timer(NULL) { _nice_windows.Put((WINDOW)this, this); } @@ -2100,7 +2100,6 @@ int xvt_dwin_get_text_width(WINDOW win, const char *s, int len) void xvt_dwin_invalidate_rect(WINDOW win, RCT* rctp) { CAST_WIN(win, w); - CAST_TDC(win, dc); if (rctp) { const wxRect rct = NormalizeRCT(rctp); @@ -2202,7 +2201,6 @@ void xvt_dwin_set_fore_color(WINDOW win, COLOR color) void xvt_dwin_set_std_cpen(WINDOW win, long flag) { - CAST_TDC(win, dc); CPEN pen; memset(&pen, 0, sizeof(CPEN)); pen.style = P_SOLID;