summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-12-22 21:16:17 +0100
committerWolfgang Denk <wd@denx.de>2010-12-22 21:16:17 +0100
commitcdc51c294ad33879c4e57edf4c9d2155381b1d59 (patch)
treefc1c3f2c23a2507e91358a6a6dfa881965bf603f /lib
parent250ef029844be2cb98635f265359396866d1749f (diff)
parentb8339e2b9f32663411dba0f48e25b23f542d53bc (diff)
downloadu-boot-imx-cdc51c294ad33879c4e57edf4c9d2155381b1d59.zip
u-boot-imx-cdc51c294ad33879c4e57edf4c9d2155381b1d59.tar.gz
u-boot-imx-cdc51c294ad33879c4e57edf4c9d2155381b1d59.tar.bz2
Merge branch 'next' of ../next
Diffstat (limited to 'lib')
-rw-r--r--lib/ctype.c2
-rw-r--r--lib/hashtable.c40
-rw-r--r--lib/net_utils.c2
-rw-r--r--lib/vsprintf.c2
4 files changed, 4 insertions, 42 deletions
diff --git a/lib/ctype.c b/lib/ctype.c
index 6ed0468..dffe563 100644
--- a/lib/ctype.c
+++ b/lib/ctype.c
@@ -29,7 +29,7 @@
#include <linux/ctype.h>
-unsigned char _ctype[] = {
+const unsigned char _ctype[] = {
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 7ac3ddd..b47f3b6 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -60,11 +60,6 @@
*/
/*
- * The non-reentrant version use a global space for storing the hash table.
- */
-static struct hsearch_data htab;
-
-/*
* The reentrant version has no static variables to maintain the state.
* Instead the interface of all functions is extended to take an argument
* which describes the current status.
@@ -97,11 +92,6 @@ static int isprime(unsigned int number)
return number % div != 0;
}
-int hcreate(size_t nel)
-{
- return hcreate_r(nel, &htab);
-}
-
/*
* Before using the hash table we must allocate memory for it.
* Test for an existing table are done. We allocate one element
@@ -110,6 +100,7 @@ int hcreate(size_t nel)
* The contents of the table is zeroed, especially the field used
* becomes zero.
*/
+
int hcreate_r(size_t nel, struct hsearch_data *htab)
{
/* Test for correct arguments. */
@@ -143,15 +134,12 @@ int hcreate_r(size_t nel, struct hsearch_data *htab)
/*
* hdestroy()
*/
-void hdestroy(void)
-{
- hdestroy_r(&htab);
-}
/*
* After using the hash table it has to be destroyed. The used memory can
* be freed and the local static variable can be marked as not used.
*/
+
void hdestroy_r(struct hsearch_data *htab)
{
int i;
@@ -214,15 +202,6 @@ void hdestroy_r(struct hsearch_data *htab)
* example for functions like hdelete().
*/
-ENTRY *hsearch(ENTRY item, ACTION action)
-{
- ENTRY *result;
-
- (void) hsearch_r(item, action, &result, &htab);
-
- return result;
-}
-
int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
struct hsearch_data *htab)
{
@@ -369,11 +348,6 @@ int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
* do that.
*/
-int hdelete(const char *key)
-{
- return hdelete_r(key, &htab);
-}
-
int hdelete_r(const char *key, struct hsearch_data *htab)
{
ENTRY e, *ep;
@@ -442,11 +416,6 @@ int hdelete_r(const char *key, struct hsearch_data *htab)
* bytes in the string will be '\0'-padded.
*/
-ssize_t hexport(const char sep, char **resp, size_t size)
-{
- return hexport_r(&htab, sep, resp, size);
-}
-
static int cmpkey(const void *p1, const void *p2)
{
ENTRY *e1 = *(ENTRY **) p1;
@@ -605,11 +574,6 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep,
* '\0' and '\n' have really been tested.
*/
-int himport(const char *env, size_t size, const char sep, int flag)
-{
- return himport_r(&htab, env, size, sep, flag);
-}
-
int himport_r(struct hsearch_data *htab,
const char *env, size_t size, const char sep, int flag)
{
diff --git a/lib/net_utils.c b/lib/net_utils.c
index f03b098..b425a68 100644
--- a/lib/net_utils.c
+++ b/lib/net_utils.c
@@ -28,7 +28,7 @@
#include <common.h>
-IPaddr_t string_to_ip(char *s)
+IPaddr_t string_to_ip(const char *s)
{
IPaddr_t addr;
char *e;
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index aa214dd..61e6f0d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -17,8 +17,6 @@
#include <common.h>
#if !defined (CONFIG_PANIC_HANG)
#include <command.h>
-/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
#endif
#include <div64.h>