recode functions to shrink size

This commit is contained in:
Mike Frysinger
2005-06-11 00:08:50 +00:00
parent 942e137679
commit 85cffcc83d
9 changed files with 92 additions and 109 deletions

View File

@@ -17,20 +17,20 @@
#include "e2p.h"
struct hash {
int num;
const char *string;
int num;
const char *string;
};
static struct hash hash_list[] = {
{ EXT2_HASH_LEGACY, "legacy" },
{ EXT2_HASH_HALF_MD4, "half_md4" },
{ EXT2_HASH_TEA, "tea" },
{ 0, 0 },
{ EXT2_HASH_LEGACY, "legacy" },
{ EXT2_HASH_HALF_MD4, "half_md4" },
{ EXT2_HASH_TEA, "tea" },
{ 0, 0 },
};
const char *e2p_hash2string(int num)
{
struct hash *p;
struct hash *p;
static char buf[20];
for (p = hash_list; p->string; p++) {
@@ -46,9 +46,9 @@ const char *e2p_hash2string(int num)
*/
int e2p_string2hash(char *string)
{
struct hash *p;
char *eptr;
int num;
struct hash *p;
char *eptr;
int num;
for (p = hash_list; p->string; p++) {
if (!strcasecmp(string, p->string)) {
@@ -67,4 +67,3 @@ int e2p_string2hash(char *string)
return -1;
return num;
}