pdf-devel
[Top][All Lists]
Advanced

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

[pdf-devel] libgnupdf ChangeLog src/base/pdf-types.h


From: Aleksander Morgado
Subject: [pdf-devel] libgnupdf ChangeLog src/base/pdf-types.h
Date: Tue, 24 Jun 2008 22:42:55 +0000

CVSROOT:        /cvsroot/pdf
Module name:    libgnupdf
Changes by:     Aleksander Morgado <aleksander_m>       08/06/24 22:42:55

Modified files:
        .              : ChangeLog 
        src/base       : pdf-types.h 

Log message:
        New macros in the 64bit-support module and changed macro for pdf_i64_cmp

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libgnupdf/ChangeLog?cvsroot=pdf&r1=1.264&r2=1.265
http://cvs.savannah.gnu.org/viewcvs/libgnupdf/src/base/pdf-types.h?cvsroot=pdf&r1=1.15&r2=1.16

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/ChangeLog,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -b -r1.264 -r1.265
--- ChangeLog   24 Jun 2008 12:31:55 -0000      1.264
+++ ChangeLog   24 Jun 2008 22:42:55 -0000      1.265
@@ -1,3 +1,8 @@
+2008-06-25  Aleksander Morgado  <address@hidden>
+
+       * src/base/pdf-types.h: Added macros for the new pdf_i64_* functions. 
Also
+  new implementation for pdf_i64_cmp macro.
+
 2008-06-24  Daniel Vidal  <address@hidden>
 
        * torture/unit/base/types/pdf-i64-neg.c: new pdf_i64 test

Index: src/base/pdf-types.h
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/src/base/pdf-types.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- src/base/pdf-types.h        24 Jun 2008 12:08:23 -0000      1.15
+++ src/base/pdf-types.h        24 Jun 2008 22:42:55 -0000      1.16
@@ -105,7 +105,6 @@
   pdf_u32_t low;
 };
 
-/*Definition of the pdf_i64_t type*/
 typedef struct pdf_i64_s pdf_i64_t;
 
 #else
@@ -116,6 +115,7 @@
 
 
 #ifndef PDF_USE_BUILTIN_64BIT_SUPPORT
+
 /*Create and initialise a new pdf_i64_t variable*/
 pdf_i64_t pdf_i64_new(const pdf_i32_t high, const pdf_u32_t low);
 
@@ -168,147 +168,129 @@
 pdf_status_t 
 pdf_i64_mod(pdf_i64_t *dest, const pdf_i64_t dividend, const pdf_i64_t 
divisor);
 
+
+/* Add a pdf_i64_t and a pdf_i32_t */
+pdf_status_t 
+pdf_i64_add_i32(pdf_i64_t *dest, const pdf_i64_t addend1, const pdf_i32_t 
addend2);
+
+/* Compare a pdf_i64_t and a pdf_i32_t */
+int pdf_i64_cmp_i32(const pdf_i64_t number_1, const pdf_i32_t number_2);
+
+/* Subtract a pdf_i64_t and a pdf_i32_t variable */
+pdf_status_t 
+pdf_i64_subtraction_i32_min(pdf_i64_t *dest, const pdf_i32_t minuend, const 
pdf_i64_t subtrahend);
+pdf_status_t 
+pdf_i64_subtraction_i32_sub(pdf_i64_t *dest, const pdf_i64_t minuend, const 
pdf_i32_t subtrahend);
+
+/* Multiply a pdf_i64_t and a pdf_i32_t */
+pdf_status_t 
+pdf_i64_mult_i32(pdf_i64_t *dest, const pdf_i64_t factor_1, const pdf_i32_t 
factor_2);
+
+/* Divide a pdf_i64_t and a pdf_i32_t */
+pdf_status_t 
+pdf_i64_div_i32_dividend(pdf_i64_t *dest, const pdf_i32_t dividend, const 
pdf_i64_t divisor);
+pdf_status_t 
+pdf_i64_div_i32_divisor(pdf_i64_t *dest, const pdf_i64_t dividend, const 
pdf_i32_t divisor);
+
+
+/* Modulus between a pdf_i64_t and a pdf_i32_t */
+pdf_status_t 
+pdf_i64_mod_i32_dividend(pdf_i64_t *dest, const pdf_i32_t dividend, const 
pdf_i64_t divisor);
+pdf_status_t 
+pdf_i64_mod_i32_divisor(pdf_i64_t *dest, const pdf_i64_t dividend, const 
pdf_i32_t divisor);
+
+
+/* Get number as pdf_i32_t. Note that if the pdf_i64_t variable is holding a 
+ * number which can't be represented in 32bits, the result is undefined... so
+ * use it with caution. */
+pdf_i32_t
+pdf_i64_to_i32(const pdf_i64_t bignum);
+
+
 #else /*else of the PDF_USE_BUILTIN_64BIT_SUPPORT*/
 
 /*Create and initialise a new pdf_i64_t variable*/
 #define pdf_i64_new(high, low) ((((pdf_i64_t)high)<<32) + low) 
 
-#define pdf_i64_assign(bignum, high, low)\
-  do{\
-    *bignum = 0;\
+#define pdf_i64_assign(bignum, high, low) \
+  do{ \
+    *bignum = 0; \
     *bignum = (((pdf_i64_t)high)<<32);                 \
     *bignum = *bignum + low; \
 }while(0)
    
 
-
 /*Quick version of assignment in which only the lowest siginificant
   part is taken into account*/
 #define pdf_i64_assign_quick(bignum, value) \
-  do{\
-    *bignum = value; \
-  }\
-  while (0)
+    *bignum = value
 
 /*Copy one pdf_i64_t variable into another*/
 #define pdf_i64_copy(orig, copy) \
-  do                                                                   \
-    {                      \
-      *copy=orig;           \
-    } while (0)
+    *copy = orig
 
 /*Add two pdf_i64_t variables*/
 #define pdf_i64_add(dest, addend1, addend2) \
-  do                                                                   \
-    {                           \
-      *dest = addend1 + addend2; \
-    }while(0) 
+    *dest = addend1 + addend2
 
 /*Compare two pdf_i64_t variables*/
 #define pdf_i64_cmp(number_1, number_2) \
-  do                                                                   \
-    { \
-      if (number_1 > number_2)                   \
-       {                                       \
-           return 1;                           \
-       }                                       \
-      else if (number_1 < number_2)            \
-       {                             \
-           return -1;                \
-       }                             \
-      else                           \
-       {                             \
-         return 0;                   \
-       }                             \
-    }while(0)
+  ((number_1 > number_2) ? 1 : ((number_1 < number_2) ? -1 : 0))
 
 /*Calculate the absolute value of a pdf_i64_t variable*/
 #define pdf_i64_abs(dest, number) \
-  do                                           \
-    {                                          \
-      *dest = abs(number);                     \
-    }while(0)
+      *dest = abs(number)
     
 /*Negate a pdf_i64_t type variable*/
 #define pdf_i64_neg(dest, number) \
-    do                                         \
-    {                                          \
-      *dest = -number;                         \
-    }while(0)
+      *dest = -number
 
 /*Subtract two pdf_i64_t variables*/
 #define pdf_i64_subtraction(dest, minuend, subtrahend) \
-    do                                         \
-      {                                                \
-       *dest = minuend - subtrahend;           \
-      }while (0)
+       *dest = minuend - subtrahend
 
 /*Multiply two pdf_i64_t variables*/
 #define pdf_i64_mult(dest, factor_1, factor_2) \
-    do                                         \
-      {                                                \
-       *dest = factor_1 * factor_2;            \
-      }while(0)
+       *dest = factor_1 * factor_2
 
 /*Division between two pdf_i64_t type variables*/
 #define pdf_i64_div(dest, dividend, divisor) \
-    do                                         \
-      {                                                \
-       *dest = dividend/divisor;               \
-      }while (0)
+       *dest = dividend/divisor
 
 /*Modulus division between two pdf_i64_t variables*/
 #define pdf_i64_mod(dest, dividend, divisor) \
-  do                                           \
-    {                                          \
-      *dest = dividend%divisor;                        \
-    }while (0)
-
-
-#endif
-
+      *dest = dividend%divisor
 
 
 /* Add a pdf_i64_t and a pdf_i32_t */
-pdf_status_t 
-pdf_i64_add_i32(pdf_i64_t *dest, const pdf_i64_t addend1, const pdf_i32_t 
addend2);
+#define pdf_i64_add_i32 pdf_i64_add
 
 /* Compare a pdf_i64_t and a pdf_i32_t */
-int pdf_i64_cmp_i32(const pdf_i64_t number_1, const pdf_i32_t number_2);
+#define pdf_i64_cmp_i32 pdf_i64_cmp
 
 /* Subtract a pdf_i64_t and a pdf_i32_t variable */
-pdf_status_t 
-pdf_i64_subtraction_i32_min(pdf_i64_t *dest, const pdf_i32_t minuend, const 
pdf_i64_t subtrahend);
-pdf_status_t 
-pdf_i64_subtraction_i32_sub(pdf_i64_t *dest, const pdf_i64_t minuend, const 
pdf_i32_t subtrahend);
+#define pdf_i64_subtraction_i32_min pdf_i64_subtraction
+#define pdf_i64_subtraction_i32_sub pdf_i64_subtraction
 
 /* Multiply a pdf_i64_t and a pdf_i32_t */
-pdf_status_t 
-pdf_i64_mult_i32(pdf_i64_t *dest, const pdf_i64_t factor_1, const pdf_i32_t 
factor_2);
+#define pdf_i64_mult_i32 pdf_i64_mult
 
 /* Divide a pdf_i64_t and a pdf_i32_t */
-pdf_status_t 
-pdf_i64_div_i32_dividend(pdf_i64_t *dest, const pdf_i32_t dividend, const 
pdf_i64_t divisor);
-pdf_status_t 
-pdf_i64_div_i32_divisor(pdf_i64_t *dest, const pdf_i64_t dividend, const 
pdf_i32_t divisor);
+#define pdf_i64_div_i32_dividend pdf_i64_div
+#define pdf_i64_div_i32_divisor pdf_i64_div
 
 
 /* Modulus between a pdf_i64_t and a pdf_i32_t */
-pdf_status_t 
-pdf_i64_mod_i32_dividend(pdf_i64_t *dest, const pdf_i32_t dividend, const 
pdf_i64_t divisor);
-pdf_status_t 
-pdf_i64_mod_i32_divisor(pdf_i64_t *dest, const pdf_i64_t dividend, const 
pdf_i32_t divisor);
+#define pdf_i64_mod_i32_dividend pdf_i64_mod
+#define pdf_i64_mod_i32_divisor pdf_i64_mod
 
 
 /* Get number as pdf_i32_t. Note that if the pdf_i64_t variable is holding a 
  * number which can't be represented in 32bits, the result is undefined... so
  * use it with caution. */
-pdf_i32_t
-pdf_i64_to_i32(const pdf_i64_t bignum);
-
-
-
+#define pdf_i64_to_i32(bignum) bignum
 
+#endif
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]