Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 73455 Details for
Bug 113399
app-crypt/hashsum-1.6 is TESTED on AMD64
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix typecasting problem, also works with hashsum-1.7
hashsum-1.6-amd64.patch (text/plain), 2.49 KB, created by
Nico Erfurth
on 2005-11-23 14:56:24 UTC
(
hide
)
Description:
Patch to fix typecasting problem, also works with hashsum-1.7
Filename:
MIME Type:
Creator:
Nico Erfurth
Created:
2005-11-23 14:56:24 UTC
Size:
2.49 KB
patch
obsolete
>diff -uNr hashsum/hasher/hashcom.c hashsum-amd64/hasher/hashcom.c >--- hashsum/hasher/hashcom.c 2004-01-09 00:18:02.000000000 +0100 >+++ hashsum-amd64/hasher/hashcom.c 2005-11-23 22:58:05.000000000 +0100 >@@ -75,31 +75,29 @@ > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }; > >-const void* crypto_hash_name_arr[CRYPTO_HASH_COUNT][2] = { >-{(void*)CRYPTO_HASH_NONE, "None"}, >-{(void*)CRYPTO_HASH_MD5, "MD5"}, >-{(void*)CRYPTO_HASH_SHA1, "SHA-1"}, >-{(void*)CRYPTO_HASH_RIPEMD160, "RIPEMD-160"}, >-{(void*)CRYPTO_HASH_SHA512, "SHA-512"}, >-{(void*)CRYPTO_HASH_SHA384, "SHA-384"}, >-{(void*)CRYPTO_HASH_SHA256, "SHA-256"}, >+const char* crypto_hash_name_arr[CRYPTO_HASH_COUNT] = { >+ "None", >+ "MD5", >+ "SHA-1", >+ "RIPEMD-160", >+ "SHA-512", >+ "SHA-384", >+ "SHA-256" > }; > >-const char* crypto_name(const void* tab[][2], int count, int v) { >- int i; >- for (i=0; i<count; i++) >- if ( (int)tab[i][0] == v ) >- return (char*)(tab[i][1]); >- return "Unknown"; >+const char* crypto_name(const char** tab, int count, int v) { >+ if ( v < 0 || v >= count) return "Unkown"; >+ return tab[v]; > } > >-unsigned int crypto_name_rev(const void* tab[][2], int count, const char *str) { >- int i; >+unsigned int crypto_name_rev(const char** tab, int count, const char *str) { >+ unsigned int i; >+ str = &str[strspn(str," \t\n\r")]; > for (i=0; i<count; i++) { >- str = &str[strspn(str," \t\n\r")]; >- if ( strncasecmp((char*)tab[i][1], str, strlen((char*)tab[i][1])) == 0 >- && strlen(str) == strlen((char*)tab[i][1])) >- return (int)tab[i][0]; >+ if ( strncasecmp(tab[i], str, strlen(tab[i])) == 0 >+ && strlen(str) == strlen(tab[i])) >+ return i; > } > return 0; > } >+ >diff -uNr hashsum/hasher/hashcom.h hashsum-amd64/hasher/hashcom.h >--- hashsum/hasher/hashcom.h 2004-01-09 00:08:18.000000000 +0100 >+++ hashsum-amd64/hasher/hashcom.h 2005-11-23 22:57:21.000000000 +0100 >@@ -84,9 +84,9 @@ > CRYPTO_HASH_COUNT /* LEAVE THIS HERE! */ > } hash_t; > >-extern const void* crypto_hash_name_arr[CRYPTO_HASH_COUNT][2]; >-extern const char* crypto_name(const void* tab[][2], int count, int v); >-extern unsigned int crypto_name_rev(const void* tab[][2], int count, const char *str); >+extern const char* crypto_hash_name_arr[CRYPTO_HASH_COUNT]; >+extern const char* crypto_name(const char** tab, int count, int v); >+extern unsigned int crypto_name_rev(const char** tab, int count, const char *str); > #define crypto_hash_name(HASH_T)\ > crypto_name(crypto_hash_name_arr, CRYPTO_HASH_COUNT, HASH_T) > #define crypto_hash_name_rev(STR)\
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 113399
: 73455 |
73456