Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* locale/findlocale.c: Add casts to avoid warnings.
	* locale/localeinfo.h (LIMAGIC): Add cast to avoid warnings.
	* misc/efgcvt_r.c (fcvt_r): Use ssize_t instead of int and add cast
	to avoid warnings.
	* misc/tsearch.c (const_node): New type.
	(trecurse): Correct casts to avoid warnings.
	(__twalk): Likewise.
	* stdlib/tst-limits.c: Add z modifier to formats for WORD_BIT and
	LONG_BIT.

	* debug/backtrace-tst.c (compare): Add casts to avoid warnings.
  • Loading branch information
Ulrich Drepper committed Nov 25, 2000
1 parent 9c0592a commit 2a068d2
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 121 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
2000-11-24 Ulrich Drepper <drepper@redhat.com>

* locale/findlocale.c: Add casts to avoid warnings.
* locale/localeinfo.h (LIMAGIC): Add cast to avoid warnings.
* misc/efgcvt_r.c (fcvt_r): Use ssize_t instead of int and add cast
to avoid warnings.
* misc/tsearch.c (const_node): New type.
(trecurse): Correct casts to avoid warnings.
(__twalk): Likewise.
* stdlib/tst-limits.c: Add z modifier to formats for WORD_BIT and
LONG_BIT.

* debug/backtrace-tst.c (compare): Add casts to avoid warnings.

* test-skeleton.c: Mark local functions as static to avoid warnings.

2000-11-23 H.J. Lu <hjl@gnu.org>
Expand Down
220 changes: 111 additions & 109 deletions configure

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion debug/backtrace-tst.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ compare (const void *p1, const void *p2)
}
}

return *(uint32_t *) p1 - *(uint32_t *) p2;
return *(const uint32_t *) p1 - *(const uint32_t *) p2;
}


Expand Down
4 changes: 2 additions & 2 deletions locale/findlocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
/* Determine the locale name for which loading succeeded. This
information comes from the file name. The form is
<path>/<locale>/LC_foo. We must extract the <locale> part. */
if (((struct locale_data *) locale_file->data)->name == NULL)
if (((const struct locale_data *) locale_file->data)->name == NULL)
{
char *cp, *endp;

Expand All @@ -185,7 +185,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
((struct locale_data *) locale_file->data)->use_translit = 1;

/* Increment the usage count. */
if (((struct locale_data *) locale_file->data)->usage_count
if (((const struct locale_data *) locale_file->data)->usage_count
< MAX_USAGE_COUNT)
++((struct locale_data *) locale_file->data)->usage_count;

Expand Down
2 changes: 1 addition & 1 deletion locale/localeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <intl/loadinfo.h> /* For loaded_l10nfile definition. */

/* Magic number at the beginning of a locale data file for CATEGORY. */
#define LIMAGIC(category) (0x20000828 ^ (category))
#define LIMAGIC(category) ((unsigned int) (0x20000828 ^ (category)))

/* Two special weight constants for the collation data. */
#define IGNORE_CHAR 2
Expand Down
7 changes: 4 additions & 3 deletions misc/efgcvt_r.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Compatibility functions for floating point formatting, reentrant versions.
Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -60,7 +60,8 @@ APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
char *buf;
size_t len;
{
int n, i;
ssize_t n;
ssize_t i;
int left;

if (buf == NULL)
Expand Down Expand Up @@ -102,7 +103,7 @@ APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
n = __snprintf (buf, len, "%.*" FLOAT_FMT_FLAG "f", MIN (ndigit, NDIGIT_MAX),
value);
/* Check for a too small buffer. */
if (n >= len)
if (n >= (ssize_t) len)
return -1;

i = 0;
Expand Down
7 changes: 4 additions & 3 deletions misc/tsearch.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
Expand Down Expand Up @@ -97,6 +97,7 @@ typedef struct node_t
struct node_t *right;
unsigned int red:1;
} *node;
typedef const struct node_t *const_node;

#undef DEBUGGING

Expand Down Expand Up @@ -594,7 +595,7 @@ static void
internal_function
trecurse (const void *vroot, __action_fn_t action, int level)
{
node root = (node ) vroot;
const_node root = (const_node) vroot;

if (root->left == NULL && root->right == NULL)
(*action) (root, leaf, level);
Expand All @@ -617,7 +618,7 @@ trecurse (const void *vroot, __action_fn_t action, int level)
void
__twalk (const void *vroot, __action_fn_t action)
{
const node root = (node) vroot;
const_node root = (const_node) vroot;

CHECK_TREE (root);

Expand Down
4 changes: 2 additions & 2 deletions stdlib/tst-limits.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ main (void)
TEST (PAGE_SIZE, "d", getpagesize ());
#endif

TEST (WORD_BIT, "d", sizeof (int) * CHAR_BIT);
TEST (LONG_BIT, "d", sizeof (long int) * CHAR_BIT);
TEST (WORD_BIT, "zd", sizeof (int) * CHAR_BIT);
TEST (LONG_BIT, "zd", sizeof (long int) * CHAR_BIT);

return result;
}

0 comments on commit 2a068d2

Please sign in to comment.