mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
fix just the warnings; VSIZE is safe
This commit is contained in:
parent
bbe69f6398
commit
7fba555d33
1 changed files with 7 additions and 5 deletions
|
@ -1181,7 +1181,7 @@ gtk_draw_measureScoreText( DrawCtx* p_dctx, const XP_Rect* bounds,
|
||||||
XP_U16* widthP, XP_U16* heightP )
|
XP_U16* widthP, XP_U16* heightP )
|
||||||
{
|
{
|
||||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||||
XP_UCHAR buf[36];
|
XP_UCHAR buf[VSIZE(dctx->scoreCache[0].str)];
|
||||||
PangoLayout* layout;
|
PangoLayout* layout;
|
||||||
int lineHeight = GTK_HOR_SCORE_HEIGHT, nLines;
|
int lineHeight = GTK_HOR_SCORE_HEIGHT, nLines;
|
||||||
|
|
||||||
|
@ -1404,10 +1404,12 @@ gtkDrawCtxtMake( GtkWidget* drawing_area, GtkGameGlobals* globals )
|
||||||
{
|
{
|
||||||
GtkDrawCtx* dctx = g_malloc0( sizeof(*dctx) );
|
GtkDrawCtx* dctx = g_malloc0( sizeof(*dctx) );
|
||||||
|
|
||||||
dctx->vtable = g_malloc( sizeof(*(((GtkDrawCtx*)dctx)->vtable)) );
|
size_t tableSize = sizeof(*(((GtkDrawCtx*)dctx)->vtable));
|
||||||
|
dctx->vtable = g_malloc( tableSize );
|
||||||
for ( int ii = 0; ii < VSIZE(dctx->vtable); ++ii ) {
|
void** ptr = (void**)dctx->vtable;
|
||||||
((void**)(dctx->vtable))[ii] = draw_doNothing; /* bad? */
|
void** end = (void**)(((unsigned char*)ptr) + tableSize);
|
||||||
|
while ( ptr < end ) {
|
||||||
|
*ptr++ = draw_doNothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_VTABLE_ENTRY( dctx->vtable, draw_clearRect, gtk );
|
SET_VTABLE_ENTRY( dctx->vtable, draw_clearRect, gtk );
|
||||||
|
|
Loading…
Reference in a new issue