summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 6ed0468a21..dffe563724 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 7ac3dddda6..b47f3b69b0 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 f03b098e9c..b425a68d91 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 aa214dd06f..61e6f0d2b3 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>