[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] New 64 bit type for the base layer
From: |
jemarch |
Subject: |
Re: [pdf-devel] New 64 bit type for the base layer |
Date: |
Thu, 24 Jan 2008 23:33:05 +0100 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
Hi Daniel.
Just some comments.
TYPE
pdf_i64_t
A variable of type pdf_i64_t is capabable of representing 64 bit signed
integers.
OPERATIONS
pdf_i64_t pdf_i64_assign(pdf_i32_t high, pdf_u32_t low)
Create a new i64 variable from one 32 bit signed integer and a 32 bit
unsigned integer.
Parameters
high The high (signed) part of the 64 bit integer.
low The low (unsigned) part of the 64 bit integer.
I would rename this function to `pdf_i64_new' and create a new one:
pdf_status_t pdf_i64_assign (pdf_i64_t *bignum, pdf_i32_t high, pdf_u32_t low)
and also define a "quick" function like:
pdf_status_t pdf_i64_assign_quick (pdf_i64_t *bignum, pdf_i32_t value)
pdf_i64_t pdf_i64_add(pdf_i64_t addend_1, pdf_i64_t addend_2)
Adds two 64 bit numbers
Parameters
addend_1 First addend of the sum
addend_2 Second addend of the sum
I would rather define:
pdf_status_t pdf_i64_add (pdf_i64_t *dest, pdf_i64_t addend_1, pdf_i64_t
addend_2)
Likewise for the rest of operations.
pdf_i64_t pdf_i64_rem(pdf_i64_t dividend, pdf_i64_t divisor)
Returns the remainder of the division between two 64 bit numbers
Parameters
dividend The dividend in the division
divisor The divisor in the division
Output
Returns the remainder of a division between two pdf_i64_t
type numbers.
I would rename this function to `pdf_i64_mod' since it implements the
'module' operation.
int pdf_i64_compare(pdf_i64_t number_1, pdf_i64_t number_2)
Compares two 64 bit integers
Parameters
number_1 pdf_i64_t type variable
number_2 pdf_i64_t type variable
Output
0 If numbers are equal
1 If number_1 is greater than number_2
-1 If number_2 is greater than number_1
I would rename this function to `pdf_i64_cmp' in coherence to other
functions in the library.
pdf_i64_t pdf_i64_negate(pdf_i64_t number)
Changes sign of 64 bit integer
Parameters
number pdf_i64_t type variable
I would rename this function to `pdf_i64_neg'.