[gjs] modules/cairo-*-surface.cpp: Silence compiler warnings



commit 418fabc8c9964490f3bf58146a647824c254cd12
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed May 24 22:03:10 2017 +0800

    modules/cairo-*-surface.cpp: Silence compiler warnings
    
    Since we moved to a using std::unique_ptr, the filename variables might
    be seen by the compiler as possibly uninitialized, so just set them as
    mullptr to silence the compiler.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783031

 modules/cairo-image-surface.cpp |    2 +-
 modules/cairo-pdf-surface.cpp   |    2 +-
 modules/cairo-ps-surface.cpp    |    2 +-
 modules/cairo-surface.cpp       |    2 +-
 modules/cairo-svg-surface.cpp   |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/modules/cairo-image-surface.cpp b/modules/cairo-image-surface.cpp
index 90bbff3..8aaa640 100644
--- a/modules/cairo-image-surface.cpp
+++ b/modules/cairo-image-surface.cpp
@@ -79,7 +79,7 @@ createFromPNG_func(JSContext *context,
                    JS::Value *vp)
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
-    char *filename;
+    char *filename = nullptr;
     cairo_surface_t *surface;
 
     if (!gjs_parse_call_args(context, "createFromPNG", argv, "s",
diff --git a/modules/cairo-pdf-surface.cpp b/modules/cairo-pdf-surface.cpp
index eceff27..56c89a1 100644
--- a/modules/cairo-pdf-surface.cpp
+++ b/modules/cairo-pdf-surface.cpp
@@ -39,7 +39,7 @@ GJS_DEFINE_PROTO_WITH_PARENT("PDFSurface", cairo_pdf_surface,
 GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_pdf_surface)
 {
     GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_pdf_surface)
-    char *filename;
+    char *filename = nullptr;
     double width, height;
     cairo_surface_t *surface;
 
diff --git a/modules/cairo-ps-surface.cpp b/modules/cairo-ps-surface.cpp
index b241c5e..4b930ae 100644
--- a/modules/cairo-ps-surface.cpp
+++ b/modules/cairo-ps-surface.cpp
@@ -39,7 +39,7 @@ GJS_DEFINE_PROTO_WITH_PARENT("PSSurface", cairo_ps_surface, cairo_surface,
 GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_ps_surface)
 {
     GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_ps_surface)
-    char *filename;
+    char *filename = nullptr;
     double width, height;
     cairo_surface_t *surface;
 
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index bcc4f54..34803d1 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -66,7 +66,7 @@ writeToPNG_func(JSContext *context,
                 JS::Value *vp)
 {
     GJS_GET_THIS(context, argc, vp, argv, obj);
-    char *filename;
+    char *filename = nullptr;
     cairo_surface_t *surface;
 
     if (!gjs_parse_call_args(context, "writeToPNG", argv, "F",
diff --git a/modules/cairo-svg-surface.cpp b/modules/cairo-svg-surface.cpp
index a89db66..4fb32b6 100644
--- a/modules/cairo-svg-surface.cpp
+++ b/modules/cairo-svg-surface.cpp
@@ -39,7 +39,7 @@ GJS_DEFINE_PROTO_WITH_PARENT("SVGSurface", cairo_svg_surface,
 GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_svg_surface)
 {
     GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_svg_surface)
-    char *filename;
+    char *filename = nullptr;
     double width, height;
     cairo_surface_t *surface;
 


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