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

Re: questions regarding patch-src



Florent Rougon <f.rougon@free.fr> schrieb:

>> But there is a type boolean in standard C, isn't it? So why the
>
> No! 'int's are generally used for this purpose when one does not define
> one's own boolean type.

Ah, I didn't know this.

> Also, you should note that the "typedef struct pdf_boolean pdf_boolean"
> was a false positive in my grep output since we were looking for the
> boolean type and not pdf_boolean. 

Yes, that's clear.

> Consequently, without going through
> the various headers included in writet1.c, one could reasonably assume
> that boolean in writet1.c really is either int, char or short, each of
> which is perfectly OK for the return value 1 of the function.

You mean, boolean will for sure be defined somewhere, and it doesn't
matter which as long is the return value is 1?

> In fact, things are a bit weird.
>
> /tmp/tetex-bin-2.0.2 % grep 't1_subset[^_]' **/*.c
> texk/dvipsk/writet1.c:boolean t1_subset(char *fontfile, char *encfile, unsigned char *g)
> texk/web2c/pdftexdir/writet1.c:boolean t1_subset(char *fontfile, char *encfile, unsigned char *g)
> /tmp/tetex-bin-2.0.2 % grep 't1_subset[^_]' **/*.h
> texk/web2c/pdftexdir/ptexlib.h:extern boolean t1_subset(char *, char *, unsigned char *);

Same in the new upstream sources.

> Surely, this function is not much used in tetex-bin. So, in dvipsk, the
> function is defined as returning a boolean. Good. In
> texk/web2c/pdftexdir/ptexlib.h, it is declared (for modules other than
> writet1.c that would want to use this function) as returning a boolean.
> Good. But if you look closely at writet1.c, you will note that ptexlib.h
> is #included if pdfTeX is defined (at the top), OK, and that the
> t1_subset function is *not* even defined in this case (it should
> probably still have the boolean return value type since that is how it
> is defined in texk/dvipsk/writet1.c...). It seems the function is used
> nowhere in tetex-bin.

Strange, yes. Probably I should ask Olaf Weber.

Thank you for the explanations, Frank
-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: