Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
5a8549c6
Unverified
Commit
5a8549c6
authored
Jul 03, 2018
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mjtrangoni-WIP-add-cppcheck' into 3.6.x
Attributes GH PR #678:
https://github.com/ArcticaProject/nx-libs/pull/678
parents
fd9de008
5651680b
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
107 additions
and
33 deletions
+107
-33
.travis.yml
.travis.yml
+58
-12
8bit_tab_to_h.c
doc/libNX_X11/lcUniConv/8bit_tab_to_h.c
+6
-0
Xtrans.c
nx-X11/lib/include/xtrans/Xtrans.c
+4
-3
Xtranssock.c
nx-X11/lib/include/xtrans/Xtranssock.c
+0
-1
exevents.c
nx-X11/programs/Xserver/Xi/exevents.c
+1
-0
cursor.c
nx-X11/programs/Xserver/dix/cursor.c
+1
-0
NXmiexpose.c
nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
+2
-0
NXrender.c
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+1
-0
Png.c
nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
+8
-5
miexpose.c
nx-X11/programs/Xserver/mi/miexpose.c
+2
-0
mizerline.c
nx-X11/programs/Xserver/mi/mizerline.c
+2
-0
render.c
nx-X11/programs/Xserver/render/render.c
+7
-12
Children.cpp
nxcomp/src/Children.cpp
+1
-0
run-static-analysis.sh
run-static-analysis.sh
+14
-0
No files found.
.travis.yml
View file @
5a8549c6
...
...
@@ -9,11 +9,24 @@ matrix:
addons
:
apt
:
sources
:
-
sourceline
:
'
deb
http://archive.ubuntu.com/ubuntu
trusty-backports
main
restricted
universe
multiverse'
-
ubuntu-toolchain-r-test
packages
:
-
g++-4.9
-
cppcheck/trusty-backports
# imake
-
xutils-dev
# X11 libaries
-
libxcomposite-dev
-
libxfont-dev
-
libxinerama-dev
-
libxrandr-dev
-
libxtst-dev
-
x11proto-fonts-dev
env
:
-
MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
-
MATRIX_EVAL="CC=gcc && CXX=g++"
-
STATIC_ANALYSIS="yes"
fail_fast
:
true
-
os
:
linux
addons
:
...
...
@@ -21,9 +34,20 @@ matrix:
sources
:
-
ubuntu-toolchain-r-test
packages
:
-
g++-7
-
g++-8
# imake
-
xutils-dev
# X11 libaries
-
libxcomposite-dev
-
libxfont-dev
-
libxinerama-dev
-
libxrandr-dev
-
libxtst-dev
-
x11proto-fonts-dev
env
:
-
MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
-
MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
-
STATIC_ANALYSIS="no"
-
os
:
linux
addons
:
...
...
@@ -32,25 +56,47 @@ matrix:
-
llvm-toolchain-trusty-3.9
packages
:
-
clang-3.9
# imake
-
xutils-dev
# X11 libaries
-
libxcomposite-dev
-
libxfont-dev
-
libxinerama-dev
-
libxrandr-dev
-
libxtst-dev
-
x11proto-fonts-dev
env
:
-
MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
-
STATIC_ANALYSIS="no"
-
os
:
linux
addons
:
apt
:
sources
:
-
llvm-toolchain-trusty-5.0
-
llvm-toolchain-trusty-6.0
-
ubuntu-toolchain-r-test
packages
:
-
clang-5.0
-
clang-6.0
-
g++-4.9
# imake
-
xutils-dev
# X11 libaries
-
libxcomposite-dev
-
libxfont-dev
-
libxinerama-dev
-
libxrandr-dev
-
libxtst-dev
-
x11proto-fonts-dev
env
:
-
MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
-
MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
-
STATIC_ANALYSIS="no"
before_install
:
-
sudo apt-get update -qq
# imake
-
sudo apt-get install -y xutils-dev
# X11 libaries
-
sudo apt-get install -y libxcomposite-dev libxfont-dev libxinerama-dev libxrandr-dev libxtst-dev x11proto-fonts-dev
-
eval "${MATRIX_EVAL}"
script
:
# run static analysis tools
-
./run-static-analysis.sh
# build all packages
-
make
doc/libNX_X11/lcUniConv/8bit_tab_to_h.c
View file @
5a8549c6
...
...
@@ -121,9 +121,15 @@ int main (int argc, char *argv[])
{
char
*
fname
=
malloc
(
strlen
(
directory
)
+
strlen
(
filename
)
+
1
);
if
(
fname
==
NULL
)
{
printf
(
"malloc failed
\n
"
);
exit
(
1
);
}
strcpy
(
fname
,
directory
);
strcat
(
fname
,
filename
);
f
=
fopen
(
fname
,
"w"
);
if
(
f
==
NULL
)
free
(
fname
);
exit
(
1
);
}
...
...
nx-X11/lib/include/xtrans/Xtrans.c
View file @
5a8549c6
...
...
@@ -980,9 +980,10 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
{
prmsg
(
1
,
"GetMyAddr: malloc failed
\n
"
);
return
-
1
;
}
}
else
{
memcpy
(
*
addrp
,
ciptr
->
addr
,
ciptr
->
addrlen
);
free
(
addrp
);
}
return
0
;
}
#endif
...
...
@@ -1003,7 +1004,7 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
return
-
1
;
}
memcpy
(
*
addrp
,
ciptr
->
peeraddr
,
ciptr
->
peeraddrlen
);
free
(
addrp
);
return
0
;
}
...
...
nx-X11/lib/include/xtrans/Xtranssock.c
View file @
5a8549c6
...
...
@@ -2454,7 +2454,6 @@ SocketUNIXConnectPost:
ciptr
->
peeraddrlen
=
namelen
;
memcpy
(
ciptr
->
addr
,
&
sockname
,
ciptr
->
addrlen
);
memcpy
(
ciptr
->
peeraddr
,
&
sockname
,
ciptr
->
peeraddrlen
);
return
0
;
}
...
...
nx-X11/programs/Xserver/Xi/exevents.c
View file @
5a8549c6
...
...
@@ -656,6 +656,7 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx)
if
(
!
others
)
return
BadAlloc
;
if
(
!
pWin
->
optional
->
inputMasks
&&
!
MakeInputMasks
(
pWin
))
free
(
others
);
return
BadAlloc
;
bzero
((
char
*
)
&
others
->
mask
[
0
],
sizeof
(
Mask
)
*
EMASKSIZE
);
others
->
mask
[
mskidx
]
=
mask
;
...
...
nx-X11/programs/Xserver/dix/cursor.c
View file @
5a8549c6
...
...
@@ -371,6 +371,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
if
(
!
pShare
)
{
FreeCursorBits
(
bits
);
free
(
pCurs
);
return
BadAlloc
;
}
pShare
->
font
=
sourcefont
;
...
...
nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
View file @
5a8549c6
...
...
@@ -629,10 +629,12 @@ int what;
screenContext
[
i
]
=
CreateGC
((
DrawablePtr
)
pWin
,
(
BITS32
)
0
,
(
XID
*
)
NULL
,
&
status
);
if
(
!
screenContext
[
i
])
free
(
prect
);
return
;
numGCs
++
;
if
(
!
AddResource
(
FakeClientID
(
0
),
ResType
,
(
void
*
)
screenContext
[
i
]))
free
(
prect
);
return
;
}
pGC
=
screenContext
[
i
];
...
...
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
View file @
5a8549c6
...
...
@@ -995,6 +995,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
listsBase
=
(
GlyphListPtr
)
malloc
(
nlist
*
sizeof
(
GlyphListRec
));
if
(
!
listsBase
)
free
(
glyphsBase
);
return
BadAlloc
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
View file @
5a8549c6
...
...
@@ -283,6 +283,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
bitsPerPixel
);
#endif
free
(
image_index
);
return
NULL
;
}
...
...
@@ -315,6 +316,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf
(
stderr
,
"******PngCompressData: PANIC! Failed creating the png_create_write_struct.
\n
"
);
#endif
free
(
image_index
);
return
NULL
;
}
...
...
@@ -327,7 +329,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif
png_destroy_write_struct
(
&
png_ptr
,
NULL
);
free
(
image_index
);
return
NULL
;
}
...
...
@@ -339,6 +341,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
image_index
);
return
NULL
;
}
...
...
@@ -360,6 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
PNG_DEST_SIZE
(
w
,
h
));
#endif
free
(
image_index
);
return
NULL
;
}
...
...
@@ -374,7 +378,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
pngCompBuf
);
return
NULL
;
}
...
...
@@ -470,7 +473,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct
(
&
png_ptr
,
&
info_ptr
);
free
(
pngCompBuf
);
free
(
image_index
);
return
NULL
;
}
...
...
@@ -484,7 +487,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf
(
stderr
,
"******PngCompressData: PANIC! Cannot allocate [%d] bytes.
\n
"
,
(
int
)
(
w
*
sizeof
(
CARD8
)));
#endif
free
(
image_index
);
return
NULL
;
}
...
...
@@ -516,7 +519,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif
free
(
pngCompBuf
);
free
(
image_index
);
return
NULL
;
}
...
...
nx-X11/programs/Xserver/mi/miexpose.c
View file @
5a8549c6
...
...
@@ -766,10 +766,12 @@ int what;
screenContext
[
i
]
=
CreateGC
((
DrawablePtr
)
pWin
,
(
BITS32
)
0
,
(
XID
*
)
NULL
,
&
status
);
if
(
!
screenContext
[
i
])
free
(
prect
);
return
;
numGCs
++
;
if
(
!
AddResource
(
FakeClientID
(
0
),
ResType
,
(
void
*
)
screenContext
[
i
]))
free
(
prect
);
return
;
}
pGC
=
screenContext
[
i
];
...
...
nx-X11/programs/Xserver/mi/mizerline.c
View file @
5a8549c6
...
...
@@ -158,6 +158,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit)
pspanInit
=
(
DDXPointPtr
)
malloc
(
list_len
*
sizeof
(
DDXPointRec
));
pwidthInit
=
(
int
*
)
malloc
(
list_len
*
sizeof
(
int
));
if
(
!
pspanInit
||
!
pwidthInit
)
free
(
pspanInit
);
free
(
pwidthInit
);
return
;
Nspans
=
0
;
...
...
nx-X11/programs/Xserver/render/render.c
View file @
5a8549c6
...
...
@@ -1346,6 +1346,8 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
listsBase
=
(
GlyphListPtr
)
malloc
(
nlist
*
sizeof
(
GlyphListRec
));
if
(
!
listsBase
)
free
(
glyphsBase
);
free
(
listsBase
);
return
BadAlloc
;
}
buffer
=
(
CARD8
*
)
(
stuff
+
1
);
...
...
@@ -2918,9 +2920,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
result
=
(
*
PanoramiXSaveRenderVector
[
X_RenderFillRectangles
])
(
client
);
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
return
result
;
}
...
...
@@ -2979,10 +2979,9 @@ PanoramiXRenderTrapezoids(ClientPtr client)
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
free
(
extra
);
return
result
;
}
...
...
@@ -3038,9 +3037,8 @@ PanoramiXRenderTriangles(ClientPtr client)
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
free
(
extra
);
return
result
;
}
...
...
@@ -3092,9 +3090,8 @@ PanoramiXRenderTriStrip(ClientPtr client)
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
free
(
extra
);
return
result
;
}
...
...
@@ -3146,9 +3143,8 @@ PanoramiXRenderTriFan(ClientPtr client)
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
free
(
extra
);
return
result
;
}
...
...
@@ -3276,9 +3272,8 @@ PanoramiXRenderAddTraps (ClientPtr client)
result
=
(
*
PanoramiXSaveRenderVector
[
X_RenderAddTraps
])
(
client
);
if
(
result
!=
Success
)
break
;
}
free
(
extra
);
}
free
(
extra
);
return
result
;
}
...
...
nxcomp/src/Children.cpp
View file @
5a8549c6
...
...
@@ -1038,6 +1038,7 @@ int UnsetEnv(const char *name)
}
result
=
0
;
delete
[]
varName
;
#else
...
...
run-static-analysis.sh
0 → 100755
View file @
5a8549c6
#!/bin/bash
if
[[
"
${
STATIC_ANALYSIS
}
"
==
"yes"
]]
;
then
# cppcheck
if
!
[
-x
"
$(
command
-v
cppcheck
)
"
]
;
then
echo
'Error: cppcheck is not installed.'
>
&2
exit
1
fi
CPPCHECK_OPTS
=
'--error-exitcode=0 --force --quiet'
# we exclude some external projects
CPPCHECK_EXCLUDES
=
'-i ./nx-X11/extras/Mesa* -i ./nx-X11/extras/Mesa_* -i nx-X11/programs/Xserver/GL/mesa*'
echo
"
$(
cppcheck
--version
)
:"
;
cppcheck
$CPPCHECK_OPTS
$CPPCHECK_EXCLUDES
.
;
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment