To shut up int-in-bool-context warning, useful for detecting bugs such as Bug 1479950 draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:00:16 +0900
changeset 81074 cc69a65dd1ca556d706487d20b4ec945d9696f8e
parent 81073 552fdab452104a392f8bfe515ca4f2289065bb56
child 81075 09388c5f6d825eca9bc1e050a5420dd9f4cf487a
push id9744
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:01:06 +0000
treeherdertry-comm-central@56c83244ac0e [default view] [failures only]
bugs1479950
To shut up int-in-bool-context warning, useful for detecting bugs such as Bug 1479950
mozilla-M-C-012-cairo-malloc-private-int-in-bool-context.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-012-cairo-malloc-private-int-in-bool-context.patch
@@ -0,0 +1,27 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  1caa9c30a28bf8e3dc46cd4e22eee37caf8777ed
+To shut up int-in-bool-context warning, useful for detecting bugs such as Bug 1479950
+
+diff --git a/gfx/cairo/cairo/src/cairo-malloc-private.h b/gfx/cairo/cairo/src/cairo-malloc-private.h
+--- a/gfx/cairo/cairo/src/cairo-malloc-private.h
++++ b/gfx/cairo/cairo/src/cairo-malloc-private.h
+@@ -54,17 +54,17 @@
+  * The memory should be freed using free().
+  * malloc is skipped, if 0 bytes are requested, and %NULL will be returned.
+  *
+  * Return value: A pointer to the newly allocated memory, or %NULL in
+  * case of malloc() failure or size is 0.
+  */
+ 
+ #define _cairo_malloc(size) \
+-   ((size) ? malloc((unsigned) (size)) : NULL)
++    (((size) !=0) ? malloc((unsigned) (size)) : NULL)
+ 
+ /**
+  * _cairo_malloc_ab:
+  * @n: number of elements to allocate
+  * @size: size of each element
+  *
+  * Allocates @n*@size memory using _cairo_malloc(), taking care to not
+  * overflow when doing the multiplication.  Behaves much like