[epiphany/wip/sync-rebase: 60/74] sync-crypto: Move every free function under the correponding new function



commit cfc8617ab9b427a19ded777d08f21bdc82a82ebe
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Tue Aug 30 16:04:43 2016 +0300

    sync-crypto: Move every free function under the correponding new function

 src/ephy-sync-crypto.c |   89 +++++++++++++++++++++++------------------------
 1 files changed, 44 insertions(+), 45 deletions(-)
---
diff --git a/src/ephy-sync-crypto.c b/src/ephy-sync-crypto.c
index 2db1f34..bb238d6 100644
--- a/src/ephy-sync-crypto.c
+++ b/src/ephy-sync-crypto.c
@@ -57,8 +57,25 @@ ephy_sync_crypto_hawk_options_new (const char *app,
   return options;
 }
 
-static EphySyncCryptoHawkArtifacts *
+void
+ephy_sync_crypto_hawk_options_free (EphySyncCryptoHawkOptions *options)
+{
+  g_return_if_fail (options != NULL);
 
+  g_free (options->app);
+  g_free (options->dlg);
+  g_free (options->ext);
+  g_free (options->content_type);
+  g_free (options->hash);
+  g_free (options->local_time_offset);
+  g_free (options->nonce);
+  g_free (options->payload);
+  g_free (options->timestamp);
+
+  g_slice_free (EphySyncCryptoHawkOptions, options);
+}
+
+static EphySyncCryptoHawkArtifacts *
 ephy_sync_crypto_hawk_artifacts_new (const char *app,
                                      const char *dlg,
                                      const char *ext,
@@ -87,50 +104,6 @@ ephy_sync_crypto_hawk_artifacts_new (const char *app,
   return artifacts;
 }
 
-static EphySyncCryptoHawkHeader *
-ephy_sync_crypto_hawk_header_new (char                        *header,
-                                  EphySyncCryptoHawkArtifacts *artifacts)
-{
-  EphySyncCryptoHawkHeader *hheader;
-
-  hheader = g_slice_new (EphySyncCryptoHawkHeader);
-  hheader->header = header;
-  hheader->artifacts = artifacts;
-
-  return hheader;
-}
-
-static EphySyncCryptoRSAKeyPair *
-ephy_sync_crypto_rsa_key_pair_new (struct rsa_public_key  public,
-                                   struct rsa_private_key private)
-{
-  EphySyncCryptoRSAKeyPair *keypair;
-
-  keypair = g_slice_new (EphySyncCryptoRSAKeyPair);
-  keypair->public = public;
-  keypair->private = private;
-
-  return keypair;
-}
-
-void
-ephy_sync_crypto_hawk_options_free (EphySyncCryptoHawkOptions *options)
-{
-  g_return_if_fail (options != NULL);
-
-  g_free (options->app);
-  g_free (options->dlg);
-  g_free (options->ext);
-  g_free (options->content_type);
-  g_free (options->hash);
-  g_free (options->local_time_offset);
-  g_free (options->nonce);
-  g_free (options->payload);
-  g_free (options->timestamp);
-
-  g_slice_free (EphySyncCryptoHawkOptions, options);
-}
-
 static void
 ephy_sync_crypto_hawk_artifacts_free (EphySyncCryptoHawkArtifacts *artifacts)
 {
@@ -150,6 +123,19 @@ ephy_sync_crypto_hawk_artifacts_free (EphySyncCryptoHawkArtifacts *artifacts)
   g_slice_free (EphySyncCryptoHawkArtifacts, artifacts);
 }
 
+static EphySyncCryptoHawkHeader *
+ephy_sync_crypto_hawk_header_new (char                        *header,
+                                  EphySyncCryptoHawkArtifacts *artifacts)
+{
+  EphySyncCryptoHawkHeader *hheader;
+
+  hheader = g_slice_new (EphySyncCryptoHawkHeader);
+  hheader->header = header;
+  hheader->artifacts = artifacts;
+
+  return hheader;
+}
+
 void
 ephy_sync_crypto_hawk_header_free (EphySyncCryptoHawkHeader *hheader)
 {
@@ -161,6 +147,19 @@ ephy_sync_crypto_hawk_header_free (EphySyncCryptoHawkHeader *hheader)
   g_slice_free (EphySyncCryptoHawkHeader, hheader);
 }
 
+static EphySyncCryptoRSAKeyPair *
+ephy_sync_crypto_rsa_key_pair_new (struct rsa_public_key  public,
+                                   struct rsa_private_key private)
+{
+  EphySyncCryptoRSAKeyPair *keypair;
+
+  keypair = g_slice_new (EphySyncCryptoRSAKeyPair);
+  keypair->public = public;
+  keypair->private = private;
+
+  return keypair;
+}
+
 void
 ephy_sync_crypto_rsa_key_pair_free (EphySyncCryptoRSAKeyPair *keypair)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]