mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
Don't cast char array to long and write to it! Newer arm compilers
don't like this -- or maybe I was just lucky until now.
This commit is contained in:
parent
ea7949dd22
commit
1d61635ebd
1 changed files with 7 additions and 7 deletions
|
@ -1713,9 +1713,9 @@ board_requestHint( BoardCtxt* board,
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
{
|
{
|
||||||
|
XP_Bool success = XP_TRUE;
|
||||||
XP_Rect cellRect;
|
XP_Rect cellRect;
|
||||||
Tile tile;
|
Tile tile;
|
||||||
XP_UCHAR ch[4];
|
|
||||||
XP_Bool isBlank, isEmpty, recent, pending = XP_FALSE;
|
XP_Bool isBlank, isEmpty, recent, pending = XP_FALSE;
|
||||||
XWBonusType bonus;
|
XWBonusType bonus;
|
||||||
ModelCtxt* model = board->model;
|
ModelCtxt* model = board->model;
|
||||||
|
@ -1738,6 +1738,7 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
/* This 'while' is only here so I can 'break' below */
|
/* This 'while' is only here so I can 'break' below */
|
||||||
while ( board->trayVisState == TRAY_HIDDEN ||
|
while ( board->trayVisState == TRAY_HIDDEN ||
|
||||||
!rectContainsRect( &board->trayBounds, &cellRect ) ) {
|
!rectContainsRect( &board->trayBounds, &cellRect ) ) {
|
||||||
|
XP_UCHAR ch[4] = {'\0'};
|
||||||
XP_S16 owner = -1;
|
XP_S16 owner = -1;
|
||||||
XP_Bool invert = XP_FALSE;
|
XP_Bool invert = XP_FALSE;
|
||||||
XP_Bitmap bitmap = NULL;
|
XP_Bitmap bitmap = NULL;
|
||||||
|
@ -1749,7 +1750,6 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
selPlayer, &tile, &isBlank,
|
selPlayer, &tile, &isBlank,
|
||||||
&pending, &recent );
|
&pending, &recent );
|
||||||
|
|
||||||
*(unsigned long*)&ch[0] = 0L;
|
|
||||||
if ( isEmpty ) {
|
if ( isEmpty ) {
|
||||||
isBlank = XP_FALSE;
|
isBlank = XP_FALSE;
|
||||||
} else if ( isBlank && skipBlanks ) {
|
} else if ( isBlank && skipBlanks ) {
|
||||||
|
@ -1771,7 +1771,7 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
XP_ASSERT( !!bitmap );
|
XP_ASSERT( !!bitmap );
|
||||||
textP = (XP_UCHAR*)NULL;
|
textP = (XP_UCHAR*)NULL;
|
||||||
} else {
|
} else {
|
||||||
dict_tilesToString( dict, &tile, 1, ch, sizeof(ch) );
|
(void)dict_tilesToString( dict, &tile, 1, ch, sizeof(ch) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bonus = util_getSquareBonus( board->util, model, col, row );
|
bonus = util_getSquareBonus( board->util, model, col, row );
|
||||||
|
@ -1793,12 +1793,12 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return draw_drawCell( board->draw, &cellRect, textP, bitmap,
|
success = draw_drawCell( board->draw, &cellRect, textP, bitmap,
|
||||||
tile, owner, bonus, hintAtts, flags );
|
tile, owner, bonus, hintAtts, flags );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
return XP_TRUE;
|
|
||||||
} /* drawCell */
|
} /* drawCell */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue