# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: davazp@gmail.com-20090417181024-i2gag3bfehmxb0kq # target_branch: http://bzr.savannah.gnu.org/r/pdf/libgnupdf/branches\ # /trunk/ # testament_sha1: 34719023fa32f27e1905ccbc28bd77c4127f3106 # timestamp: 2009-04-17 20:12:16 +0200 # base_revision_id: jemarch@termi-20090416221338-b8nyznfgedla5ys9 # # Begin patch === modified file 'ChangeLog' --- ChangeLog 2009-04-16 22:13:38 +0000 +++ ChangeLog 2009-04-17 18:10:24 +0000 @@ -1,3 +1,10 @@ +2009-04-17 David Vazquez + + * doc/gnupdf.texi (Evaluation of Functions): Document the + 'pdf_fp_func_debug_t' data type. + + * torture/tortutils/tortutils.c: Add stdlib.h header. + 2009-04-17 Jose E. Marchesi * Time module bugfixes and an initial set of unit tests by Lukasz === modified file 'doc/gnupdf.texi' --- doc/gnupdf.texi 2009-03-03 22:26:28 +0000 +++ doc/gnupdf.texi 2009-04-17 18:10:24 +0000 @@ -5453,6 +5453,58 @@ @end table @end deftypefun + +@deftp {Constant} PDF_FP_FUNC_TYPE4_TRUE +Stand for true value in the debugging information structure. +@end deftp + +@deftp {Constant} PDF_FP_FUNC_TYPE4_FALSE +Stand for false value in the debugging information structure. +@end deftp + + +@deftp {Data Type} {pdf_fp_func_debug_t} + +This structure contains debugging data associated to the evaluation of a +function. + +@table @code +@item type0 +No information for type0 functions. +@item type2 +No information for type2 functions. +@item type3 +No information for type3 functions. +@item type4 +@table @code +@item status +A PDF status value: +@table @code +@item PDF_ERROR +An unknown error ocurred. +@item PDF_EINVRANGE +Invalid range operand for the current operator.. +@item PDF_EUNDERFLOW +Try to fetch an element from an empty stack. +@item PDF_EOVERFLOW +Overflow of stack. +@item PDF_EBADTYPE +Invalid type data for the current operator. +@item PDF_EMATH +Math error. +@end table +@item op +Offset in the source code in which the error ocurred. +@item stack_size +Size of the stack. +@item stack +Array of elements in the stack when the error ocurred. The first element +is the last pushed one. Each element is a double value or a boolean one. +@end table +@end table +@end deftp + + @deftypefun pdf_status_t pdf_fp_func_eval (pdf_fp_func_t @var{function}, const pdf_real_t @var{in}[], pdf_real_t @var{out}[], pdf_fp_func_debug_t *@var{debug}) Evaluate a function. @@ -5476,6 +5528,14 @@ The evaluation was successfully performed. @item PDF_ERROR Error while evaluating the function. +@item PDF_TYPE0 +Error in a type0 function. The debug structure will contain more information. +@item PDF_TYPE2 +Error in a type2 function. The debug structure will contain more information. +@item PDF_TYPE3 +Error in a type3 function. The debug structure will contain more information. +@item PDF_TYPE4 +Error in a type4 function. The debug structure will contain more information. @end table @item Usage example @example === modified file 'src/base/pdf-fp-func.c' --- src/base/pdf-fp-func.c 2009-02-24 17:53:55 +0000 +++ src/base/pdf-fp-func.c 2009-04-17 18:10:24 +0000 @@ -1,4 +1,4 @@ -/* -*- mode: C -*- Time-stamp: "2009-02-24 18:52:09 davazp" +/* -*- mode: C -*- Time-stamp: "2009-04-17 19:24:54 david" * * File: pdf-fp-func.c * Date: Sun Nov 30 18:46:06 2008 @@ -1397,13 +1397,12 @@ #define NSTACK PDF_FP_FUNC_TYPE4_STACK_SIZE -#define REP_TRUE (1.202056903159594285399738162) -#define REP_FALSE (-15116315767.09215686274509804) +#define REP_TRUE PDF_FP_FUNC_TYPE4_TRUE +#define REP_FALSE PDF_FP_FUNC_TYPE4_FALSE #define INT(xyyzy) ((int) pdf_fp_floor (xyyzy)) #define INT_P(xyzzy) ((xyzzy) == INT(xyzzy)) - static pdf_status_t pdf_eval_type4 (pdf_fp_func_t t, const pdf_real_t in[], @@ -1731,12 +1730,8 @@ } - block_error: - return PDF_ERROR; - - stack_error: - return PDF_EINVRANGE; - + block_error: debug_info.type4.status = PDF_ERROR; goto end; + stack_error: debug_info.type4.status = PDF_EINVRANGE; goto end; stack_underflow: debug_info.type4.status = PDF_EUNDERFLOW; goto end; stack_overflow: debug_info.type4.status = PDF_EOVERFLOW; goto end; range_error: debug_info.type4.status = PDF_EINVRANGE; goto end; === modified file 'src/base/pdf-fp-func.h' --- src/base/pdf-fp-func.h 2009-02-24 17:53:55 +0000 +++ src/base/pdf-fp-func.h 2009-04-17 18:10:24 +0000 @@ -1,4 +1,4 @@ -/* -*- mode: C -*- Time-stamp: "2009-02-24 18:12:56 davazp" +/* -*- mode: C -*- Time-stamp: "2009-04-17 19:17:00 david" * * File: pdf-fp-func.h * Date: Sun Nov 30 18:44:41 2008 @@ -38,6 +38,9 @@ /* Interal size of the type 4 functions stack */ #define PDF_FP_FUNC_TYPE4_STACK_SIZE 100 +#define PDF_FP_FUNC_TYPE4_TRUE (1.202056903159594285399738162) +#define PDF_FP_FUNC_TYPE4_FALSE (-15116315767.09215686274509804) + typedef union { struct { === modified file 'torture/tortutils/tortutils.c' --- torture/tortutils/tortutils.c 2008-11-25 21:52:52 +0000 +++ torture/tortutils/tortutils.c 2009-04-17 18:10:24 +0000 @@ -1,4 +1,4 @@ -/* -*- mode: C -*- Time-stamp: "08/11/25 21:03:53 jemarch" +/* -*- mode: C -*- Time-stamp: "2009-04-17 18:59:48 david" * * File: tortutils.c * Date: Mon Nov 24 22:18:12 2008 @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -52,7 +53,7 @@ static char *separator = "/"; #endif /* PDF_HOST_WIN32 */ - path = strdup (tortu_data_path); + path = xstrdup (tortu_data_path); path = xrealloc (path, strlen(path) + strlen(separator) + strlen(datafilename) # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRtTfZgABSJfgGgwWfP//3/n 36C////6YAqc2y+bNoAAAKo3NIArd3KOQAWEkUyaU1PRtQTTzUxqn6GphE2oGTT1GgDajINAklNM o0eoT0Ak2p4k/RT1DwKep6jyj0aj1GQBkDjJk0YhpoYCaGJo0yYgZGE0aaYQZMMJTRoiYDRqmmmy agNPUAaA9QAeUekDQ4yZNGIaaGAmhiaNMmIGRhNGmmEGTCSQIxNEyaExTaCaZExR6aMU0PUaA000 bKKJFHtBe1QtS+4yYtEaJS6ojCJ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