freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Two very minor freetype patch suggestions


From: Sean McBride
Subject: Re: [ft-devel] Two very minor freetype patch suggestions
Date: Mon, 18 Jun 2007 13:25:42 -0400

On 2007-06-11 19:41, address@hidden said:

>>--- src/base/ftmac.c  2007-06-11 18:34:19.000000000 +0900
>>+++ ../ftmac.c        2007-06-11 18:28:51.000000000 +0900
>>@@ -105,6 +105,10 @@
>>                             FSSpec*      pathSpec,
>>                             FT_Long*     face_index )
>>   {
>>+    (void)fontName;
>>+    (void)pathSpec;
>>+    (void)face_index;
>>+
>>     return FT_Err_Unimplemented_Feature;
>>   }
>
>I think these declarations are introduced to avoid
>compilers warning against unused arguments. FreeType2
>has macros for such purpose: FT_UNUSED(). So I rewrote
>these parts as
>>+    FT_UNUSED( fontName );
>>+    FT_UNUSED( pathSpec );
>>+    FT_UNUSED( face_index );
>If I'm misunderstanding, please let me know.

That's perfect, thanks.

>
>>@@ -466,13 +481,14 @@
>>                                     NULL, NULL, NULL, &par_ref ) )
>>       return FT_Err_Invalid_Argument;
>>
>>+    /* This gives a path in POSIX format */
>>     if ( noErr != FSRefMakePath( &par_ref, path_lwfn, path_size ) )
>>       return FT_Err_Invalid_Argument;
>>
>>     if ( ft_strlen( (char *)path_lwfn ) + 1 + base_lwfn[0] > path_size )
>>       return FT_Err_Invalid_Argument;
>>
>>-    /* now we have absolute dirname in lookup_path */
>>+    /* now we have absolute dirname in path_lwfn */
>>     if ( path_lwfn[0] == '/' )
>>       ft_strcat( (char *)path_lwfn, "/" );
>>     else
>
>According to Apple TN #2078, as you wrote,
>FSRefMakePath() is primarily introduced to
>get POSIX + UTF8 pathname from FSRef. But
>the technote mentions about the possibility
>of FSRefMakePath() returns HFS ptahname.
>If we restrict the scope to Mac OS X,
>FSRefMakePath() always returns POSIX + UTF8
>pathname delimited by "/" ? If so, the code
>checking the delimiter ("/" or ":") can be
>removed.

Correct.  FSRefMakePath() will only give a POSIX path on Mac OS X.  And
ftmac.c is now Mac OS X-only.  The tests for ':' can be removed.

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 address@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada






reply via email to

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