[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-cvs
Subject:    svn commit: rev 7579 - in trunk/subversion: include libsvn_fs libsvn_subr
From:       rey4 () tigris ! org
Date:       2003-10-31 3:59:00
[Download RAW message or body]

Author: rey4
Date: Thu Oct 30 21:58:59 2003
New Revision: 7579

Modified:
   trunk/subversion/include/svn_md5.h
   trunk/subversion/libsvn_fs/reps-strings.c
   trunk/subversion/libsvn_subr/md5.c
Log:
Minor api change to allow the subr library to be built as a DLL. Replace
global variable svn_md5_empty_string_digest with a function of the same
name, because it's the only global variable in the entire Subversion API
and, unlike functions, global variables can't be transparently imported
from Windows DLLs in C.

Greg Stein <gstein@lyra.org> approved this commit.

* subversion/include/svn_md5.h
* libsvn_subr/md5.c
  (svn_md5_empty_string_digest):
    convert this from an extern global into a function

* subversion/libsvn_fs/reps-strings.c
  (svn_fs__get_mutable_rep, rep_contents_clear):
    update references to svn_md5_empty_string_digest


Modified: trunk/subversion/include/svn_md5.h
==============================================================================
--- trunk/subversion/include/svn_md5.h	(original)
+++ trunk/subversion/include/svn_md5.h	Thu Oct 30 21:58:59 2003
@@ -34,7 +34,7 @@
 
 
 /** The MD5 digest for the empty string. */
-extern const unsigned char svn_md5_empty_string_digest[];
+const unsigned char *svn_md5_empty_string_digest();
 
 
 /** Return the hex representation of @a digest, which must be

Modified: trunk/subversion/libsvn_fs/reps-strings.c
==============================================================================
--- trunk/subversion/libsvn_fs/reps-strings.c	(original)
+++ trunk/subversion/libsvn_fs/reps-strings.c	Thu Oct 30 21:58:59 2003
@@ -526,7 +526,7 @@
      we were provided was not mutable.  So, let's make a new
      representation and return its key to the caller. */
   SVN_ERR (svn_fs__bdb_string_append (fs, &new_str, 0, NULL, trail));
-  rep = make_fulltext_rep (new_str, txn_id, svn_md5_empty_string_digest,
+  rep = make_fulltext_rep (new_str, txn_id, svn_md5_empty_string_digest (),
                            trail->pool);
   SVN_ERR (svn_fs__bdb_write_new_rep (new_rep_key, fs, rep, trail));
 
@@ -1166,7 +1166,7 @@
   if (str_key && *str_key)
     {
       SVN_ERR (svn_fs__bdb_string_clear (fs, str_key, trail));
-      memcpy (rep->checksum, svn_md5_empty_string_digest, MD5_DIGESTSIZE);
+      memcpy (rep->checksum, svn_md5_empty_string_digest (), MD5_DIGESTSIZE);
       SVN_ERR (svn_fs__bdb_write_rep (fs, rep_key, rep, trail));
     }
   return SVN_NO_ERROR;

Modified: trunk/subversion/libsvn_subr/md5.c
==============================================================================
--- trunk/subversion/libsvn_subr/md5.c	(original)
+++ trunk/subversion/libsvn_subr/md5.c	Thu Oct 30 21:58:59 2003
@@ -22,10 +22,15 @@
 
 
 /* The MD5 digest for the empty string. */
-const unsigned char svn_md5_empty_string_digest[] = {
+static const unsigned char svn_md5__empty_string_digest[] = {
   212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126
 };
 
+const unsigned char *
+svn_md5_empty_string_digest ()
+{
+  return svn_md5__empty_string_digest;
+}
 
 
 const char *

---------------------------------------------------------------------
To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
For additional commands, e-mail: svn-help@subversion.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic