/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.25 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.26 2012/03/10 23:43:41 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
assert(menu && menu->items);
for (items = menu->items; *items; items++)
{
- check = _nc_Calculate_Text_Width(&((*items)->name));
+ check = (unsigned) _nc_Calculate_Text_Width(&((*items)->name));
if (check > MaximumNameLength)
MaximumNameLength = check;
- check = _nc_Calculate_Text_Width(&((*items)->description));
+ check = (unsigned) _nc_Calculate_Text_Width(&((*items)->description));
if (check > MaximumDescriptionLength)
MaximumDescriptionLength = check;
}
- menu->namelen = MaximumNameLength;
- menu->desclen = MaximumDescriptionLength;
+ menu->namelen = (short) MaximumNameLength;
+ menu->desclen = (short) MaximumDescriptionLength;
T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
}
{
(*item)->value = FALSE;
}
- (*item)->index = ItemCount++;
+ (*item)->index = (short) ItemCount++;
(*item)->imenu = menu;
}
}
if (ItemCount != 0)
{
menu->items = items;
- menu->nitems = ItemCount;
+ menu->nitems = (short) ItemCount;
ComputeMaximum_NameDesc_Lengths(menu);
if ((menu->pattern = typeMalloc(char, (unsigned)(1 + menu->namelen))))
{
T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
if (result != 0 && item->str != 0)
{
- int count = mbstowcs(0, item->str, 0);
+ int count = (int) mbstowcs(0, item->str, 0);
wchar_t *temp = 0;
if (count > 0
assert(menu);
- menu->height = 1 + menu->spc_rows * (menu->arows - 1);
+ menu->height = (short) (1 + menu->spc_rows * (menu->arows - 1));
l = calculate_actual_width(menu, TRUE);
l += menu->marklen;
l += menu->spc_desc;
}
- menu->itemlen = l;
+ menu->itemlen = (short) l;
l *= menu->cols;
l += (menu->cols - 1) * menu->spc_cols; /* for the padding between the columns */
- menu->width = l;
+ menu->width = (short) l;
T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
menu->cols,
int Last_in_Column;
bool cycle = (menu->opt & O_NONCYCLIC) ? FALSE : TRUE;
- menu->status &= ~_LINK_NEEDED;
+ menu->status &= (unsigned short) (~_LINK_NEEDED);
if (menu->opt & O_ROWMAJOR)
{
(cycle ? menu->items[(row + 1) < menu->rows ?
Number_Of_Items - 1 : col] :
(ITEM *) 0);
- item->x = col;
- item->y = row;
+ item->x = (short) col;
+ item->y = (short) row;
if (++col == Number_Of_Columns)
{
row++;
(ITEM *) 0
);
- item->x = col;
- item->y = row;
+ item->x = (short) col;
+ item->y = (short) row;
if ((++row) == Number_Of_Rows)
{
col++;
cur_item = menu->curitem;
assert(cur_item);
- menu->toprow = new_toprow;
+ menu->toprow = (short) new_toprow;
menu->curitem = new_current_item;
if (mterm_called)
}
else
{ /* if we are not posted, this is quite simple */
- menu->toprow = new_toprow;
+ menu->toprow = (short) new_toprow;
menu->curitem = new_current_item;
}
}