Skip to content

Commit

Permalink
Merge pull request #11 from gtkforphp/compiler_warnings
Browse files Browse the repository at this point in the history
Compiler warnings
  • Loading branch information
auroraeosrose committed Oct 18, 2014
2 parents f67dbb5 + f2f1f14 commit a478ba2
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cairo.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ ZEND_END_ARG_INFO()
#if defined(CAIRO_HAS_FT_FONT) && defined(HAVE_FREETYPE)

const char* php_cairo_get_ft_error(int error TSRMLS_DC) {
int i;
php_cairo_ft_error *current_error = php_cairo_ft_errors;

const php_cairo_ft_error *current_error = php_cairo_ft_errors;

while (current_error->err_msg != NULL) {
if (current_error->err_code == error) {
Expand Down
2 changes: 2 additions & 0 deletions cairo_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -2974,7 +2974,9 @@ static zend_object_value cairo_context_object_new(zend_class_entry *ce TSRMLS_DC
{
zend_object_value retval;
cairo_context_object *context;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

context = ecalloc(1, sizeof(cairo_context_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_font_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ zend_object_value cairo_font_face_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_font_face_object *font_face;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

font_face = ecalloc(1, sizeof(cairo_font_face_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_font_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ static zend_object_value cairo_font_options_object_new(zend_class_entry *ce TSRM
{
zend_object_value retval;
cairo_font_options_object *font_options;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

font_options = ecalloc(1, sizeof(cairo_font_options_object));
font_options->font_options = NULL;
Expand Down
4 changes: 3 additions & 1 deletion cairo_ft_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ PHP_FUNCTION(cairo_ft_font_face_create)
error = php_cairo_create_ft_font_face(font_face_object, stream, owned_stream, load_flags, 0 TSRMLS_CC);

if (error) {
char *err_string = php_cairo_get_ft_error(error TSRMLS_CC);
const char *err_string = php_cairo_get_ft_error(error TSRMLS_CC);
zend_error(E_WARNING, "cairo_ft_font_face_create(): An error occurred opening the file: %s", err_string);
RETURN_NULL();
}
Expand Down Expand Up @@ -325,7 +325,9 @@ zend_object_value cairo_ft_font_face_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_ft_font_face_object *font_face;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

font_face = ecalloc(1, sizeof(cairo_ft_font_face_object));
font_face->ft_stream = NULL;
Expand Down
2 changes: 2 additions & 0 deletions cairo_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ static zend_object_value cairo_matrix_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_matrix_object *matrix;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

matrix = ecalloc(1, sizeof(cairo_matrix_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ static zend_object_value cairo_path_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_path_object *path;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

path = ecalloc(1, sizeof(cairo_path_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@ static zend_object_value cairo_pattern_object_new(zend_class_entry *ce TSRMLS_DC
{
zend_object_value retval;
cairo_pattern_object *pattern;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

pattern = ecalloc(1, sizeof(cairo_pattern_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_scaled_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ static zend_object_value cairo_scaled_font_object_new(zend_class_entry *ce TSRML
{
zend_object_value retval;
cairo_scaled_font_object *scaled_font;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

scaled_font = ecalloc(1, sizeof(cairo_scaled_font_object));

Expand Down
2 changes: 2 additions & 0 deletions cairo_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,9 @@ zend_object_value cairo_surface_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_surface_object *surface;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

surface = ecalloc(1, sizeof(cairo_surface_object));

Expand Down
4 changes: 3 additions & 1 deletion cairo_win32_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ zend_object_value cairo_win32_font_face_create_new(zend_class_entry *ce TSRMLS_D
{
zend_object_value retval;
cairo_win32_font_face_object *font_face;
zval *temp;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif

font_face = ecalloc(1, sizeof(cairo_win32_font_face_object));
font_face->std.ce = ce;
Expand Down

0 comments on commit a478ba2

Please sign in to comment.