Commit Graph

20 Commits

Author SHA1 Message Date
Jonathon Jongsma
fc46379b37 miLineArc(): initialize edge1, edge2
When compiling spice-common with meson/ninja under "release" mode, I get
several compiler warnings about possibly-uninitialized members. For
example:

    ../subprojects/spice-common/common/lines.c: In function ‘miLineArc’:
    ../subprojects/spice-common/common/lines.c:2167:17: error: ‘edge2.dx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             edge->e += edge->dx; \
                     ^~
    ../subprojects/spice-common/common/lines.c:2426:24: note: ‘edge2.dx’ was declared here
         PolyEdgeRec edge1, edge2;
                            ^~~~~

Initializing these structures to zero silences the warnings.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-10 10:05:41 -05:00
Fabiano Fidêncio
657e1c5291 coverity: avoid division or modulo by zero
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-04-25 09:09:17 +02:00
Lukas Venhoda
a78da942a7 Remove trailing whitespace 2015-12-18 11:41:15 +01:00
Fabiano Fidêncio
fbdd4e41c0 common: Fix -Wmissing-field-initializers 2014-09-18 13:15:35 +02:00
Fabiano Fidêncio
c8b4c5ec49 common: Fix -Wunused-parameter 2014-09-18 13:15:29 +02:00
Fabiano Fidêncio
dde1c62a91 common: Remove dead code 2014-09-18 13:15:26 +02:00
Christophe Fergeau
a4f4ddf56c mi: Fix shadow warnings
Based off a xserver commit from Yaakov Selkowitz:
http://cgit.freedesktop.org/xorg/xserver/commit/mi/mispans.c?id=f02e27e4fcc34413b2051e5a01edc92172fa8612
2014-01-07 13:55:51 +01:00
Christophe Fergeau
ae39a05620 mi: fix memory leak in miFillUniqueSpanGroup
This is based off the corresponding xserver commit from Tiago Vignatti:
http://cgit.freedesktop.org/xorg/xserver/commit/mi/mispans.c?id=7ae46b69ba3f05f46529131e6a864904967cde3a

Since xrealloc is #defined to spice_realloc which aborts on failure, this
block is dead code, but I prefer to stay as close as possible to the
upstream xserver code this is based on.
2014-01-07 13:55:51 +01:00
Christophe Fergeau
d8e49b71d4 mi: Avoid stack smash when drawing dashed lines
Based off Peter Harris's xserver commit
http://cgit.freedesktop.org/xorg/xserver/commit/mi/miwideline.c?id=20c2a3bcb11b5baf564e2c73a477ba23f5ae2b10
2014-01-07 13:55:51 +01:00
Marc-André Lureau
7e8ba10779 Remove INLINE usage
Since inline is c99 and its already used in some files
2013-10-04 12:45:00 +02:00
Daniel P. Berrange
6142b84cd4 Remove casts from void * with xrealloc() calls
The xrealloc() function returns void*, so the return value
never needs to be cast
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
4a9f7971fc Remove useless if() before free()
The free() function allows NULL to be passed in, so any
code which puts a if() before free() is wasting time
2012-03-20 15:25:55 +01:00
Christophe Fergeau
40c06459e5 fix memory leak in error path
Issue found by the Coverity scanner
2012-03-20 15:25:54 +01:00
Arnon Gilboa
88f7e2b32d common: use INLINE instead of inline
needed for spice/common files used by the client, server & qxl driver.
in windows _inline works for both c/c++, while inline is c++ only.
compiling the client with mixed c/c++ code required this define.
2012-03-20 15:25:53 +01:00
Christophe Fergeau
08326f733a add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2012-03-20 15:25:52 +01:00
Alexander Larsson
a95a9fe41c Initialize variable to avoid compiler warning
Seems the OSX gcc warns on saveRight not being initialzied.
2012-03-20 15:25:50 +01:00
Alexander Larsson
7653380e7e Use the spice allocator in common/ 2012-03-20 15:25:40 +01:00
Alexander Larsson
29b01c2c16 Use macros from <spice/macros.h> rather than duplicate them 2012-03-20 15:25:40 +01:00
Larsson@.(none)
196e75a55f Fix warnings from visual studio compiler 2012-03-20 15:25:39 +01:00
Alexander Larsson
639b6b5b26 Add line rasterizer 2012-03-20 15:25:37 +01:00