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
42fb6833
Commit
42fb6833
authored
May 26, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Screen.c: scope improvements
parent
f534a486
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
25 deletions
+13
-25
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+13
-25
No files found.
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
42fb6833
...
...
@@ -837,24 +837,10 @@ void freeDepths(DepthPtr depths, int num)
SAFE_free
(
depths
);
}
Bool
nxagentOpenScreen
(
ScreenPtr
pScreen
,
int
argc
,
char
*
argv
[])
Bool
nxagentOpenScreen
(
ScreenPtr
pScreen
,
int
argc
,
char
*
argv
[])
{
VisualPtr
visuals
;
DepthPtr
depths
;
int
numVisuals
,
numDepths
;
int
depthIndex
;
Bool
resetAgentPosition
=
False
;
VisualID
defaultVisual
;
int
rootDepth
;
void
*
pFrameBufferBits
;
int
bitsPerPixel
;
int
sizeInBytes
;
int
defaultVisualIndex
=
0
;
#ifdef TEST
fprintf
(
stderr
,
"nxagentOpenScreen: Called for screen index [%d].
\n
"
,
pScreen
->
myNum
);
...
...
@@ -1161,7 +1147,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* Initialize the depths.
*/
depths
=
(
DepthPtr
)
malloc
(
nxagentNumDepths
*
sizeof
(
DepthRec
));
DepthPtr
depths
=
(
DepthPtr
)
malloc
(
nxagentNumDepths
*
sizeof
(
DepthRec
));
for
(
int
i
=
0
;
i
<
nxagentNumDepths
;
i
++
)
{
...
...
@@ -1179,10 +1165,12 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
"[%d].
\n
"
,
nxagentNumVisuals
);
#endif
numVisuals
=
0
;
numDepths
=
nxagentNumDepths
;
int
numVisuals
=
0
;
int
numDepths
=
nxagentNumDepths
;
visuals
=
(
VisualPtr
)
malloc
(
nxagentNumVisuals
*
sizeof
(
VisualRec
));
VisualPtr
visuals
=
(
VisualPtr
)
malloc
(
nxagentNumVisuals
*
sizeof
(
VisualRec
));
int
defaultVisualIndex
=
0
;
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
{
...
...
@@ -1231,10 +1219,9 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if
(
j
<
numVisuals
)
continue
;
}
depthIndex
=
UNDEFINED
;
int
depthIndex
=
UNDEFINED
;
#if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf
(
stderr
,
"Debug: Added visual [%lu].
\n
"
,
...
...
@@ -1292,12 +1279,13 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
visuals
[
defaultVisualIndex
].
nplanes
);
#endif
defaultVisual
=
visuals
[
defaultVisualIndex
].
vid
;
rootDepth
=
visuals
[
defaultVisualIndex
].
nplanes
;
VisualID
defaultVisual
=
visuals
[
defaultVisualIndex
].
vid
;
int
rootDepth
=
visuals
[
defaultVisualIndex
].
nplanes
;
nxagentInitAlphaVisual
();
bitsPerPixel
=
nxagentBitsPerPixel
(
rootDepth
);
int
bitsPerPixel
=
nxagentBitsPerPixel
(
rootDepth
);
int
sizeInBytes
;
if
(
bitsPerPixel
==
1
)
{
...
...
@@ -1313,7 +1301,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
"[%d] bitsPerPixel [%d] sizeInBytes [%d]
\n
"
,
rootDepth
,
bitsPerPixel
,
sizeInBytes
);
#endif
pFrameBufferBits
=
(
char
*
)
malloc
(
sizeInBytes
);
void
*
pFrameBufferBits
=
(
char
*
)
malloc
(
sizeInBytes
);
if
(
!
pFrameBufferBits
)
{
...
...
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