1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Avoid g++ -Wold-style-cast warnings.

This commit is contained in:
Bruno Haible
2002-11-21 13:04:08 +00:00
parent befb3d467e
commit 32f5ea88cf
9 changed files with 34 additions and 23 deletions

View File

@@ -217,7 +217,7 @@ output_string (const char *key, int len)
putchar ('"');
for (; len > 0; len--)
{
unsigned char c = (unsigned char) *key++;
unsigned char c = static_cast<unsigned char>(*key++);
if (isprint (c))
{
if (c == '"' || c == '\\')
@@ -1020,7 +1020,7 @@ output_switches (KeywordExt_List *list, int num_switches, int size, int min_hash
{
int part1 = num_switches / 2;
int part2 = num_switches - part1;
int size1 = (int)((double)size / (double)num_switches * (double)part1 + 0.5);
int size1 = static_cast<int>(static_cast<double>(size) / static_cast<double>(num_switches) * static_cast<double>(part1) + 0.5);
int size2 = size - size1;
KeywordExt_List *temp = list;