_INLINE_ int ext2fs_find_first_bit_set(void * addr, unsigned size)
 {
-       char    *cp = (unsigned char *) addr;
+       unsigned char   *cp = (unsigned char *) addr;
        int     res = 0, d0;
 
        if (!size)
 
    to strcmp.
    If CHECK is false, crypt KEY and save the result in CRYPTED.
    CRYPTED must have a salt.  */
-extern int md5_password (const char *key, char *crypted, int check);
+extern int md5_password (const unsigned char *key, unsigned char *crypted, int check);
 
 /* For convenience.  */
 #define check_md5_password(key,crypted)        md5_password((key), (crypted), 1)
 
 static unsigned long read_max;
 static struct boot_file_t* read_cur_file;
 static errcode_t read_result;
-static char* read_buffer;
+static unsigned char* read_buffer;
 
 static int read_dump_range(void);
 static int read_iterator(ext2_filsys fs, blk_t *blocknr, int lg_block, void *private);
 
      int i;
      unsigned char *buffer;
      /* Make static to move into the BSS rather then the stack */
-     static unsigned char device_name[1024];
+     static char device_name[1024];
 
      DEBUG_ENTER;
      DEBUG_OPEN;
 
        int toread;
        static char *usual[2] = {".", ".."};
        static xfs_dir2_sf_entry_t *sfe;
-       char *name = usual[0];
+       unsigned char *name = (unsigned char *)usual[0];
 
        if (xfs.dirpos >= xfs.dirmax) {
                if (xfs.forw == 0)
 #undef dau
                toread = roundup8 (namelen + 11) - 9;
                xfs_read_data (dirbuf, toread);
-               name = (char *)dirbuf;
+               name = (unsigned char *)dirbuf;
                xfs.blkoff += toread + 5;
                break;
        }
        ++xfs.dirpos;
        name[namelen] = 0;
 
-       return name;
+       return (char *)name;
 }
 
 static char *
 
 }
 
 static void
-md5_update (const char *input, int inputlen)
+md5_update (const unsigned char *input, int inputlen)
 {
   int buflen = length & 63;
   length += inputlen;
    If CHECK is false, crypt KEY and save the result in CRYPTED.
    CRYPTED must have a salt.  */
 int
-md5_password (const char *key, char *crypted, int check)
+md5_password (const unsigned char *key, unsigned char *crypted, int check)
 {
-  int keylen = strlen (key);
-  char *salt = crypted + 3; /* skip $1$ header */
-  char *p;
+  int keylen = strlen ((char *)key);
+  unsigned char *salt = crypted + 3; /* skip $1$ header */
+  unsigned char *p;
   int saltlen;
   int i, n;
   unsigned char alt_result[16];
   unsigned char *digest;
 
   if (check)
-    saltlen = strstr (salt, "$") - salt;
+    saltlen = strstr ((char *)salt, "$") - (char* )salt;
   else
     {
-      char *end = strstr (salt, "$");
+      unsigned char *end = (unsigned char*)strstr ((char *)salt, "$");
       if (end && end - salt < 8)
        saltlen = end - salt;
       else
 
      struct partition_t* list = NULL;
      unsigned int prom_blksize, iso_root_block;
 
-     strncpy(block_buffer, device, 2040);
+     strncpy((char *)block_buffer, device, 2040);
      if (_machine != _MACH_bplan)
-         strcat(block_buffer, ":0");
+         strcat((char *)block_buffer, ":0");
 
      /* Open device */
-     disk = prom_open(block_buffer);
+     disk = prom_open((char *)block_buffer);
      if (disk == NULL) {
          prom_printf("Can't open device <%s>\n", block_buffer);
          goto bail;
 
          prom_printf ("\n");
 #ifdef USE_MD5_PASSWORDS
          if (!strncmp (password, "$1$", 3)) {
-              if (!check_md5_password(passwdbuff, password))
+              if (!check_md5_password((unsigned char*)passwdbuff, (unsigned char*)password))
                    return;
          }
          else if (!strcmp (password, passwdbuff))
 
      PUT_32BE(ns, strlen(arch) + 1);
      PUT_32BE(ns + 4, N_DESCR * 4);
      PUT_32BE(ns + 8, 0x1275);
-     strcpy(&buf[ns + 12], arch);
+     strcpy((char *)&buf[ns + 12], arch);
      ns += 12 + strlen(arch) + 1;
      for (i = 0; i < N_DESCR; ++i, ns += 4)
          PUT_32BE(ns, descr[i]);
      PUT_32BE(ns, strlen(rpaname) + 1);
      PUT_32BE(ns + 4, sizeof(rpanote));
      PUT_32BE(ns + 8, 0x12759999);
-     strcpy(&buf[ns + 12], rpaname);
+     strcpy((char *)&buf[ns + 12], rpaname);
      ns += 12 + ROUNDUP(strlen(rpaname) + 1);
      for (i = 0; i < N_RPA_DESCR; ++i, ns += 4)
          PUT_32BE(ns, rpanote[i]);