pdf-devel
[Top][All Lists]
Advanced

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

[pdf-devel] pdf_function.c


From: Hardy Falk
Subject: [pdf-devel] pdf_function.c
Date: Tue, 23 Oct 2007 21:00:32 +0200
User-agent: KMail/1.9.5

Hi.
Type 4 functions are working now.
Some remarks:
1.      there seems to be a bug in pdf_stm_mem_readpeek_char().
        c = data->data[data->current];
        if (!peek_p)    /* HF missing negation ? */ 
        {
                data->current++;
        }
        return c;

2. pdf_reference_1-7.pdf lists ascii nul as a whitespace 
character. No sane C programmer would write a type 4 function 
with this delimiter, but the current pdf_stm_read_char() does 
not allow it. 
Why deviate from   "int fgetc(FILE*)"? 
PDF_EOF is defined as -1.


3. The test-function program is a bit complex.
It has to exercise many special cases. 
example calls:
        test-function --type 4 --code " { dup 1 lt { 0.1 mul } 
        { 1 index mul } ifelse }"  -n 1 -m 1 
tests a function R -> R .
        test-function --type 4 --code " { dup 1 lt { 0.1 mul } 
        {  mul } ifelse }"  -n 1 -m 1 would produce a stack underflow 
       on output.
       
4. Error reporting.
    Right now, the code returns 0 on success.
    It would be easy to add better error reporting later on.
    Example:
        case  OPC_pop :
                if ( sp < 0 ) goto stack_underflow ;
                sp--

5. gperf usage.
    I don't know how to use gperf with automake, so I've
   embedded some 120 lines of gperf output into pdf_function.c .

6. indentation .
    Is gnu indent with defaults enough? I use vim exclusively.


Looking forward to a patch day :-)     




reply via email to

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