mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 14:41:42 +00:00
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
|
||||
*
|
||||
|
@ -689,7 +701,8 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
|
|||
FreeSource(source);
|
||||
return NULL;
|
||||
} //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;
|
||||
if (pass)
|
||||
{
|
||||
|
@ -987,7 +1000,8 @@ bot_randomlist_t *BotLoadRandomStrings(char *filename)
|
|||
FreeSource(source);
|
||||
return NULL;
|
||||
} //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;
|
||||
if (pass)
|
||||
{
|
||||
|
@ -1017,7 +1031,8 @@ bot_randomlist_t *BotLoadRandomStrings(char *filename)
|
|||
FreeSource(source);
|
||||
return NULL;
|
||||
} //end if
|
||||
len = (strlen(chatmessagestring) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
||||
len = strlen(chatmessagestring) + 1;
|
||||
ALIGN(len);
|
||||
size += sizeof(bot_randomstring_t) + len;
|
||||
if (pass)
|
||||
{
|
||||
|
@ -2120,6 +2135,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
|
|||
} //end if
|
||||
if (pass)
|
||||
{
|
||||
size_t len;
|
||||
chatmessage = (bot_chatmessage_t *) ptr;
|
||||
chatmessage->time = -2*CHATMESSAGE_RECENTTIME;
|
||||
//put the chat message in the list
|
||||
|
@ -2129,7 +2145,9 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
|
|||
ptr += sizeof(bot_chatmessage_t);
|
||||
chatmessage->chatmessage = ptr;
|
||||
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
|
||||
chattype->numchatmessages++;
|
||||
} //end if
|
||||
|
|
Loading…
Reference in a new issue