[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:36:17 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=89aea87

The following commit has been merged in the master branch:
commit 89aea87b018ad0102b321133953c690256ce5ec0
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat May 8 07:01:48 2004 +0000

    Added functions to compute the greatest common denominator: gcd, lgcd
---
 src/types.cpp | 34 ++++++++++++++++++++++++++++++++--
 src/types.hpp | 14 +++++++++++++-
 2 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/src/types.cpp b/src/types.cpp
index 1e0ef0b..c53cd54 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -20,14 +20,14 @@
  */
 /*
   File:      types.cpp
-  Version:   $Name:  $ $Revision: 1.5 $
+  Version:   $Name:  $ $Revision: 1.6 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   26-Jan-04, ahu: created
              11-Feb-04, ahu: isolated as a component
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.5 $ $RCSfile: types.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.6 $ $RCSfile: types.cpp,v $")
 
 // *****************************************************************************
 // included header files
@@ -232,4 +232,34 @@ namespace Exif {
         os << std::dec << std::setfill(' ');
     } // hexdump
 
+    int gcd(int a, int b)
+    {
+        int temp;
+        if (a < b) {
+            temp = a;
+            a = b; 
+            b = temp; 
+        }
+        while ((temp = a % b) != 0) {
+            a = b;
+            b = temp;
+        }
+        return b;
+    } // gcd
+
+    long lgcd(long a, long b)
+    {
+        long temp;
+        if (a < b) {
+            temp = a;
+            a = b; 
+            b = temp; 
+        }
+        while ((temp = a % b) != 0) {
+            a = b;
+            b = temp;
+        }
+        return b;
+    } // lgcd
+
 }                                       // namespace Exif
diff --git a/src/types.hpp b/src/types.hpp
index 39cf47b..5f431a1 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    types.hpp
   @brief   Type definitions for Exiv2 and related functionality
-  @version $Name:  $ $Revision: 1.8 $
+  @version $Name:  $ $Revision: 1.9 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    09-Jan-04, ahu: created
@@ -195,6 +195,18 @@ namespace Exif {
              offset.
      */
     void hexdump(std::ostream& os, const char* buf, long len, long offset =0);
+
+    /*!
+      @brief Return the greatest common denominator of integers a and b.
+             Both parameters must be greater than 0.
+     */
+    int gcd(int a, int b);
+
+    /*!
+      @brief Return the greatest common denominator of long values a and b. 
+             Both parameters must be greater than 0.
+     */
+    long lgcd(long a, long b);
    
 // *****************************************************************************
 // template and inline definitions

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list