Bug Summary

File:root/firefox-clang/gfx/cairo/cairo/src/cairo-fallback-compositor.c
Warning:line 166, column 5
Value stored to 'status' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name Unified_c_gfx_cairo_cairo_src1.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/gfx/cairo/cairo/src -fcoverage-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/gfx/cairo/cairo/src -resource-dir /usr/lib/llvm-21/lib/clang/21 -include /root/firefox-clang/config/gcc_hidden.h -include /root/firefox-clang/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D _GLIBCXX_ASSERTIONS -D DEBUG=1 -D HAVE_FT_LOAD_SFNT_TABLE -D PACKAGE_VERSION="moz" -D PACKAGE_BUGREPORT="http://bugzilla.mozilla.org/" -D CAIRO_HAS_PTHREAD -D _GNU_SOURCE -D MOZ_TREE_PIXMAN -D SIZEOF_VOID_P=__SIZEOF_POINTER__ -D SIZEOF_INT=__SIZEOF_INT__ -D SIZEOF_LONG=__SIZEOF_LONG__ -D SIZEOF_LONG_LONG=__SIZEOF_LONG_LONG__ -D HAVE_UINT64_T -D HAVE_CXX11_ATOMIC_PRIMITIVES -D MOZ_HAS_MOZGLUE -D MOZILLA_INTERNAL_API -D IMPL_LIBXUL -D MOZ_SUPPORT_LEAKCHECKING -D STATIC_EXPORTABLE_JS_API -I /root/firefox-clang/gfx/cairo/cairo/src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/gfx/cairo/cairo/src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/libpng16 -internal-isystem /usr/lib/llvm-21/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-error=tautological-type-limit-compare -Wno-range-loop-analysis -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -Wno-enum-compare -Wno-int-to-pointer-cast -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-conversion -Wno-narrowing -Wno-switch -Wno-unused -Wno-unused-variable -Wno-error=uninitialized -Wno-absolute-value -Wno-deprecated-register -Wno-incompatible-pointer-types -Wno-macro-redefined -Wno-shift-negative-value -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-unreachable-code -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2025-06-26-231904-1820671-1 -x c Unified_c_gfx_cairo_cairo_src1.c
1/* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2/* cairo - a vector graphics library with display and print output
3 *
4 * Copyright © 2002 University of Southern California
5 * Copyright © 2005 Red Hat, Inc.
6 * Copyright © 2011 Intel Corporation
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it either under the terms of the GNU Lesser General Public
10 * License version 2.1 as published by the Free Software Foundation
11 * (the "LGPL") or, at your option, under the terms of the Mozilla
12 * Public License Version 1.1 (the "MPL"). If you do not alter this
13 * notice, a recipient may use your version of this file under either
14 * the MPL or the LGPL.
15 *
16 * You should have received a copy of the LGPL along with this library
17 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
19 * You should have received a copy of the MPL along with this library
20 * in the file COPYING-MPL-1.1
21 *
22 * The contents of this file are subject to the Mozilla Public License
23 * Version 1.1 (the "License"); you may not use this file except in
24 * compliance with the License. You may obtain a copy of the License at
25 * http://www.mozilla.org/MPL/
26 *
27 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
28 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
29 * the specific language governing rights and limitations.
30 *
31 * The Original Code is the cairo graphics library.
32 *
33 * The Initial Developer of the Original Code is University of Southern
34 * California.
35 *
36 * Contributor(s):
37 * Carl D. Worth <cworth@cworth.org>
38 * Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
39 * Chris Wilson <chris@chris-wilson.co.uk>
40 */
41
42#include "cairoint.h"
43
44#include "cairo-compositor-private.h"
45#include "cairo-image-surface-private.h"
46#include "cairo-surface-offset-private.h"
47
48/* high-level compositor interface */
49
50static cairo_int_status_t
51_cairo_fallback_compositor_paint (const cairo_compositor_t *_compositor,
52 cairo_composite_rectangles_t *extents)
53{
54 cairo_image_surface_t *image;
55 cairo_int_status_t status;
56
57 TRACE ((stderr, "%s\n", __FUNCTION__));
58
59 image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded);
60
61 status = _cairo_surface_offset_paint (&image->base,
62 extents->unbounded.x,
63 extents->unbounded.y,
64 extents->op,
65 &extents->source_pattern.base,
66 extents->clip);
67
68 return _cairo_surface_unmap_image (extents->surface, image);
69}
70
71static cairo_int_status_t
72_cairo_fallback_compositor_mask (const cairo_compositor_t *_compositor,
73 cairo_composite_rectangles_t *extents)
74{
75 cairo_image_surface_t *image;
76 cairo_int_status_t status;
77
78 TRACE ((stderr, "%s\n", __FUNCTION__));
79
80 image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded);
81
82 status = _cairo_surface_offset_mask (&image->base,
83 extents->unbounded.x,
84 extents->unbounded.y,
85 extents->op,
86 &extents->source_pattern.base,
87 &extents->mask_pattern.base,
88 extents->clip);
89
90 return _cairo_surface_unmap_image (extents->surface, image);
91}
92
93static cairo_int_status_t
94_cairo_fallback_compositor_stroke (const cairo_compositor_t *_compositor,
95 cairo_composite_rectangles_t *extents,
96 const cairo_path_fixed_t *path,
97 const cairo_stroke_style_t *style,
98 const cairo_matrix_t *ctm,
99 const cairo_matrix_t *ctm_inverse,
100 double tolerance,
101 cairo_antialias_t antialias)
102{
103 cairo_image_surface_t *image;
104 cairo_int_status_t status;
105
106 TRACE ((stderr, "%s\n", __FUNCTION__));
107
108 image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded);
109
110 status = _cairo_surface_offset_stroke (&image->base,
111 extents->unbounded.x,
112 extents->unbounded.y,
113 extents->op,
114 &extents->source_pattern.base,
115 path, style,
116 ctm, ctm_inverse,
117 tolerance,
118 antialias,
119 extents->clip);
120
121 return _cairo_surface_unmap_image (extents->surface, image);
122}
123
124static cairo_int_status_t
125_cairo_fallback_compositor_fill (const cairo_compositor_t *_compositor,
126 cairo_composite_rectangles_t *extents,
127 const cairo_path_fixed_t *path,
128 cairo_fill_rule_t fill_rule,
129 double tolerance,
130 cairo_antialias_t antialias)
131{
132 cairo_image_surface_t *image;
133 cairo_int_status_t status;
134
135 TRACE ((stderr, "%s\n", __FUNCTION__));
136
137 image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded);
138
139 status = _cairo_surface_offset_fill (&image->base,
140 extents->unbounded.x,
141 extents->unbounded.y,
142 extents->op,
143 &extents->source_pattern.base,
144 path,
145 fill_rule, tolerance, antialias,
146 extents->clip);
147
148 return _cairo_surface_unmap_image (extents->surface, image);
149}
150
151static cairo_int_status_t
152_cairo_fallback_compositor_glyphs (const cairo_compositor_t *_compositor,
153 cairo_composite_rectangles_t *extents,
154 cairo_scaled_font_t *scaled_font,
155 cairo_glyph_t *glyphs,
156 int num_glyphs,
157 cairo_bool_t overlap)
158{
159 cairo_image_surface_t *image;
160 cairo_int_status_t status;
161
162 TRACE ((stderr, "%s\n", __FUNCTION__));
163
164 image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded);
165
166 status = _cairo_surface_offset_glyphs (&image->base,
Value stored to 'status' is never read
167 extents->unbounded.x,
168 extents->unbounded.y,
169 extents->op,
170 &extents->source_pattern.base,
171 scaled_font, glyphs, num_glyphs,
172 extents->clip);
173
174 return _cairo_surface_unmap_image (extents->surface, image);
175}
176
177const cairo_compositor_t _cairo_fallback_compositor = {
178 &__cairo_no_compositor,
179
180 _cairo_fallback_compositor_paint,
181 _cairo_fallback_compositor_mask,
182 _cairo_fallback_compositor_stroke,
183 _cairo_fallback_compositor_fill,
184 _cairo_fallback_compositor_glyphs,
185};