summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/internal.c
diff options
context:
space:
mode:
authorNeil Conway2005-03-21 05:18:46 +0000
committerNeil Conway2005-03-21 05:18:46 +0000
commitfa332a06ecffaa027a0b09cdd1907a03d4318911 (patch)
treea2250749d6e07f2fdec09ee57ee0a3f406888df2 /contrib/pgcrypto/internal.c
parent3cc866123224ec1cd9b2deeb4d63c39c6ef9e533 (diff)
* construct "struct {} list [] = {}" confuses pgindent - split those.
It was a bad style to begin with, and now several loops can be clearer. * pgcrypto.c: Fix function comments * crypt-gensalt.c, crypt-blowfish.c: stop messing with errno * openssl.c: use px_free instead pfree * px.h: make redefining px_alloc/px_realloc/px_free easier Marko Kreen
Diffstat (limited to 'contrib/pgcrypto/internal.c')
-rw-r--r--contrib/pgcrypto/internal.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c
index c95a4e957a6..138307a9b6c 100644
--- a/contrib/pgcrypto/internal.c
+++ b/contrib/pgcrypto/internal.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.14 2004/10/25 02:15:02 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.15 2005/03/21 05:18:45 neilc Exp $
*/
@@ -57,22 +57,17 @@
static void init_md5(PX_MD * h);
static void init_sha1(PX_MD * h);
-static struct int_digest
+struct int_digest
{
char *name;
void (*init) (PX_MD * h);
-} int_digest_list[] =
+};
-{
- {
- "md5", init_md5
- },
- {
- "sha1", init_sha1
- },
- {
- NULL, NULL
- }
+static const struct int_digest
+int_digest_list[] = {
+ { "md5", init_md5 },
+ { "sha1", init_sha1 },
+ { NULL, NULL }
};
/* MD5 */
@@ -516,31 +511,22 @@ bf_cbc_load(void)
return bf_load(MODE_CBC);
}
-static struct
+struct int_cipher
{
char *name;
PX_Cipher *(*load) (void);
-} int_ciphers[] =
+};
-{
- {
- "bf-cbc", bf_cbc_load
- },
- {
- "bf-ecb", bf_ecb_load
- },
- {
- "aes-128-cbc", rj_128_cbc
- },
- {
- "aes-128-ecb", rj_128_ecb
- },
- {
- NULL, NULL
- }
+static const struct int_cipher
+int_ciphers[] = {
+ { "bf-cbc", bf_cbc_load },
+ { "bf-ecb", bf_ecb_load },
+ { "aes-128-cbc", rj_128_cbc },
+ { "aes-128-ecb", rj_128_ecb },
+ { NULL, NULL }
};
-static PX_Alias int_aliases[] = {
+static const PX_Alias int_aliases[] = {
{"bf", "bf-cbc"},
{"blowfish", "bf-cbc"},
{"aes", "aes-128-cbc"},
@@ -557,7 +543,7 @@ static PX_Alias int_aliases[] = {
int
px_find_digest(const char *name, PX_MD ** res)
{
- struct int_digest *p;
+ const struct int_digest *p;
PX_MD *h;
for (p = int_digest_list; p->name; p++)