[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] New pdf_i64 functions using pdf_i32_t as input parameters
From: |
Aleksander Morgado |
Subject: |
[pdf-devel] New pdf_i64 functions using pdf_i32_t as input parameters |
Date: |
Sat, 14 Jun 2008 21:41:11 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Macintosh/20080421) |
Another good thing to have would be, for example, a pdf_i64_div
expecting a pdf_i32_t in the divisor or in the dividend:
pdf_status_t
pdf_i64_div_divisor_i32(pdf_i64_t *result, \
const pdf_i64_t dividend, \
const pdf_i32_t divisor);
and
pdf_status_t
pdf_i64_div_dividend_i32(pdf_i64_t *result, \
const pdf_i32_t dividend, \
const pdf_i64_t divisor);
And the same with the other pdf_i64_* functions (add, substract, and so on).
The problem I find is that with the current approach there is no real
way of directly converting pdf_i32_t to pdf_i64_t without using a new
variable (if treated as a blackbox). See this example where I want just
to add '1' to a given pdf_i64_t variable:
pdf_i64_t var1;
pdf_i64_t var2;
var = pdf_i64_new(0,0);
/* here perform calculations and store value in var1 */
/* But now I need to add 1 to var1... how do I do it? */
var2 = pdf_i64_new(0,1);
pdf_i64_add(&var1, var1, var2);
It would be simpler to have something like, where there is no need to
have another extra variable for the '1':
pdf_i64_add_i32(&var1, var1, 1);
What do you all think?
- [pdf-devel] New pdf_i64 functions using pdf_i32_t as input parameters,
Aleksander Morgado <=