[53201] trunk/base/src/pextlib1.0

toby at macports.org toby at macports.org
Tue Jun 30 22:46:54 PDT 2009


Revision: 53201
          http://trac.macports.org/changeset/53201
Author:   toby at macports.org
Date:     2009-06-30 22:46:54 -0700 (Tue, 30 Jun 2009)
Log Message:
-----------
Remove CHECKSUMdata (function is unused), also more header cleanup

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/md5cmd.c
    trunk/base/src/pextlib1.0/md_wrappers.h
    trunk/base/src/pextlib1.0/rmd160cmd.c
    trunk/base/src/pextlib1.0/sha1cmd.c

Modified: trunk/base/src/pextlib1.0/md5cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/md5cmd.c	2009-07-01 05:40:21 UTC (rev 53200)
+++ trunk/base/src/pextlib1.0/md5cmd.c	2009-07-01 05:46:54 UTC (rev 53201)
@@ -38,6 +38,8 @@
 
 #include <tcl.h>
 
+#include "md5cmd.h"
+
 #if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
 
 /* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
@@ -63,7 +65,6 @@
 #include "md_wrappers.h"
 CHECKSUMEnd(MD5, MD5_CTX, LENGTH)
 CHECKSUMFile(MD5, MD5_CTX)
-CHECKSUMData(MD5, MD5_CTX)
 
 #elif defined(HAVE_LIBMD)
 #include <sys/types.h>

Modified: trunk/base/src/pextlib1.0/md_wrappers.h
===================================================================
--- trunk/base/src/pextlib1.0/md_wrappers.h	2009-07-01 05:40:21 UTC (rev 53200)
+++ trunk/base/src/pextlib1.0/md_wrappers.h	2009-07-01 05:46:54 UTC (rev 53201)
@@ -34,13 +34,12 @@
 #define _MD_WRAPPERS_H
 
 /* wrappers for libmd-like functions:
- * char* ALGOData(const unsigned char* data, unsigned int len, char* buf)
  * char* ALGOFile(const char* filename, char* buf)
  * char* ALGOEnd(ALGO_CTX, char* buf)
  */
 
 #define CHECKSUMEnd(algo, ctxtype, digest_length)		\
-char *													\
+static char *													\
 algo##End(ctxtype *ctx, char *buf)						\
 {														\
     int i;												\
@@ -61,7 +60,7 @@
 }
 
 #define CHECKSUMFile(algo, ctxtype)						\
-char *algo##File(const char *filename, char *buf)		\
+static char *algo##File(const char *filename, char *buf)		\
 {														\
     unsigned char buffer[BUFSIZ];						\
     ctxtype ctx;										\
@@ -80,15 +79,5 @@
     return algo##End(&ctx, buf);						\
 }
 
-#define CHECKSUMData(algo, ctxtype)						\
-char *algo##Data(const unsigned char *data, unsigned int len, char *buf)	\
-{														\
-	ctxtype ctx;										\
-	algo##Init(&ctx);									\
-	algo##Update(&ctx, data, len);						\
-	return algo##End(&ctx, buf);						\
-}
-
-
 #endif
-	/* _MD_WRAPPERS_H */
+/* _MD_WRAPPERS_H */

Modified: trunk/base/src/pextlib1.0/rmd160cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/rmd160cmd.c	2009-07-01 05:40:21 UTC (rev 53200)
+++ trunk/base/src/pextlib1.0/rmd160cmd.c	2009-07-01 05:46:54 UTC (rev 53201)
@@ -38,6 +38,8 @@
 
 #include <tcl.h>
 
+#include "rmd160cmd.h"
+
 #if !defined(HAVE_LIBMD)
 
 /* We do not have libmd.
@@ -57,7 +59,6 @@
 #include "md_wrappers.h"
 CHECKSUMEnd(RMD160, RMD160_CTX, RIPEMD160_DIGEST_LENGTH)
 CHECKSUMFile(RMD160, RMD160_CTX)
-CHECKSUMData(RMD160, RMD160_CTX)
 
 #elif defined(HAVE_LIBMD)
 #include <sys/types.h>

Modified: trunk/base/src/pextlib1.0/sha1cmd.c
===================================================================
--- trunk/base/src/pextlib1.0/sha1cmd.c	2009-07-01 05:40:21 UTC (rev 53200)
+++ trunk/base/src/pextlib1.0/sha1cmd.c	2009-07-01 05:46:54 UTC (rev 53201)
@@ -39,6 +39,8 @@
 
 #include <tcl.h>
 
+#include "sha1cmd.h"
+
 #if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
 
 /* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
@@ -61,7 +63,6 @@
 #include "md_wrappers.h"
 CHECKSUMEnd(SHA1, SHA_CTX, SHA_DIGEST_LENGTH)
 CHECKSUMFile(SHA1, SHA_CTX)
-CHECKSUMData(SHA1, SHA_CTX)
 
 #elif defined(HAVE_LIBMD)
 #include <sys/types.h>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090630/acdd63fa/attachment.html>


More information about the macports-changes mailing list