[smooth, raster, sdf] Clean up initialization calls. * src/raster/ftraster.c (ft_black_init): Removed. (ft_black_new): Clean up. * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto. * src/sdf/ftsdf.c (sdf_raster_new): Ditto. * src/smooth/ftgrays.c (gray_raster_new): Ditto.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 4c17097..c886f7e 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -3133,13 +3133,6 @@
}
- static void
- ft_black_init( black_PRaster raster )
- {
- FT_UNUSED( raster );
- }
-
-
/**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/
/**** a static object. *****/
@@ -3157,7 +3150,6 @@
*araster = (FT_Raster)&the_raster;
FT_ZERO( &the_raster );
- ft_black_init( &the_raster );
return 0;
}
@@ -3179,17 +3171,13 @@
black_PRaster *araster )
{
FT_Error error;
- black_PRaster raster = NULL;
+ black_PRaster raster;
- *araster = 0;
if ( !FT_NEW( raster ) )
- {
raster->memory = memory;
- ft_black_init( raster );
- *araster = raster;
- }
+ *araster = raster;
return error;
}
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index d837a79..0f414c8 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -163,7 +163,7 @@
{
FT_Memory memory;
- } BSDF_TRaster;
+ } BSDF_TRaster, *BSDF_PRaster;
/**************************************************************************
@@ -1173,19 +1173,17 @@
/* called when adding a new module through @FT_Add_Module */
static FT_Error
- bsdf_raster_new( FT_Memory memory,
- FT_Raster* araster )
+ bsdf_raster_new( FT_Memory memory,
+ BSDF_PRaster* araster )
{
- FT_Error error = FT_Err_Ok;
- BSDF_TRaster* raster = NULL;
+ FT_Error error;
+ BSDF_PRaster raster;
- *araster = 0;
- if ( !FT_ALLOC( raster, sizeof ( BSDF_TRaster ) ) )
- {
+ if ( !FT_NEW( raster ) )
raster->memory = memory;
- *araster = (FT_Raster)raster;
- }
+
+ *araster = raster;
return error;
}
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index 8577219..784e247 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -204,7 +204,7 @@
{
FT_Memory memory;
- } SDF_TRaster;
+ } SDF_TRaster, *SDF_PRaster;
/**************************************************************************
@@ -3706,25 +3706,19 @@
*/
static FT_Error
- sdf_raster_new( FT_Memory memory,
- FT_Raster* araster)
+ sdf_raster_new( FT_Memory memory,
+ SDF_PRaster* araster )
{
- FT_Error error = FT_Err_Ok;
- SDF_TRaster* raster = NULL;
- FT_Int line = __LINE__;
+ FT_Error error;
+ SDF_PRaster raster;
- /* in non-debugging mode this is not used */
- FT_UNUSED( line );
-
- *araster = 0;
- if ( !FT_ALLOC( raster, sizeof ( SDF_TRaster ) ) )
- {
+ if ( !FT_NEW( raster ) )
raster->memory = memory;
- *araster = (FT_Raster)raster;
- }
- return error;
+ *araster = raster;
+
+ return error;
}
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index b8d6801..cc415e3 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -2147,19 +2147,17 @@ typedef ptrdiff_t FT_PtrDist;
#else /* !STANDALONE_ */
static int
- gray_raster_new( FT_Memory memory,
- FT_Raster* araster )
+ gray_raster_new( FT_Memory memory,
+ gray_PRaster* araster )
{
FT_Error error;
- gray_PRaster raster = NULL;
+ gray_PRaster raster;
- *araster = 0;
- if ( !FT_ALLOC( raster, sizeof ( gray_TRaster ) ) )
- {
+ if ( !FT_NEW( raster ) )
raster->memory = memory;
- *araster = (FT_Raster)raster;
- }
+
+ *araster = raster;
return error;
}