freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Testing PIC mode code (Re: Fixes for some compile and lin


From: Erik Dahlstrom
Subject: Re: [ft-devel] Testing PIC mode code (Re: Fixes for some compile and link errors when using FT_CONFIG_OPTION_PIC)
Date: Wed, 01 Feb 2012 15:16:27 +0100
User-agent: Opera Mail/11.61 (Linux)

On Wed, 01 Feb 2012 14:26:15 +0100, David Turner <address@hidden> wrote:

2012/1/17 Erik Dahlstrom <address@hidden>

Hi,
after I submitted my first patches I found a bunch of other PIC issues. I see that you have fixed some of the same things I found too, mostly missing
includes to the various error-headerfiles, and a bunch of unitialized
variables for clazz and the various PIC modules, and pointer dereferences
of the same.

One example of that, there are plenty more:

diff --git a/modules/libfreetype/include/**freetype/internal/ftdriver.h
b/modules/libfreetype/include/**freetype/internal/ftdriver.h
index bbb9ddd..333f908 100644
--- a/modules/libfreetype/include/**freetype/internal/ftdriver.h
+++ b/modules/libfreetype/include/**freetype/internal/ftdriver.h
@@ -366,11 +366,11 @@ FT_BEGIN_HEADER
  FT_Create_Class_##class_( FT_Library        library,
  \
                            FT_Module_Class**  output_class )
   \
  {
   \
-    FT_Driver_Class  clazz;
   \
+    FT_Driver_Class  clazz = NULL;
    \
    FT_Error         error;
   \
    FT_Memory        memory = library->memory;
  \

   \
-    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )
    \
+    if ( FT_ALLOC( clazz, sizeof(FT_Driver_ClassRec) ) )
    \
      return error;
   \

   \
    error = class_##_pic_init( library );
   \


I think It would be simpler to fix FT_ALLOC() to perform a dummy NULL
assignment on the first parameter for this specific compiler.

Yes, that should be sufficient, after having had a second look at the build logs I don't think the type expansion (from '*clazz' to 'FT_Driver_ClassRec' above) is necessary.

--
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed



reply via email to

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