disable the alignment "fix" until its clear why it causes crashes
This commit is contained in:
parent
2e3a08e4bd
commit
2984b5bea2
1 changed files with 22 additions and 4 deletions
|
@ -20,6 +20,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
===========================================================================
|
===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#define ALIGN(x) \
|
||||||
|
do { \
|
||||||
|
size_t oldx = x; \
|
||||||
|
x = (x+sizeof(void*)-1) & ~(sizeof(void*)-1L); \
|
||||||
|
if(x != oldx) \
|
||||||
|
botimport.Print(PRT_MESSAGE, "size %zd -> %zd\n", oldx, x); \
|
||||||
|
} while(0)
|
||||||
|
#else
|
||||||
|
#define ALIGN(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* name: be_ai_chat.c
|
* name: be_ai_chat.c
|
||||||
*
|
*
|
||||||
|
@ -689,7 +701,8 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
|
||||||
FreeSource(source);
|
FreeSource(source);
|
||||||
return NULL;
|
return NULL;
|
||||||
} //end if
|
} //end if
|
||||||
len = (strlen(token.string) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
len = strlen(token.string) + 1;
|
||||||
|
ALIGN(len);
|
||||||
size += sizeof(bot_synonym_t) + len;
|
size += sizeof(bot_synonym_t) + len;
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
|
@ -987,7 +1000,8 @@ bot_randomlist_t *BotLoadRandomStrings(char *filename)
|
||||||
FreeSource(source);
|
FreeSource(source);
|
||||||
return NULL;
|
return NULL;
|
||||||
} //end if
|
} //end if
|
||||||
len = (strlen(token.string) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
len = strlen(token.string) + 1;
|
||||||
|
ALIGN(len);
|
||||||
size += sizeof(bot_randomlist_t) + len;
|
size += sizeof(bot_randomlist_t) + len;
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
|
@ -1017,7 +1031,8 @@ bot_randomlist_t *BotLoadRandomStrings(char *filename)
|
||||||
FreeSource(source);
|
FreeSource(source);
|
||||||
return NULL;
|
return NULL;
|
||||||
} //end if
|
} //end if
|
||||||
len = (strlen(chatmessagestring) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
len = strlen(chatmessagestring) + 1;
|
||||||
|
ALIGN(len);
|
||||||
size += sizeof(bot_randomstring_t) + len;
|
size += sizeof(bot_randomstring_t) + len;
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
|
@ -2120,6 +2135,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
|
||||||
} //end if
|
} //end if
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
|
size_t len;
|
||||||
chatmessage = (bot_chatmessage_t *) ptr;
|
chatmessage = (bot_chatmessage_t *) ptr;
|
||||||
chatmessage->time = -2*CHATMESSAGE_RECENTTIME;
|
chatmessage->time = -2*CHATMESSAGE_RECENTTIME;
|
||||||
//put the chat message in the list
|
//put the chat message in the list
|
||||||
|
@ -2129,7 +2145,9 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
|
||||||
ptr += sizeof(bot_chatmessage_t);
|
ptr += sizeof(bot_chatmessage_t);
|
||||||
chatmessage->chatmessage = ptr;
|
chatmessage->chatmessage = ptr;
|
||||||
strcpy(chatmessage->chatmessage, chatmessagestring);
|
strcpy(chatmessage->chatmessage, chatmessagestring);
|
||||||
ptr += (strlen(chatmessagestring) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
len = strlen(chatmessagestring) + 1;
|
||||||
|
ALIGN(len);
|
||||||
|
ptr += len;
|
||||||
//the number of chat messages increased
|
//the number of chat messages increased
|
||||||
chattype->numchatmessages++;
|
chattype->numchatmessages++;
|
||||||
} //end if
|
} //end if
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue