move LOG_OFFSET

This commit is contained in:
ehouse 2007-09-30 17:22:38 +00:00
parent 302abd3be5
commit b289d291f9
2 changed files with 10 additions and 26 deletions

View file

@ -1,6 +1,7 @@
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
/*
* Copyright 2006 by Eric House (xwords@eehouse.org). All rights reserved.
* Copyright 2006-2007 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,4 +27,12 @@
const char* frmObjId_2str( XP_U16 id );
const char* eType_2str( eventsEnum eType );
/* Useful for writing pace_man functions. */
#define LOG_OFFSET( s, f ) \
{ s _s; \
XP_LOGF( "offset of " #f " in " #s \
": %d (size: %ld)", OFFSET_OF( s, f ), \
sizeof(_s.f) ); \
}
#endif

View file

@ -1045,31 +1045,6 @@ canConvertPrefs( XWords4PreferenceType* prefs, UInt16 prefSize, XP_S16 vers )
return success;
} /* canConvertPrefs */
#ifdef MEM_DEBUG
# if 0
# define LOG_OFFSET( s, f ) \
{ s _s; \
XP_LOGF( "offset of " #f " in " #s \
": %d (size: %ld)", OFFSET_OF( s, f ), \
sizeof(_s.f) ); \
}
static void
printOffsets( void )
{
LOG_OFFSET( XWords4PreferenceType, versionNum );
LOG_OFFSET( XWords4PreferenceType, curGameIndex );
LOG_OFFSET( XWords4PreferenceType, showProgress );
LOG_OFFSET( XWords4PreferenceType, showGrid );
LOG_OFFSET( XWords4PreferenceType, showColors );
LOG_OFFSET( XWords4PreferenceType, cp );
LOG_OFFSET( XWords4PreferenceType, focusItem );
} /* printOffsets */
# undef LOG_OFFSET
# endif
#endif
/*****************************************************************************
*
****************************************************************************/