From bb7b3911bb9f8b3492e2ed075b17277b183d8a98 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 21 Apr 2013 22:39:23 +1000 Subject: [PATCH] allow the horrible hack of writing -1 to a pointer to work on amd64 --- code/ui/ui_shared.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/code/ui/ui_shared.cpp b/code/ui/ui_shared.cpp index d26436f..07819f0 100644 --- a/code/ui/ui_shared.cpp +++ b/code/ui/ui_shared.cpp @@ -3503,7 +3503,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item) PC_ParseWarning("end of file inside menu item\n"); return qfalse; } - if ((int)token > 0) //a normal StringAlloc ptr + if ((intptr_t)token > 0) //a normal StringAlloc ptr { if (*token == '}') { @@ -3576,7 +3576,7 @@ qboolean ItemParse_cvarFloatList( itemDef_t *item) PC_ParseWarning("end of file inside menu item\n"); return qfalse; } - if ((int)token > 0) //a normal StringAlloc ptr + if ((intptr_t)token > 0) //a normal StringAlloc ptr { if (*token == '}') { @@ -4727,7 +4727,7 @@ void Item_SetTextExtents(itemDef_t *item, int *width, int *height, const char *t // keeps us from computing the widths and heights more than once if (*width == 0 || (item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ITEM_ALIGN_CENTER) - || ((int)item->text<0 && item->asset != sp_language->modificationCount ) //string package language changed + || ((intptr_t)item->text<0 && item->asset != sp_language->modificationCount ) //string package language changed ) { int originalWidth; @@ -4762,7 +4762,7 @@ void Item_SetTextExtents(itemDef_t *item, int *width, int *height, const char *t } ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window); - if ((int)item->text<0 )//string package + if ((intptr_t)item->text<0 )//string package {//mark language item->asset = sp_language->modificationCount; } @@ -4851,9 +4851,9 @@ void Item_Text_Wrapped_Paint(itemDef_t *item) else { textPtr = item->text; - if ((int)textPtr < 0) //string package ID + if ((intptr_t)textPtr < 0) //string package ID { - textPtr = SP_GetStringText(-(int)textPtr); + textPtr = SP_GetStringText(-(intptr_t)textPtr); } } @@ -4921,9 +4921,9 @@ void Item_Text_Paint(itemDef_t *item) else { textPtr = item->text; - if ((int)textPtr < 0) + if ((intptr_t)textPtr < 0) { - textPtr = SP_GetStringText(-(int)textPtr); + textPtr = SP_GetStringText(-(intptr_t)textPtr); } } @@ -4940,9 +4940,9 @@ void Item_Text_Paint(itemDef_t *item) if (item->text2) // Is there a second line of text? { - if ((int)item->text2 < 0) + if ((intptr_t)item->text2 < 0) { - textPtr = SP_GetStringText(-(int)item->text2); + textPtr = SP_GetStringText(-(intptr_t)item->text2); } else { @@ -5615,9 +5615,9 @@ void Item_Multi_Paint(itemDef_t *item) } text = Item_Multi_Setting(item); - if ((int)text < 0) //it's a striped ID + if ((intptr_t)text < 0) //it's a striped ID { - text = SP_GetStringText(-(int)text); + text = SP_GetStringText(-(intptr_t)text); } assert (text); @@ -5973,9 +5973,9 @@ void Item_Paint(itemDef_t *item) else { // Draw the desctext const char *textPtr; - if ((int)item->descText < 0) + if ((intptr_t)item->descText < 0) { - textPtr = SP_GetStringText(-(int)item->descText); + textPtr = SP_GetStringText(-(intptr_t)item->descText); } else { @@ -6330,9 +6330,9 @@ void Item_Text_AutoWrapped_Paint(itemDef_t *item) else { textPtr = item->text; - if ((int)textPtr < 0) //string package ID + if ((intptr_t)textPtr < 0) //string package ID { - textPtr = SP_GetStringText(-(int)textPtr); + textPtr = SP_GetStringText(-(intptr_t)textPtr); } }